@@ -12,16 +12,16 @@ |
||
12 | 12 | { |
13 | 13 | public function __construct( |
14 | 14 | private readonly InvokerInterface $invoker |
15 | - ) { |
|
15 | + ){ |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | public function handle(string $name, string $id, array $payload, array $headers = []): void |
19 | 19 | { |
20 | - if (!isset($payload['callback'])) { |
|
20 | + if (!isset($payload['callback'])){ |
|
21 | 21 | throw new InvalidArgumentException('Payload `callback` key is required.'); |
22 | 22 | } |
23 | 23 | |
24 | - if (!$payload['callback'] instanceof \Closure) { |
|
24 | + if (!$payload['callback'] instanceof \Closure){ |
|
25 | 25 | throw new InvalidArgumentException('Payload `callback` key value type should be a closure.'); |
26 | 26 | } |
27 | 27 |
@@ -17,11 +17,13 @@ |
||
17 | 17 | |
18 | 18 | public function handle(string $name, string $id, array $payload, array $headers = []): void |
19 | 19 | { |
20 | - if (!isset($payload['callback'])) { |
|
20 | + if (!isset($payload['callback'])) |
|
21 | + { |
|
21 | 22 | throw new InvalidArgumentException('Payload `callback` key is required.'); |
22 | 23 | } |
23 | 24 | |
24 | - if (!$payload['callback'] instanceof \Closure) { |
|
25 | + if (!$payload['callback'] instanceof \Closure) |
|
26 | + { |
|
25 | 27 | throw new InvalidArgumentException('Payload `callback` key value type should be a closure.'); |
26 | 28 | } |
27 | 29 |
@@ -12,16 +12,16 @@ |
||
12 | 12 | { |
13 | 13 | public function __construct( |
14 | 14 | private readonly InvokerInterface $invoker |
15 | - ) { |
|
15 | + ){ |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | public function handle(string $name, string $id, array $payload, array $headers = []): void |
19 | 19 | { |
20 | - if (!isset($payload['object'])) { |
|
20 | + if (!isset($payload['object'])){ |
|
21 | 21 | throw new InvalidArgumentException('Payload `object` key is required.'); |
22 | 22 | } |
23 | 23 | |
24 | - if (!\is_object($payload['object'])) { |
|
24 | + if (!\is_object($payload['object'])){ |
|
25 | 25 | throw new InvalidArgumentException('Payload `object` key value type should be an object.'); |
26 | 26 | } |
27 | 27 |
@@ -17,11 +17,13 @@ |
||
17 | 17 | |
18 | 18 | public function handle(string $name, string $id, array $payload, array $headers = []): void |
19 | 19 | { |
20 | - if (!isset($payload['object'])) { |
|
20 | + if (!isset($payload['object'])) |
|
21 | + { |
|
21 | 22 | throw new InvalidArgumentException('Payload `object` key is required.'); |
22 | 23 | } |
23 | 24 | |
24 | - if (!\is_object($payload['object'])) { |
|
25 | + if (!\is_object($payload['object'])) |
|
26 | + { |
|
25 | 27 | throw new InvalidArgumentException('Payload `object` key value type should be an object.'); |
26 | 28 | } |
27 | 29 |
@@ -64,7 +64,7 @@ |
||
64 | 64 | $config = new EventsConfig([ |
65 | 65 | 'interceptors' => [ |
66 | 66 | 'bar', |
67 | - new class implements CoreInterceptorInterface { |
|
67 | + new class implements CoreInterceptorInterface{ |
|
68 | 68 | public function process(string $controller, string $action, array $parameters, CoreInterface $core): mixed |
69 | 69 | { |
70 | 70 | } |
@@ -64,7 +64,8 @@ |
||
64 | 64 | $config = new EventsConfig([ |
65 | 65 | 'interceptors' => [ |
66 | 66 | 'bar', |
67 | - new class implements CoreInterceptorInterface { |
|
67 | + new class implements CoreInterceptorInterface |
|
68 | + { |
|
68 | 69 | public function process(string $controller, string $action, array $parameters, CoreInterface $core): mixed |
69 | 70 | { |
70 | 71 | } |
@@ -13,7 +13,9 @@ |
||
13 | 13 | { |
14 | 14 | public function testDispatch(): void |
15 | 15 | { |
16 | - $event = new class() {}; |
|
16 | + $event = new class() |
|
17 | + { |
|
18 | +}; |
|
17 | 19 | |
18 | 20 | $core = m::mock(CoreInterface::class); |
19 | 21 | $core |
@@ -13,7 +13,9 @@ |
||
13 | 13 | { |
14 | 14 | public function testCallAction(): void |
15 | 15 | { |
16 | - $event = new class() {}; |
|
16 | + $event = new class() |
|
17 | + { |
|
18 | +}; |
|
17 | 19 | |
18 | 20 | $dispatcher = m::mock(EventDispatcherInterface::class); |
19 | 21 | $dispatcher |
@@ -14,7 +14,7 @@ |
||
14 | 14 | { |
15 | 15 | public function __construct( |
16 | 16 | private readonly EventDispatcherInterface $dispatcher |
17 | - ) { |
|
17 | + ){ |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
@@ -13,7 +13,7 @@ |
||
13 | 13 | public function __construct( |
14 | 14 | \ReflectionFunctionAbstract $reflection, |
15 | 15 | private readonly string $parameter |
16 | - ) { |
|
16 | + ){ |
|
17 | 17 | $pattern = "Invalid argument value type for the `$parameter` parameter when validating arguments for `%s`."; |
18 | 18 | parent::__construct($this->renderFunctionAndParameter($reflection, $pattern)); |
19 | 19 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | public function __toString(): string |
20 | 20 | { |
21 | - return $this->traces === [] ? '' : "Container trace list:\n" . $this->renderTraceList($this->traces); |
|
21 | + return $this->traces === [] ? '' : "Container trace list:\n".$this->renderTraceList($this->traces); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -34,19 +34,19 @@ discard block |
||
34 | 34 | public function push(bool $nextLevel, mixed ...$details): void |
35 | 35 | { |
36 | 36 | $trace = $details === [] ? null : new Trace($details); |
37 | - if ($nextLevel || $this->traces === []) { |
|
37 | + if ($nextLevel || $this->traces === []){ |
|
38 | 38 | $this->traces[] = $trace === null ? [] : [$trace]; |
39 | - } elseif ($trace !== null) { |
|
39 | + } elseif ($trace !== null){ |
|
40 | 40 | $this->traces[\array_key_last($this->traces)][] = $trace; |
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
44 | 44 | public function pop(bool $previousLevel = false): void |
45 | 45 | { |
46 | - if ($this->traces === []) { |
|
46 | + if ($this->traces === []){ |
|
47 | 47 | return; |
48 | 48 | } |
49 | - if ($previousLevel) { |
|
49 | + if ($previousLevel){ |
|
50 | 50 | \array_pop($this->traces); |
51 | 51 | return; |
52 | 52 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | { |
68 | 68 | $result = []; |
69 | 69 | $i = 0; |
70 | - foreach ($blocks as $block) { |
|
70 | + foreach ($blocks as $block){ |
|
71 | 71 | \array_push($result, ...$this->blockToStringList($block, $i++)); |
72 | 72 | } |
73 | 73 | return \implode("\n", $result); |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | // Separator |
88 | 88 | $s = "\n"; |
89 | 89 | $nexPrefix = "$s$padding "; |
90 | - foreach ($items as $item) { |
|
91 | - $result[] = $firstPrefix . \str_replace($s, $nexPrefix, (string)$item); |
|
90 | + foreach ($items as $item){ |
|
91 | + $result[] = $firstPrefix.\str_replace($s, $nexPrefix, (string)$item); |
|
92 | 92 | } |
93 | 93 | return $result; |
94 | 94 | } |
@@ -34,19 +34,24 @@ discard block |
||
34 | 34 | public function push(bool $nextLevel, mixed ...$details): void |
35 | 35 | { |
36 | 36 | $trace = $details === [] ? null : new Trace($details); |
37 | - if ($nextLevel || $this->traces === []) { |
|
37 | + if ($nextLevel || $this->traces === []) |
|
38 | + { |
|
38 | 39 | $this->traces[] = $trace === null ? [] : [$trace]; |
39 | - } elseif ($trace !== null) { |
|
40 | + } |
|
41 | + elseif ($trace !== null) |
|
42 | + { |
|
40 | 43 | $this->traces[\array_key_last($this->traces)][] = $trace; |
41 | 44 | } |
42 | 45 | } |
43 | 46 | |
44 | 47 | public function pop(bool $previousLevel = false): void |
45 | 48 | { |
46 | - if ($this->traces === []) { |
|
49 | + if ($this->traces === []) |
|
50 | + { |
|
47 | 51 | return; |
48 | 52 | } |
49 | - if ($previousLevel) { |
|
53 | + if ($previousLevel) |
|
54 | + { |
|
50 | 55 | \array_pop($this->traces); |
51 | 56 | return; |
52 | 57 | } |
@@ -67,7 +72,8 @@ discard block |
||
67 | 72 | { |
68 | 73 | $result = []; |
69 | 74 | $i = 0; |
70 | - foreach ($blocks as $block) { |
|
75 | + foreach ($blocks as $block) |
|
76 | + { |
|
71 | 77 | \array_push($result, ...$this->blockToStringList($block, $i++)); |
72 | 78 | } |
73 | 79 | return \implode("\n", $result); |
@@ -87,7 +93,8 @@ discard block |
||
87 | 93 | // Separator |
88 | 94 | $s = "\n"; |
89 | 95 | $nexPrefix = "$s$padding "; |
90 | - foreach ($items as $item) { |
|
96 | + foreach ($items as $item) |
|
97 | + { |
|
91 | 98 | $result[] = $firstPrefix . \str_replace($s, $nexPrefix, (string)$item); |
92 | 99 | } |
93 | 100 | return $result; |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | public function __construct( |
14 | 14 | private string $name, |
15 | 15 | private array $attributes = [] |
16 | - ) { |
|
16 | + ){ |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | public function getName(): string |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | return $this->attributes[$name] ?? null; |
58 | 58 | } |
59 | 59 | |
60 | - public function setStatus(string|int $code, string $description = null): self |
|
60 | + public function setStatus(string | int $code, string $description = null): self |
|
61 | 61 | { |
62 | 62 | $this->status = new Status($code, $description); |
63 | 63 |