@@ -58,7 +58,7 @@ |
||
58 | 58 | { |
59 | 59 | $type = $this->element->getType(); |
60 | 60 | |
61 | - return $type === null ? null : (string) $type; |
|
61 | + return $type === null ? null : (string)$type; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | public function setNullable(bool $state = true): self |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $this->element = new TraitType($name); |
24 | 24 | } |
25 | 25 | |
26 | - public function addMember(Method|Property|Constant|TraitUse $member): static |
|
26 | + public function addMember(Method | Property | Constant | TraitUse $member): static |
|
27 | 27 | { |
28 | 28 | $this->element->addMember($member->getElement()); |
29 | 29 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | { |
11 | 11 | public function __construct( |
12 | 12 | protected FilesInterface $files |
13 | - ) { |
|
13 | + ){ |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | public function write(string $filename, FileDeclaration $file): bool |
@@ -63,7 +63,8 @@ |
||
63 | 63 | |
64 | 64 | public function addNamespace(string|PhpNamespace $namespace): PhpNamespace |
65 | 65 | { |
66 | - if ($namespace instanceof PhpNamespace) { |
|
66 | + if ($namespace instanceof PhpNamespace) |
|
67 | + { |
|
67 | 68 | $this->element->addNamespace($namespace->getElement()); |
68 | 69 | |
69 | 70 | return $namespace; |
@@ -53,9 +53,9 @@ |
||
53 | 53 | return self::fromElement((new Factory())->fromCode(\file_get_contents($reflection->getFileName()))); |
54 | 54 | } |
55 | 55 | |
56 | - public function addNamespace(string|PhpNamespace $namespace): PhpNamespace |
|
56 | + public function addNamespace(string | PhpNamespace $namespace): PhpNamespace |
|
57 | 57 | { |
58 | - if ($namespace instanceof PhpNamespace) { |
|
58 | + if ($namespace instanceof PhpNamespace){ |
|
59 | 59 | $this->element->addNamespace($namespace->getElement()); |
60 | 60 | |
61 | 61 | return $namespace; |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | final class ValidationProviderTest extends TestCase |
13 | 13 | { |
14 | - private m\MockInterface|InvokerInterface $invoker; |
|
14 | + private m\MockInterface | InvokerInterface $invoker; |
|
15 | 15 | private ValidationProvider $provider; |
16 | 16 | |
17 | 17 | protected function setUp(): void |
@@ -14,7 +14,7 @@ |
||
14 | 14 | /** |
15 | 15 | * Create validator copy with new data set. |
16 | 16 | */ |
17 | - public function withData(array|object $data): ValidatorInterface; |
|
17 | + public function withData(array | object $data): ValidatorInterface; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * Receive field from context data or return default value. |
@@ -17,5 +17,5 @@ |
||
17 | 17 | * @param mixed $context Validation context (available for checkers and validation |
18 | 18 | * methods but is not validated). |
19 | 19 | */ |
20 | - public function validate(array|object $data, array $rules, mixed $context = null): ValidatorInterface; |
|
20 | + public function validate(array | object $data, array $rules, mixed $context = null): ValidatorInterface; |
|
21 | 21 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | public function __construct( |
10 | 10 | private readonly SessionScope $session, |
11 | 11 | private readonly string $name |
12 | - ) { |
|
12 | + ){ |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | /** |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | private readonly CookiesConfig $cookiesConfig, |
32 | 32 | private readonly SessionFactoryInterface $factory, |
33 | 33 | private readonly ScopeInterface $scope |
34 | - ) { |
|
34 | + ){ |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
@@ -45,12 +45,12 @@ discard block |
||
45 | 45 | $this->fetchID($request) |
46 | 46 | ); |
47 | 47 | |
48 | - try { |
|
48 | + try{ |
|
49 | 49 | $response = $this->scope->runScope( |
50 | 50 | [SessionInterface::class => $session], |
51 | 51 | static fn () => $handler->handle($request->withAttribute(self::ATTRIBUTE, $session)) |
52 | 52 | ); |
53 | - } catch (\Throwable $e) { |
|
53 | + }catch (\Throwable $e){ |
|
54 | 54 | $session->abort(); |
55 | 55 | throw $e; |
56 | 56 | } |
@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | Request $request, |
64 | 64 | Response $response |
65 | 65 | ): Response { |
66 | - if (!$session->isStarted()) { |
|
66 | + if (!$session->isStarted()){ |
|
67 | 67 | return $response; |
68 | 68 | } |
69 | 69 | |
70 | 70 | $session->commit(); |
71 | 71 | |
72 | 72 | //SID changed |
73 | - if ($this->fetchID($request) !== $session->getID()) { |
|
73 | + if ($this->fetchID($request) !== $session->getID()){ |
|
74 | 74 | return $this->withCookie($request, $response, $session->getID()); |
75 | 75 | } |
76 | 76 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | protected function fetchID(Request $request): ?string |
85 | 85 | { |
86 | 86 | $cookies = $request->getCookieParams(); |
87 | - if (empty($cookies[$this->config->getCookie()])) { |
|
87 | + if (empty($cookies[$this->config->getCookie()])){ |
|
88 | 88 | return null; |
89 | 89 | } |
90 | 90 | |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | protected function clientSignature(Request $request): string |
107 | 107 | { |
108 | 108 | $signature = ''; |
109 | - foreach (self::SIGNATURE_HEADERS as $header) { |
|
110 | - $signature .= $request->getHeaderLine($header) . ';'; |
|
109 | + foreach (self::SIGNATURE_HEADERS as $header){ |
|
110 | + $signature .= $request->getHeaderLine($header).';'; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | return \hash('sha256', $signature); |
@@ -45,12 +45,15 @@ discard block |
||
45 | 45 | $this->fetchID($request) |
46 | 46 | ); |
47 | 47 | |
48 | - try { |
|
48 | + try |
|
49 | + { |
|
49 | 50 | $response = $this->scope->runScope( |
50 | 51 | [SessionInterface::class => $session], |
51 | 52 | static fn () => $handler->handle($request->withAttribute(self::ATTRIBUTE, $session)) |
52 | 53 | ); |
53 | - } catch (\Throwable $e) { |
|
54 | + } |
|
55 | + catch (\Throwable $e) |
|
56 | + { |
|
54 | 57 | $session->abort(); |
55 | 58 | throw $e; |
56 | 59 | } |
@@ -63,14 +66,16 @@ discard block |
||
63 | 66 | Request $request, |
64 | 67 | Response $response |
65 | 68 | ): Response { |
66 | - if (!$session->isStarted()) { |
|
69 | + if (!$session->isStarted()) |
|
70 | + { |
|
67 | 71 | return $response; |
68 | 72 | } |
69 | 73 | |
70 | 74 | $session->commit(); |
71 | 75 | |
72 | 76 | //SID changed |
73 | - if ($this->fetchID($request) !== $session->getID()) { |
|
77 | + if ($this->fetchID($request) !== $session->getID()) |
|
78 | + { |
|
74 | 79 | return $this->withCookie($request, $response, $session->getID()); |
75 | 80 | } |
76 | 81 | |
@@ -84,7 +89,8 @@ discard block |
||
84 | 89 | protected function fetchID(Request $request): ?string |
85 | 90 | { |
86 | 91 | $cookies = $request->getCookieParams(); |
87 | - if (empty($cookies[$this->config->getCookie()])) { |
|
92 | + if (empty($cookies[$this->config->getCookie()])) |
|
93 | + { |
|
88 | 94 | return null; |
89 | 95 | } |
90 | 96 | |
@@ -106,7 +112,8 @@ discard block |
||
106 | 112 | protected function clientSignature(Request $request): string |
107 | 113 | { |
108 | 114 | $signature = ''; |
109 | - foreach (self::SIGNATURE_HEADERS as $header) { |
|
115 | + foreach (self::SIGNATURE_HEADERS as $header) |
|
116 | + { |
|
110 | 117 | $signature .= $request->getHeaderLine($header) . ';'; |
111 | 118 | } |
112 | 119 |