@@ -159,7 +159,7 @@ |
||
| 159 | 159 | public function delayTimes($event, $ticks, $limit, callable $listener) |
| 160 | 160 | { |
| 161 | 161 | $counter = 0; |
| 162 | - return $this->times($event, $ticks+$limit-1, function(...$args) use(&$counter, $event, $ticks, $listener) { |
|
| 162 | + return $this->times($event, $ticks + $limit - 1, function(...$args) use(&$counter, $event, $ticks, $listener) { |
|
| 163 | 163 | if (++$counter >= $ticks) |
| 164 | 164 | { |
| 165 | 165 | $listener(...$args); |
@@ -28,6 +28,6 @@ |
||
| 28 | 28 | }); |
| 29 | 29 | |
| 30 | 30 | $counter = 0; |
| 31 | -$emitter->emit('event.number', [ ++$counter ]); |
|
| 32 | -$emitter->emit('event.number', [ ++$counter ]); |
|
| 33 | -$emitter->emit('event.number', [ ++$counter ]); |
|
| 31 | +$emitter->emit('event.number', [ ++$counter]); |
|
| 32 | +$emitter->emit('event.number', [ ++$counter]); |
|
| 33 | +$emitter->emit('event.number', [ ++$counter]); |
|
@@ -31,5 +31,5 @@ |
||
| 31 | 31 | $counterMax = 5; |
| 32 | 32 | |
| 33 | 33 | while ($counter < $counterMax) { |
| 34 | - $emitter->emit('event.number', [ ++$counter ]); |
|
| 34 | + $emitter->emit('event.number', [ ++$counter]); |
|
| 35 | 35 | } |
@@ -26,4 +26,4 @@ |
||
| 26 | 26 | echo "User '$user' has started this script at $time.\n"; |
| 27 | 27 | }); |
| 28 | 28 | |
| 29 | -$emitter->emit('script.start', [ get_current_user(), date('H:i:s Y-m-d') ]); |
|
| 29 | +$emitter->emit('script.start', [get_current_user(), date('H:i:s Y-m-d')]); |
|
@@ -35,5 +35,5 @@ |
||
| 35 | 35 | //$source->copyEvent($target, 'account.pass'); // uncomment this to copy also 'account.pass' event! |
| 36 | 36 | |
| 37 | 37 | // while the emits are being emited on $source emitter. |
| 38 | -$source->emit('account.name', [ 'admin' ]); |
|
| 39 | -$source->emit('account.pass', [ 'admin1234' ]); |
|
| 38 | +$source->emit('account.name', ['admin']); |
|
| 39 | +$source->emit('account.pass', ['admin1234']); |
|
@@ -36,5 +36,5 @@ |
||
| 36 | 36 | $source->forwardEvents($target); |
| 37 | 37 | |
| 38 | 38 | // while the emits are being emited on $source emitter. |
| 39 | -$source->emit('account.name', [ 'admin' ]); |
|
| 40 | -$source->emit('account.pass', [ 'admin1234' ]); |
|
| 39 | +$source->emit('account.name', ['admin']); |
|
| 40 | +$source->emit('account.pass', ['admin1234']); |
|
@@ -32,4 +32,4 @@ |
||
| 32 | 32 | echo "I am 3rd listener and I got new state=$state too!\n"; |
| 33 | 33 | }); |
| 34 | 34 | |
| 35 | -$emitter->emit('state.change', [ 'new_state' ]); |
|
| 35 | +$emitter->emit('state.change', ['new_state']); |
|
@@ -31,5 +31,5 @@ |
||
| 31 | 31 | $counterMax = 5; |
| 32 | 32 | |
| 33 | 33 | while ($counter < $counterMax) { |
| 34 | - $emitter->emit('event.number', [ ++$counter ]); |
|
| 34 | + $emitter->emit('event.number', [ ++$counter]); |
|
| 35 | 35 | } |
@@ -31,5 +31,5 @@ |
||
| 31 | 31 | $counterMax = 5; |
| 32 | 32 | |
| 33 | 33 | while ($counter < $counterMax) { |
| 34 | - $emitter->emit('event.number', [ ++$counter ]); |
|
| 34 | + $emitter->emit('event.number', [ ++$counter]); |
|
| 35 | 35 | } |