@@ -26,7 +26,7 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function visitState(string $name, array $attributes): void |
| 28 | 28 | { |
| 29 | - if (! isset($this->structure[$name])) { |
|
| 29 | + if (!isset($this->structure[$name])) { |
|
| 30 | 30 | $this->structure[$name] = []; |
| 31 | 31 | } |
| 32 | 32 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $transition = new ReadOnlyTransition($this->transitions[$name]['to']); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if (! $transition) { |
|
| 50 | + if (!$transition) { |
|
| 51 | 51 | throw NotFoundException::transitionNotFound($name); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | private function addAttributes(string $state, array $attributes): void |
| 72 | 72 | { |
| 73 | 73 | \array_map( |
| 74 | - function ($attribute) use ($state) { |
|
| 74 | + function($attribute) use ($state) { |
|
| 75 | 75 | $this->addAttribute($state, $attribute); |
| 76 | 76 | }, |
| 77 | 77 | $attributes |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | public function hasAttribute(string $state, string $attribute): bool |
| 92 | 92 | { |
| 93 | - if (! $this->hasState($state)) { |
|
| 93 | + if (!$this->hasState($state)) { |
|
| 94 | 94 | return false; |
| 95 | 95 | } |
| 96 | 96 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function transit(string $transitionName, $context, TransitionCallback $callback = null): string |
| 54 | 54 | { |
| 55 | - if (! $callback) { |
|
| 55 | + if (!$callback) { |
|
| 56 | 56 | $callback = new AlwaysThrowExceptionOnFailure(); |
| 57 | 57 | } |
| 58 | 58 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | $newState = $transition->getDestinationState(); |
| 68 | 68 | $allowed = $this->states->transitionStartsFrom($transitionName, $this->currentState); |
| 69 | - if (! $allowed) { |
|
| 69 | + if (!$allowed) { |
|
| 70 | 70 | $exception = InvalidStateTransitionException::notAllowedTransition( |
| 71 | 71 | $transitionName, |
| 72 | 72 | $context, |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function isInState(string $stateName): bool |
| 102 | 102 | { |
| 103 | - if (! $this->states->hasState($stateName)) { |
|
| 103 | + if (!$this->states->hasState($stateName)) { |
|
| 104 | 104 | throw NotFoundException::stateNotFound($stateName); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | |
| 17 | 17 | public function __construct(EventDispatcherInterface $dispatcher = null) |
| 18 | 18 | { |
| 19 | - if (! $dispatcher) { |
|
| 19 | + if (!$dispatcher) { |
|
| 20 | 20 | $dispatcher = new EventDispatcher(); |
| 21 | 21 | } |
| 22 | 22 | $this->dispatcher = $dispatcher; |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | */ |
| 63 | 63 | public function onFailure(InvalidStateTransitionException $exception, $context, StateMachine $machine): string |
| 64 | 64 | { |
| 65 | - $closure = function (array $args) use ($context) { |
|
| 65 | + $closure = function(array $args) use ($context) { |
|
| 66 | 66 | $context->{$this->method}(...$args); |
| 67 | 67 | }; |
| 68 | 68 | $closure($this->args); |