@@ -13,11 +13,11 @@ |
||
13 | 13 | |
14 | 14 | class UnionTypes |
15 | 15 | { |
16 | - public static function example(SampleClass|TypedClass $example) |
|
16 | + public static function example(SampleClass | TypedClass $example) |
|
17 | 17 | { |
18 | 18 | } |
19 | 19 | |
20 | - public static function unionNull(null|string $nullable): null|string |
|
20 | + public static function unionNull(null | string $nullable): null | string |
|
21 | 21 | { |
22 | 22 | return $nullable; |
23 | 23 | } |
@@ -91,11 +91,13 @@ discard block |
||
91 | 91 | |
92 | 92 | protected function coreHandler(ContainerInterface $container): CoreHandler |
93 | 93 | { |
94 | - if ($this->handler !== null) { |
|
94 | + if ($this->handler !== null) |
|
95 | + { |
|
95 | 96 | return $this->handler; |
96 | 97 | } |
97 | 98 | |
98 | - try { |
|
99 | + try |
|
100 | + { |
|
99 | 101 | // construct on demand |
100 | 102 | $this->handler = new CoreHandler( |
101 | 103 | $this->core ?? $container->get(CoreInterface::class), |
@@ -104,7 +106,9 @@ discard block |
||
104 | 106 | ); |
105 | 107 | |
106 | 108 | return $this->handler; |
107 | - } catch (ContainerExceptionInterface $e) { |
|
109 | + } |
|
110 | + catch (ContainerExceptionInterface $e) |
|
111 | + { |
|
108 | 112 | throw new TargetException($e->getMessage(), $e->getCode(), $e); |
109 | 113 | } |
110 | 114 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | private array $constrains, |
29 | 29 | int $options = 0, |
30 | 30 | private string $defaultAction = 'index' |
31 | - ) { |
|
31 | + ){ |
|
32 | 32 | $this->verbActions = ($options & self::RESTFUL) === self::RESTFUL; |
33 | 33 | } |
34 | 34 | |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | |
63 | 63 | protected function coreHandler(ContainerInterface $container): CoreHandler |
64 | 64 | { |
65 | - if ($this->handler !== null) { |
|
65 | + if ($this->handler !== null){ |
|
66 | 66 | return $this->handler; |
67 | 67 | } |
68 | 68 | |
69 | - try { |
|
69 | + try{ |
|
70 | 70 | // construct on demand |
71 | 71 | $this->handler = new CoreHandler( |
72 | 72 | $this->core ?? $container->get(CoreInterface::class), |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | ); |
76 | 76 | |
77 | 77 | return $this->handler; |
78 | - } catch (ContainerExceptionInterface $e) { |
|
78 | + }catch (ContainerExceptionInterface $e){ |
|
79 | 79 | throw new TargetException($e->getMessage(), $e->getCode(), $e); |
80 | 80 | } |
81 | 81 | } |
@@ -33,7 +33,8 @@ |
||
33 | 33 | |
34 | 34 | public function is(array $type): bool |
35 | 35 | { |
36 | - if ($this->type === null) { |
|
36 | + if ($this->type === null) |
|
37 | + { |
|
37 | 38 | return false; |
38 | 39 | } |
39 | 40 |
@@ -12,12 +12,12 @@ |
||
12 | 12 | public function __construct( |
13 | 13 | public string $value, |
14 | 14 | public ?string $type = null |
15 | - ) { |
|
15 | + ){ |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | public function is(array $type): bool |
19 | 19 | { |
20 | - if ($this->type === null) { |
|
20 | + if ($this->type === null){ |
|
21 | 21 | return false; |
22 | 22 | } |
23 | 23 |
@@ -50,22 +50,26 @@ |
||
50 | 50 | */ |
51 | 51 | private function rotate(ContextInterface $context, array $dependencies): array |
52 | 52 | { |
53 | - if (empty($dependencies)) { |
|
53 | + if (empty($dependencies)) |
|
54 | + { |
|
54 | 55 | return []; |
55 | 56 | } |
56 | 57 | |
57 | 58 | $top = \array_shift($dependencies); |
58 | 59 | |
59 | 60 | $variants = []; |
60 | - foreach ($top->getVariants() as $value) { |
|
61 | + foreach ($top->getVariants() as $value) |
|
62 | + { |
|
61 | 63 | $variant = $context->withDependency(new ValueDependency($top->getName(), $value)); |
62 | 64 | |
63 | - if (empty($dependencies)) { |
|
65 | + if (empty($dependencies)) |
|
66 | + { |
|
64 | 67 | $variants[] = $variant; |
65 | 68 | continue; |
66 | 69 | } |
67 | 70 | |
68 | - foreach ($this->rotate($variant, $dependencies) as $inner) { |
|
71 | + foreach ($this->rotate($variant, $dependencies) as $inner) |
|
72 | + { |
|
69 | 73 | $variants[] = $inner; |
70 | 74 | } |
71 | 75 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | { |
15 | 15 | public function __construct( |
16 | 16 | private readonly ContextInterface $context |
17 | - ) { |
|
17 | + ){ |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
@@ -40,22 +40,22 @@ discard block |
||
40 | 40 | */ |
41 | 41 | private function rotate(ContextInterface $context, array $dependencies): array |
42 | 42 | { |
43 | - if (empty($dependencies)) { |
|
43 | + if (empty($dependencies)){ |
|
44 | 44 | return []; |
45 | 45 | } |
46 | 46 | |
47 | 47 | $top = \array_shift($dependencies); |
48 | 48 | |
49 | 49 | $variants = []; |
50 | - foreach ($top->getVariants() as $value) { |
|
50 | + foreach ($top->getVariants() as $value){ |
|
51 | 51 | $variant = $context->withDependency(new ValueDependency($top->getName(), $value)); |
52 | 52 | |
53 | - if (empty($dependencies)) { |
|
53 | + if (empty($dependencies)){ |
|
54 | 54 | $variants[] = $variant; |
55 | 55 | continue; |
56 | 56 | } |
57 | 57 | |
58 | - foreach ($this->rotate($variant, $dependencies) as $inner) { |
|
58 | + foreach ($this->rotate($variant, $dependencies) as $inner){ |
|
59 | 59 | $variants[] = $inner; |
60 | 60 | } |
61 | 61 | } |
@@ -17,10 +17,10 @@ |
||
17 | 17 | { |
18 | 18 | protected function concat(string $file, ?string $prefix): string |
19 | 19 | { |
20 | - if ($prefix === null) { |
|
20 | + if ($prefix === null){ |
|
21 | 21 | return $file; |
22 | 22 | } |
23 | 23 | |
24 | - return \trim($prefix, '/') . '/' . \trim($file, '/'); |
|
24 | + return \trim($prefix, '/').'/'.\trim($file, '/'); |
|
25 | 25 | } |
26 | 26 | } |
@@ -17,7 +17,8 @@ |
||
17 | 17 | { |
18 | 18 | protected function concat(string $file, ?string $prefix): string |
19 | 19 | { |
20 | - if ($prefix === null) { |
|
20 | + if ($prefix === null) |
|
21 | + { |
|
21 | 22 | return $file; |
22 | 23 | } |
23 | 24 |
@@ -73,7 +73,8 @@ |
||
73 | 73 | |
74 | 74 | protected function assertCloudFrontAvailable(): void |
75 | 75 | { |
76 | - if (\class_exists(UrlSigner::class)) { |
|
76 | + if (\class_exists(UrlSigner::class)) |
|
77 | + { |
|
77 | 78 | return; |
78 | 79 | } |
79 | 80 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | string $privateKey, |
26 | 26 | private string $domain, |
27 | 27 | private ?string $prefix = null |
28 | - ) { |
|
28 | + ){ |
|
29 | 29 | $this->assertCloudFrontAvailable(); |
30 | 30 | $this->factory = new AmazonUriFactory(); |
31 | 31 | $this->signer = new UrlSigner($keyPairId, $privateKey); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | protected function assertCloudFrontAvailable(): void |
48 | 48 | { |
49 | - if (\class_exists(UrlSigner::class)) { |
|
49 | + if (\class_exists(UrlSigner::class)){ |
|
50 | 50 | return; |
51 | 51 | } |
52 | 52 |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | * @var string |
22 | 22 | */ |
23 | 23 | private const ERROR_NOT_AVAILABLE = |
24 | - 'The "aws/aws-sdk-php" package is supplied with the Guzzle PSR-7 ' . |
|
25 | - 'implementation, but it is not available. Please install the ' . |
|
24 | + 'The "aws/aws-sdk-php" package is supplied with the Guzzle PSR-7 '. |
|
25 | + 'implementation, but it is not available. Please install the '. |
|
26 | 26 | '"aws/aws-sdk-php" package or use any other implementation of PSR-17 factories.' |
27 | 27 | ; |
28 | 28 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | private function assertAvailable(): void |
43 | 43 | { |
44 | - if (\class_exists(Uri::class)) { |
|
44 | + if (\class_exists(Uri::class)){ |
|
45 | 45 | return; |
46 | 46 | } |
47 | 47 |
@@ -41,7 +41,8 @@ |
||
41 | 41 | |
42 | 42 | private function assertAvailable(): void |
43 | 43 | { |
44 | - if (\class_exists(Uri::class)) { |
|
44 | + if (\class_exists(Uri::class)) |
|
45 | + { |
|
45 | 46 | return; |
46 | 47 | } |
47 | 48 |
@@ -68,21 +68,21 @@ |
||
68 | 68 | $mail3->setDelay(200); |
69 | 69 | |
70 | 70 | $this->queue->expects('push')->once()->withArgs( |
71 | - function ($job, $data, Options $options) { |
|
71 | + function ($job, $data, Options $options){ |
|
72 | 72 | $this->assertSame(30, $options->getDelay()); |
73 | 73 | return true; |
74 | 74 | } |
75 | 75 | ); |
76 | 76 | |
77 | 77 | $this->queue->expects('push')->once()->withArgs( |
78 | - function ($job, $data, Options $options) { |
|
78 | + function ($job, $data, Options $options){ |
|
79 | 79 | $this->assertSame(100, $options->getDelay()); |
80 | 80 | return true; |
81 | 81 | } |
82 | 82 | ); |
83 | 83 | |
84 | 84 | $this->queue->expects('push')->once()->withArgs( |
85 | - function ($job, $data, Options $options) { |
|
85 | + function ($job, $data, Options $options){ |
|
86 | 86 | $this->assertSame(200, $options->getDelay()); |
87 | 87 | return true; |
88 | 88 | } |
@@ -43,7 +43,8 @@ discard block |
||
43 | 43 | $mail->setBCC('[email protected]'); |
44 | 44 | |
45 | 45 | $this->queue->expects('push')->withArgs( |
46 | - function ($job, $data, Options $options) use ($mail) { |
|
46 | + function ($job, $data, Options $options) use ($mail) |
|
47 | + { |
|
47 | 48 | $this->assertSame(MailQueue::JOB_NAME, $job); |
48 | 49 | $this->assertSame($data, MessageSerializer::pack($mail)); |
49 | 50 | $this->assertSame('mailer', $options->getQueue()); |
@@ -68,21 +69,24 @@ discard block |
||
68 | 69 | $mail3->setDelay(200); |
69 | 70 | |
70 | 71 | $this->queue->expects('push')->once()->withArgs( |
71 | - function ($job, $data, Options $options) { |
|
72 | + function ($job, $data, Options $options) |
|
73 | + { |
|
72 | 74 | $this->assertSame(30, $options->getDelay()); |
73 | 75 | return true; |
74 | 76 | } |
75 | 77 | ); |
76 | 78 | |
77 | 79 | $this->queue->expects('push')->once()->withArgs( |
78 | - function ($job, $data, Options $options) { |
|
80 | + function ($job, $data, Options $options) |
|
81 | + { |
|
79 | 82 | $this->assertSame(100, $options->getDelay()); |
80 | 83 | return true; |
81 | 84 | } |
82 | 85 | ); |
83 | 86 | |
84 | 87 | $this->queue->expects('push')->once()->withArgs( |
85 | - function ($job, $data, Options $options) { |
|
88 | + function ($job, $data, Options $options) |
|
89 | + { |
|
86 | 90 | $this->assertSame(200, $options->getDelay()); |
87 | 91 | return true; |
88 | 92 | } |
@@ -17,6 +17,6 @@ |
||
17 | 17 | { |
18 | 18 | // Do nothing |
19 | 19 | |
20 | - return (string) Uuid::uuid4(); |
|
20 | + return (string)Uuid::uuid4(); |
|
21 | 21 | } |
22 | 22 | } |