Reducing nesting in the code
Signed-off-by: Valentin Popov <info@valentineus.link>
This commit is contained in:
		@@ -45,7 +45,10 @@ class process_events_task extends \core\task\adhoc_task {
 | 
				
			|||||||
        $services = \local_webhooks_api::get_services_by_event( $this->get_custom_data()->eventname );
 | 
					        $services = \local_webhooks_api::get_services_by_event( $this->get_custom_data()->eventname );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        foreach ( $services as $service ) {
 | 
					        foreach ( $services as $service ) {
 | 
				
			||||||
            if ( !empty( $service->status ) ) {
 | 
					            if ( empty( $service->status ) ) {
 | 
				
			||||||
 | 
					                return;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $curl = new \curl();
 | 
					            $curl = new \curl();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $event = (array) $this->get_custom_data();
 | 
					            $event = (array) $this->get_custom_data();
 | 
				
			||||||
@@ -58,5 +61,4 @@ class process_events_task extends \core\task\adhoc_task {
 | 
				
			|||||||
            $curl->getResponse();
 | 
					            $curl->getResponse();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user