@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $callable = $this->convertToListener($class, $event); |
| 49 | 49 | |
| 50 | - if ( $callable === false ) return null; |
|
| 50 | + if ($callable === false) return null; |
|
| 51 | 51 | |
| 52 | 52 | return $this->addListener($event, $callable, $priority); |
| 53 | 53 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | $callable = $this->convertToListener($class, $event); |
| 59 | 59 | |
| 60 | - if ( $callable === false ) return null; |
|
| 60 | + if ($callable === false) return null; |
|
| 61 | 61 | |
| 62 | 62 | return $this->addOneTimeListener($event, $callable, $priority); |
| 63 | 63 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | protected function convertToListener($class, $event) { |
| 67 | 67 | |
| 68 | - if ( !class_exists($class) ) { |
|
| 68 | + if (!class_exists($class)) { |
|
| 69 | 69 | |
| 70 | 70 | $this->logger->error("Cannot subscribe class $class to event $event: cannot find class"); |
| 71 | 71 | |
@@ -91,11 +91,11 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | public function load($plugins) { |
| 93 | 93 | |
| 94 | - if ( !empty($plugins) ) { |
|
| 94 | + if (!empty($plugins)) { |
|
| 95 | 95 | |
| 96 | - foreach( $plugins as $name => $plugin ) { |
|
| 96 | + foreach ($plugins as $name => $plugin) { |
|
| 97 | 97 | |
| 98 | - if ( !isset($plugin['class']) || !isset($plugin["event"]) ) { |
|
| 98 | + if (!isset($plugin['class']) || !isset($plugin["event"])) { |
|
| 99 | 99 | |
| 100 | 100 | $this->logger->error("Invalid plugin definition", $plugin); |
| 101 | 101 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $priority = isset($plugin['priority']) ? $plugin['priority'] : 0; |
| 107 | 107 | $onetime = isset($plugin['onetime']) ? $plugin['onetime'] : 0; |
| 108 | 108 | |
| 109 | - if ( $onetime ) $this->subscribeOnce($plugin['event'], $plugin['class'], $priority); |
|
| 109 | + if ($onetime) $this->subscribeOnce($plugin['event'], $plugin['class'], $priority); |
|
| 110 | 110 | else $this->subscribe($plugin['event'], $plugin['class'], $priority); |
| 111 | 111 | |
| 112 | 112 | } |
@@ -47,7 +47,9 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $callable = $this->convertToListener($class, $event); |
| 49 | 49 | |
| 50 | - if ( $callable === false ) return null; |
|
| 50 | + if ( $callable === false ) { |
|
| 51 | + return null; |
|
| 52 | + } |
|
| 51 | 53 | |
| 52 | 54 | return $this->addListener($event, $callable, $priority); |
| 53 | 55 | |
@@ -57,7 +59,9 @@ discard block |
||
| 57 | 59 | |
| 58 | 60 | $callable = $this->convertToListener($class, $event); |
| 59 | 61 | |
| 60 | - if ( $callable === false ) return null; |
|
| 62 | + if ( $callable === false ) { |
|
| 63 | + return null; |
|
| 64 | + } |
|
| 61 | 65 | |
| 62 | 66 | return $this->addOneTimeListener($event, $callable, $priority); |
| 63 | 67 | |
@@ -106,8 +110,11 @@ discard block |
||
| 106 | 110 | $priority = isset($plugin['priority']) ? $plugin['priority'] : 0; |
| 107 | 111 | $onetime = isset($plugin['onetime']) ? $plugin['onetime'] : 0; |
| 108 | 112 | |
| 109 | - if ( $onetime ) $this->subscribeOnce($plugin['event'], $plugin['class'], $priority); |
|
| 110 | - else $this->subscribe($plugin['event'], $plugin['class'], $priority); |
|
| 113 | + if ( $onetime ) { |
|
| 114 | + $this->subscribeOnce($plugin['event'], $plugin['class'], $priority); |
|
| 115 | + } else { |
|
| 116 | + $this->subscribe($plugin['event'], $plugin['class'], $priority); |
|
| 117 | + } |
|
| 111 | 118 | |
| 112 | 119 | } |
| 113 | 120 | |