@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | protected function setUp() |
41 | 41 | { |
42 | - $this->logPath = __DIR__ . '/log'; |
|
42 | + $this->logPath = __DIR__.'/log'; |
|
43 | 43 | |
44 | 44 | $this->clearLog(); |
45 | 45 | } |
@@ -86,21 +86,21 @@ discard block |
||
86 | 86 | |
87 | 87 | unset($options['events']['test_event_code']['listeners'][3]); |
88 | 88 | |
89 | - $eventDispatcher = new EventDispatcher; |
|
89 | + $eventDispatcher = new EventDispatcher; |
|
90 | 90 | $eventDispatcher->readEventConfiguration( |
91 | 91 | $this->getEventFileConfigPath('array'), |
92 | 92 | 'array' |
93 | 93 | ); |
94 | 94 | $this->assertEquals($options['events'], $eventDispatcher->getEventConfiguration()); |
95 | 95 | |
96 | - $eventDispatcher = new EventDispatcher; |
|
96 | + $eventDispatcher = new EventDispatcher; |
|
97 | 97 | $eventDispatcher->readEventConfiguration( |
98 | 98 | $this->getEventFileConfigPath('json'), |
99 | 99 | 'json' |
100 | 100 | ); |
101 | 101 | $this->assertEquals($options['events'], $eventDispatcher->getEventConfiguration()); |
102 | 102 | |
103 | - $eventDispatcher = new EventDispatcher; |
|
103 | + $eventDispatcher = new EventDispatcher; |
|
104 | 104 | $eventDispatcher->readEventConfiguration( |
105 | 105 | $this->getEventFileConfigPath('ini'), |
106 | 106 | 'ini' |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | 'object' => 'BlueEvent\Event\BaseEvent', |
165 | 165 | 'listeners' => [ |
166 | 166 | 'BlueEventTest\EventDispatcherTest::trigger', |
167 | - function ($event) { |
|
167 | + function($event) { |
|
168 | 168 | /** @var $event \BlueEvent\Event\BaseEvent */ |
169 | 169 | self::$eventTriggered += $event->getEventParameters()['value']; |
170 | 170 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | 'object' => 'BlueEvent\Event\BaseEvent', |
198 | 198 | 'listeners' => [ |
199 | 199 | 'BlueEventTest\EventDispatcherTest::triggerStop', |
200 | - function ($event) { |
|
200 | + function($event) { |
|
201 | 201 | /** @var $event \BlueEvent\Event\BaseEvent */ |
202 | 202 | self::$eventTriggered += $event->getEventParameters()['value']; |
203 | 203 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $instance->addEventListener( |
220 | 220 | 'test_event', |
221 | 221 | [ |
222 | - function ($event) { |
|
222 | + function($event) { |
|
223 | 223 | /** @var $event \BlueEvent\Event\BaseEvent */ |
224 | 224 | self::$eventTriggered += $event->getEventParameters()['value']; |
225 | 225 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $instance->addEventListener( |
250 | 250 | 'test_event', |
251 | 251 | [ |
252 | - function ($event) { |
|
252 | + function($event) { |
|
253 | 253 | /** @var $event \BlueEvent\Event\BaseEvent */ |
254 | 254 | self::$eventTriggered += $event->getEventParameters()['value']; |
255 | 255 | } |
@@ -373,15 +373,15 @@ discard block |
||
373 | 373 | 'listeners' => [ |
374 | 374 | [__CLASS__, 'trigger'], |
375 | 375 | 'BlueEventTest\EventDispatcherTest::triggerError', |
376 | - function () { |
|
376 | + function() { |
|
377 | 377 | } |
378 | 378 | ] |
379 | 379 | ], |
380 | 380 | ]); |
381 | 381 | |
382 | - $this->assertFileNotExists($this->logPath . self::EVENT_LOG_NAME); |
|
382 | + $this->assertFileNotExists($this->logPath.self::EVENT_LOG_NAME); |
|
383 | 383 | $instance->triggerEvent('test_event'); |
384 | - $this->assertFileExists($this->logPath . self::EVENT_LOG_NAME); |
|
384 | + $this->assertFileExists($this->logPath.self::EVENT_LOG_NAME); |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | /** |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | $extension = 'php'; |
508 | 508 | } |
509 | 509 | |
510 | - return __DIR__ . '/Config/testConfig/config.' . $extension; |
|
510 | + return __DIR__.'/Config/testConfig/config.'.$extension; |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | /** |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | 'test_event' => [ |
550 | 550 | 'object' => 'BlueEvent\Event\BaseEvent', |
551 | 551 | 'listeners' => [ |
552 | - function ($event) use (&$testData) { |
|
552 | + function($event) use (&$testData) { |
|
553 | 553 | /** @var $event \BlueEvent\Event\BaseEvent */ |
554 | 554 | $testData['test_event'] = $event->getEventParameters(); |
555 | 555 | } |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | 'test_event_other' => [ |
559 | 559 | 'object' => 'BlueEvent\Event\BaseEvent', |
560 | 560 | 'listeners' => [ |
561 | - function ($event) use (&$testData) { |
|
561 | + function($event) use (&$testData) { |
|
562 | 562 | /** @var $event \BlueEvent\Event\BaseEvent */ |
563 | 563 | $testData['test_event_other'] = $event->getEventParameters(); |
564 | 564 | } |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | |
586 | 586 | protected function clearLog() |
587 | 587 | { |
588 | - $logFile = $this->logPath . self::EVENT_LOG_NAME; |
|
588 | + $logFile = $this->logPath.self::EVENT_LOG_NAME; |
|
589 | 589 | |
590 | 590 | if (file_exists($logFile)) { |
591 | 591 | unlink($logFile); |
@@ -31,9 +31,9 @@ discard block |
||
31 | 31 | |
32 | 32 | $instance->logEvents[] = 'some_name'; |
33 | 33 | |
34 | - $this->assertFileNotExists($this->logPath . EventDispatcherTest::EVENT_LOG_NAME); |
|
34 | + $this->assertFileNotExists($this->logPath.EventDispatcherTest::EVENT_LOG_NAME); |
|
35 | 35 | $instance->makeLogEvent('some_name', 'some_listener', EventDispatcher::EVENT_STATUS_OK); |
36 | - $this->assertFileExists($this->logPath . EventDispatcherTest::EVENT_LOG_NAME); |
|
36 | + $this->assertFileExists($this->logPath.EventDispatcherTest::EVENT_LOG_NAME); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
@@ -55,15 +55,15 @@ discard block |
||
55 | 55 | $instance->logEvents[] = 'some_name'; |
56 | 56 | $instance->logEvents[] = 'some_name_2'; |
57 | 57 | |
58 | - $this->assertFileNotExists($this->logPath . EventDispatcherTest::EVENT_LOG_NAME); |
|
58 | + $this->assertFileNotExists($this->logPath.EventDispatcherTest::EVENT_LOG_NAME); |
|
59 | 59 | $instance->makeLogEvent('some_name', 'some_listener', EventDispatcher::EVENT_STATUS_OK); |
60 | 60 | $instance->makeLogEvent( |
61 | 61 | 'some_name_2', |
62 | - function () { |
|
62 | + function() { |
|
63 | 63 | }, |
64 | 64 | EventDispatcher::EVENT_STATUS_OK |
65 | 65 | ); |
66 | - $this->assertFileExists($this->logPath . EventDispatcherTest::EVENT_LOG_NAME); |
|
66 | + $this->assertFileExists($this->logPath.EventDispatcherTest::EVENT_LOG_NAME); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | public function testEventLogWithGivenLogObject() |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | |
82 | 82 | $instance->logEvents[] = 'some_name'; |
83 | 83 | |
84 | - $this->assertFileNotExists($this->logPath . EventDispatcherTest::EVENT_LOG_NAME); |
|
84 | + $this->assertFileNotExists($this->logPath.EventDispatcherTest::EVENT_LOG_NAME); |
|
85 | 85 | $instance->makeLogEvent('some_name', ['class', 'method'], EventDispatcher::EVENT_STATUS_OK); |
86 | - $this->assertFileExists($this->logPath . EventDispatcherTest::EVENT_LOG_NAME); |
|
86 | + $this->assertFileExists($this->logPath.EventDispatcherTest::EVENT_LOG_NAME); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -91,14 +91,14 @@ discard block |
||
91 | 91 | */ |
92 | 92 | protected function setUp() |
93 | 93 | { |
94 | - $this->logPath = __DIR__ . '/log'; |
|
94 | + $this->logPath = __DIR__.'/log'; |
|
95 | 95 | |
96 | 96 | $this->clearLog(); |
97 | 97 | } |
98 | 98 | |
99 | 99 | protected function clearLog() |
100 | 100 | { |
101 | - $logFile = $this->logPath . EventDispatcherTest::EVENT_LOG_NAME; |
|
101 | + $logFile = $this->logPath.EventDispatcherTest::EVENT_LOG_NAME; |
|
102 | 102 | |
103 | 103 | if (file_exists($logFile)) { |
104 | 104 | unlink($logFile); |
@@ -18,7 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | $arrayConfig = new YamlConfig; |
20 | 20 | $config = $arrayConfig->readConfig( |
21 | - __DIR__ . '/testConfig/config.yaml' |
|
21 | + __DIR__.'/testConfig/config.yaml' |
|
22 | 22 | ); |
23 | 23 | |
24 | 24 | $this->assertEquals( |
@@ -18,7 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | $arrayConfig = new JsonConfig; |
20 | 20 | $config = $arrayConfig->readConfig( |
21 | - __DIR__ . '/testConfig/config.json' |
|
21 | + __DIR__.'/testConfig/config.json' |
|
22 | 22 | ); |
23 | 23 | |
24 | 24 | $this->assertEquals( |
@@ -18,7 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | $arrayConfig = new IniConfig; |
20 | 20 | $config = $arrayConfig->readConfig( |
21 | - __DIR__ . '/testConfig/config.ini' |
|
21 | + __DIR__.'/testConfig/config.ini' |
|
22 | 22 | ); |
23 | 23 | |
24 | 24 | $this->assertEquals( |
@@ -31,6 +31,6 @@ |
||
31 | 31 | */ |
32 | 32 | public function getEventFileConfigPath() |
33 | 33 | { |
34 | - return __DIR__ . '/testConfig/config.php'; |
|
34 | + return __DIR__.'/testConfig/config.php'; |
|
35 | 35 | } |
36 | 36 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | $arrayConfig = new XmlConfig; |
20 | 20 | $config = $arrayConfig->readConfig( |
21 | - __DIR__ . '/testConfig/config.xml' |
|
21 | + __DIR__.'/testConfig/config.xml' |
|
22 | 22 | ); |
23 | 23 | |
24 | 24 | $this->assertEquals( |
@@ -83,7 +83,7 @@ |
||
83 | 83 | return 'Closure'; |
84 | 84 | |
85 | 85 | case is_array($eventListener): |
86 | - return $eventListener[0] . '::' . $eventListener[1]; |
|
86 | + return $eventListener[0].'::'.$eventListener[1]; |
|
87 | 87 | |
88 | 88 | default: |
89 | 89 | return $eventListener; |
@@ -217,13 +217,13 @@ discard block |
||
217 | 217 | public function readEventConfiguration($path, $type) |
218 | 218 | { |
219 | 219 | if (!file_exists($path)) { |
220 | - throw new \InvalidArgumentException('File ' . $path . 'don\'t exists.'); |
|
220 | + throw new \InvalidArgumentException('File '.$path.'don\'t exists.'); |
|
221 | 221 | } |
222 | 222 | |
223 | - $name = '\BlueEvent\Event\Config\\' . ucfirst($type) . 'Config'; |
|
223 | + $name = '\BlueEvent\Event\Config\\'.ucfirst($type).'Config'; |
|
224 | 224 | |
225 | 225 | if (!class_exists($name)) { |
226 | - throw new \InvalidArgumentException('Incorrect configuration type: ' . $type); |
|
226 | + throw new \InvalidArgumentException('Incorrect configuration type: '.$type); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | /** @var \BlueEvent\Event\Config\ConfigReader $reader */ |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | public function setEventLog($logEvents) |
242 | 242 | { |
243 | - $this->options['log_events'] = (bool)$logEvents; |
|
243 | + $this->options['log_events'] = (bool) $logEvents; |
|
244 | 244 | return $this; |
245 | 245 | } |
246 | 246 | |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | */ |
270 | 270 | public function logAllEvents($log = true) |
271 | 271 | { |
272 | - $this->options['log_all_events'] = (bool)$log; |
|
272 | + $this->options['log_all_events'] = (bool) $log; |
|
273 | 273 | return $this; |
274 | 274 | } |
275 | 275 |