Reducing nesting in the code

Signed-off-by: Valentin Popov <info@valentineus.link>
This commit is contained in:
Valentin Popov 2018-09-20 18:05:02 +04:00
parent 67cf87d17c
commit 36ddf415c4
Signed by: Valentin Popov
GPG Key ID: 269A00ACA90A8EA3

View File

@ -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 );
foreach ( $services as $service ) {
if ( !empty( $service->status ) ) {
if ( empty( $service->status ) ) {
return;
}
$curl = new \curl();
$event = (array) $this->get_custom_data();
@ -58,5 +61,4 @@ class process_events_task extends \core\task\adhoc_task {
$curl->getResponse();
}
}
}
}