@@ -240,13 +240,13 @@ |
||
| 240 | 240 | */ |
| 241 | 241 | public function setAll($args = [], $reassign = false) |
| 242 | 242 | { |
| 243 | - $this->type = isset($args[0]) && ($this->type === '' || $reassign) ? $args[0] : $this->type; |
|
| 244 | - $this->pid = isset($args[1]) && ($this->pid === '' || $reassign) ? $args[1] : $this->pid; |
|
| 245 | - $this->destination = isset($args[2]) && ($this->destination === '' || $reassign) ? $args[2] : $this->destination; |
|
| 246 | - $this->origin = isset($args[3]) && ($this->origin === '' || $reassign) ? $args[3] : $this->origin; |
|
| 247 | - $this->message = isset($args[4]) && ($this->message === '' || $reassign) ? $args[4] : $this->message; |
|
| 248 | - $this->exception = isset($args[5]) && ($this->exception === '' || $reassign) ? $args[5] : $this->exception; |
|
| 249 | - $this->timestamp = isset($args[6]) && ($this->timestamp == 0 || $reassign) ? $args[6] : $this->timestamp; |
|
| 243 | + $this->type = isset($args[0]) && ($this->type === '' || $reassign) ? $args[0] : $this->type; |
|
| 244 | + $this->pid = isset($args[1]) && ($this->pid === '' || $reassign) ? $args[1] : $this->pid; |
|
| 245 | + $this->destination = isset($args[2]) && ($this->destination === '' || $reassign) ? $args[2] : $this->destination; |
|
| 246 | + $this->origin = isset($args[3]) && ($this->origin === '' || $reassign) ? $args[3] : $this->origin; |
|
| 247 | + $this->message = isset($args[4]) && ($this->message === '' || $reassign) ? $args[4] : $this->message; |
|
| 248 | + $this->exception = isset($args[5]) && ($this->exception === '' || $reassign) ? $args[5] : $this->exception; |
|
| 249 | + $this->timestamp = isset($args[6]) && ($this->timestamp == 0 || $reassign) ? $args[6] : $this->timestamp; |
|
| 250 | 250 | |
| 251 | 251 | return $this; |
| 252 | 252 | } |
@@ -143,6 +143,6 @@ |
||
| 143 | 143 | */ |
| 144 | 144 | public function setPointer($stack, $pointer) |
| 145 | 145 | { |
| 146 | - $this->pointer = [ $stack, $pointer ]; |
|
| 146 | + $this->pointer = [$stack, $pointer]; |
|
| 147 | 147 | } |
| 148 | 148 | } |
@@ -124,8 +124,8 @@ discard block |
||
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | $this->buses[$name] = $channel; |
| 127 | - $this->events[$name] = $channel->copyEvents($this, [ 'connect', 'disconnect' ]); |
|
| 128 | - $this->events[$name][] = $channel->on('input', [ $this, 'handleReceive' ]); |
|
| 127 | + $this->events[$name] = $channel->copyEvents($this, ['connect', 'disconnect']); |
|
| 128 | + $this->events[$name][] = $channel->on('input', [$this, 'handleReceive']); |
|
| 129 | 129 | |
| 130 | 130 | return $this; |
| 131 | 131 | } |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | { |
| 413 | 413 | if ($this->getInput()->handle($sender, $protocol)) |
| 414 | 414 | { |
| 415 | - $this->emit('input', [ $sender, $protocol ]); |
|
| 415 | + $this->emit('input', [$sender, $protocol]); |
|
| 416 | 416 | } |
| 417 | 417 | } |
| 418 | 418 | |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | */ |
| 423 | 423 | public function pull($sender, ProtocolInterface $protocol) |
| 424 | 424 | { |
| 425 | - $this->emit('input', [ $sender, $protocol ]); |
|
| 425 | + $this->emit('input', [$sender, $protocol]); |
|
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | /** |
@@ -569,7 +569,7 @@ discard block |
||
| 569 | 569 | |
| 570 | 570 | if ($status) |
| 571 | 571 | { |
| 572 | - $this->emit('output', [ $name, $message ]); |
|
| 572 | + $this->emit('output', [$name, $message]); |
|
| 573 | 573 | } |
| 574 | 574 | |
| 575 | 575 | return $status; |
@@ -632,7 +632,7 @@ discard block |
||
| 632 | 632 | |
| 633 | 633 | if ($status) |
| 634 | 634 | { |
| 635 | - $this->emit('output', [ $name, $message ]); |
|
| 635 | + $this->emit('output', [$name, $message]); |
|
| 636 | 636 | } |
| 637 | 637 | |
| 638 | 638 | return $status; |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | |
| 432 | 432 | if ($this->handleReceiveResponse($protocol) || $this->getInput()->handle($sender, $protocol)) |
| 433 | 433 | { |
| 434 | - $this->emit('input', [ $sender, $protocol ]); |
|
| 434 | + $this->emit('input', [$sender, $protocol]); |
|
| 435 | 435 | } |
| 436 | 436 | } |
| 437 | 437 | |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | */ |
| 442 | 442 | public function pull($sender, ProtocolInterface $protocol) |
| 443 | 443 | { |
| 444 | - $this->emit('input', [ $sender, $protocol ]); |
|
| 444 | + $this->emit('input', [$sender, $protocol]); |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | /** |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | if ($status) |
| 544 | 544 | { |
| 545 | 545 | $this->resolveOrRejectResponse($message->getPid(), $message->getException()); |
| 546 | - $this->emit('output', [ $name, $message ]); |
|
| 546 | + $this->emit('output', [$name, $message]); |
|
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | return $status; |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | $request = $this->createRequest($pid, $success, $failure, $cancel, $timeout); |
| 603 | 603 | $this->addRequest($pid, $request); |
| 604 | 604 | |
| 605 | - $this->emit('output', [ $name, $message ]); |
|
| 605 | + $this->emit('output', [$name, $message]); |
|
| 606 | 606 | |
| 607 | 607 | return $request; |
| 608 | 608 | } |
@@ -674,11 +674,11 @@ discard block |
||
| 674 | 674 | } |
| 675 | 675 | else if ($exception === TaskIncompleteException::class) |
| 676 | 676 | { |
| 677 | - $this->cancelRequest($pid, new ThrowableProxy([ $exception, $message ])); |
|
| 677 | + $this->cancelRequest($pid, new ThrowableProxy([$exception, $message])); |
|
| 678 | 678 | } |
| 679 | 679 | else |
| 680 | 680 | { |
| 681 | - $this->rejectRequest($pid, new ThrowableProxy([ $exception, $message ])); |
|
| 681 | + $this->rejectRequest($pid, new ThrowableProxy([$exception, $message])); |
|
| 682 | 682 | } |
| 683 | 683 | |
| 684 | 684 | return true; |
@@ -785,8 +785,8 @@ discard block |
||
| 785 | 785 | */ |
| 786 | 786 | private function registerEvents() |
| 787 | 787 | { |
| 788 | - $this->handlers = $this->model->copyEvents($this, [ 'start', 'stop', 'connect', 'disconnect' ]); |
|
| 789 | - $this->handlers[] = $this->model->on('recv', [ $this, 'handleReceive' ]); |
|
| 788 | + $this->handlers = $this->model->copyEvents($this, ['start', 'stop', 'connect', 'disconnect']); |
|
| 789 | + $this->handlers[] = $this->model->on('recv', [$this, 'handleReceive']); |
|
| 790 | 790 | } |
| 791 | 791 | |
| 792 | 792 | /** |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $this->pid = $pid; |
| 46 | 46 | $this->success = ($success !== null) ? $success : function() {}; |
| 47 | 47 | $this->failure = ($failure !== null) ? $failure : function() {}; |
| 48 | - $this->cancel = ($cancel !== null) ? $cancel : function() {}; |
|
| 48 | + $this->cancel = ($cancel !== null) ? $cancel : function() {}; |
|
| 49 | 49 | $this->timeout = $timeout; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | ->define(Channel::class, function($model, $config = []) use($factory, $modelFactory) { |
| 38 | 38 | return new Channel( |
| 39 | 39 | isset($config['name']) ? $config['name'] : $factory->getParam('name'), |
| 40 | - $modelFactory->create($model, [ $config ]), |
|
| 40 | + $modelFactory->create($model, [$config]), |
|
| 41 | 41 | $factory->getParam('router'), |
| 42 | 42 | $factory->getParam('encoder'), |
| 43 | 43 | isset($config['loop']) ? $config['loop'] : $factory->getParam('loop') |