@@ -14,7 +14,7 @@ |
||
14 | 14 | { |
15 | 15 | public function __construct( |
16 | 16 | private readonly LoggerInterface $logger |
17 | - ) { |
|
17 | + ){ |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | public function onMessageSent(MessageSent $event): void |
@@ -16,12 +16,12 @@ discard block |
||
16 | 16 | public function __construct( |
17 | 17 | private readonly string $header = 'X-Auth-Token', |
18 | 18 | private readonly string $valueFormat = '%s' |
19 | - ) { |
|
19 | + ){ |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | public function fetchToken(Request $request): ?string |
23 | 23 | { |
24 | - if ($request->hasHeader($this->header)) { |
|
24 | + if ($request->hasHeader($this->header)){ |
|
25 | 25 | return $this->extractToken($request); |
26 | 26 | } |
27 | 27 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | string $tokenID, |
35 | 35 | \DateTimeInterface $expiresAt = null |
36 | 36 | ): Response { |
37 | - if ($request->hasHeader($this->header) && $this->extractToken($request) === $tokenID) { |
|
37 | + if ($request->hasHeader($this->header) && $this->extractToken($request) === $tokenID){ |
|
38 | 38 | return $response; |
39 | 39 | } |
40 | 40 | |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | { |
51 | 51 | $headerLine = $request->getHeaderLine($this->header); |
52 | 52 | |
53 | - if ($this->valueFormat !== '%s') { |
|
53 | + if ($this->valueFormat !== '%s'){ |
|
54 | 54 | [$token] = sscanf($headerLine, $this->valueFormat); |
55 | 55 | |
56 | - return $token !== null ? (string) $token : null; |
|
56 | + return $token !== null ? (string)$token : null; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | return $headerLine; |
@@ -21,7 +21,8 @@ discard block |
||
21 | 21 | |
22 | 22 | public function fetchToken(Request $request): ?string |
23 | 23 | { |
24 | - if ($request->hasHeader($this->header)) { |
|
24 | + if ($request->hasHeader($this->header)) |
|
25 | + { |
|
25 | 26 | return $this->extractToken($request); |
26 | 27 | } |
27 | 28 | |
@@ -34,7 +35,8 @@ discard block |
||
34 | 35 | string $tokenID, |
35 | 36 | \DateTimeInterface $expiresAt = null |
36 | 37 | ): Response { |
37 | - if ($request->hasHeader($this->header) && $this->extractToken($request) === $tokenID) { |
|
38 | + if ($request->hasHeader($this->header) && $this->extractToken($request) === $tokenID) |
|
39 | + { |
|
38 | 40 | return $response; |
39 | 41 | } |
40 | 42 | |
@@ -50,7 +52,8 @@ discard block |
||
50 | 52 | { |
51 | 53 | $headerLine = $request->getHeaderLine($this->header); |
52 | 54 | |
53 | - if ($this->valueFormat !== '%s') { |
|
55 | + if ($this->valueFormat !== '%s') |
|
56 | + { |
|
54 | 57 | [$token] = sscanf($headerLine, $this->valueFormat); |
55 | 58 | |
56 | 59 | return $token !== null ? (string) $token : null; |
@@ -15,7 +15,7 @@ |
||
15 | 15 | { |
16 | 16 | public function __construct( |
17 | 17 | private readonly \Throwable $e |
18 | - ) { |
|
18 | + ){ |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | /** |
@@ -17,7 +17,7 @@ |
||
17 | 17 | public function __construct( |
18 | 18 | private readonly UriInterface $uri, |
19 | 19 | private readonly int $status = 401 |
20 | - ) { |
|
20 | + ){ |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | protected function denyAccess(Request $request, RequestHandlerInterface $handler): Response |
@@ -28,7 +28,7 @@ |
||
28 | 28 | TokenStorageInterface $tokenStorage, |
29 | 29 | TransportRegistry $transportRegistry, |
30 | 30 | ?EventDispatcherInterface $eventDispatcher = null |
31 | - ) { |
|
31 | + ){ |
|
32 | 32 | $this->authMiddleware = new AuthMiddleware( |
33 | 33 | $scope, |
34 | 34 | $actorProvider, |
@@ -29,7 +29,7 @@ |
||
29 | 29 | { |
30 | 30 | $name ??= $this->default; |
31 | 31 | |
32 | - if (!isset($this->transports[$name])) { |
|
32 | + if (!isset($this->transports[$name])){ |
|
33 | 33 | throw new TransportException(\sprintf('Undefined auth transport %s', $name)); |
34 | 34 | } |
35 | 35 |
@@ -29,7 +29,8 @@ |
||
29 | 29 | { |
30 | 30 | $name ??= $this->default; |
31 | 31 | |
32 | - if (!isset($this->transports[$name])) { |
|
32 | + if (!isset($this->transports[$name])) |
|
33 | + { |
|
33 | 34 | throw new TransportException(\sprintf('Undefined auth transport %s', $name)); |
34 | 35 | } |
35 | 36 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | $bag = new FilterBag( |
18 | 18 | $filter = m::mock(FilterInterface::class), |
19 | 19 | $entity = m::mock(AbstractEntity::class), |
20 | - $schema = ['foo' => 'bar',] |
|
20 | + $schema = ['foo' => 'bar', ] |
|
21 | 21 | ); |
22 | 22 | |
23 | 23 | $this->assertSame($filter, $bag->filter); |
@@ -69,7 +69,8 @@ discard block |
||
69 | 69 | ->andReturn(['first' => ['foo' => 'bar'], 'second' => ['foo' => 'baz']]); |
70 | 70 | |
71 | 71 | [$schema, $errors] = $this->mapper->map( |
72 | - $filter = new class implements FilterInterface { |
|
72 | + $filter = new class implements FilterInterface |
|
73 | + { |
|
73 | 74 | #[Post] |
74 | 75 | public string $username; |
75 | 76 | |
@@ -165,7 +166,8 @@ discard block |
||
165 | 166 | ->andReturn(['first' => ['foo' => 'bar'], 'second' => ['foo' => 'baz']]); |
166 | 167 | |
167 | 168 | [$schema, $errors] = $this->mapper->map( |
168 | - $filter = new class implements FilterInterface { |
|
169 | + $filter = new class implements FilterInterface |
|
170 | + { |
|
169 | 171 | #[Post] |
170 | 172 | public string $username; |
171 | 173 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | final class AttributeMapperTest extends BaseTestCase |
24 | 24 | { |
25 | - private m\LegacyMockInterface|m\MockInterface|FilterProviderInterface $provider; |
|
25 | + private m\LegacyMockInterface | m\MockInterface | FilterProviderInterface $provider; |
|
26 | 26 | private AttributeMapper $mapper; |
27 | 27 | |
28 | 28 | public function setUp(): void |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | ->andReturn(['first' => ['foo' => 'bar'], 'second' => ['foo' => 'baz']]); |
70 | 70 | |
71 | 71 | [$schema, $errors] = $this->mapper->map( |
72 | - $filter = new class implements FilterInterface { |
|
72 | + $filter = new class implements FilterInterface{ |
|
73 | 73 | #[Post] |
74 | 74 | public string $username; |
75 | 75 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | ->andReturn(['first' => ['foo' => 'bar'], 'second' => ['foo' => 'baz']]); |
166 | 166 | |
167 | 167 | [$schema, $errors] = $this->mapper->map( |
168 | - $filter = new class implements FilterInterface { |
|
168 | + $filter = new class implements FilterInterface{ |
|
169 | 169 | #[Post] |
170 | 170 | public string $username; |
171 | 171 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | public readonly string $class, |
37 | 37 | public readonly AbstractInput $input, |
38 | 38 | public readonly ?string $prefix = null |
39 | - ) { |
|
39 | + ){ |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | public function getValue(InputInterface $input, \ReflectionProperty $property): mixed |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | public function getSchema(\ReflectionProperty $property): array |
48 | 48 | { |
49 | - if ($this->prefix) { |
|
49 | + if ($this->prefix){ |
|
50 | 50 | return [$this->class, $this->prefix]; |
51 | 51 | } |
52 | 52 |
@@ -46,7 +46,8 @@ |
||
46 | 46 | |
47 | 47 | public function getSchema(\ReflectionProperty $property): array |
48 | 48 | { |
49 | - if ($this->prefix) { |
|
49 | + if ($this->prefix) |
|
50 | + { |
|
50 | 51 | return [$this->class, $this->prefix]; |
51 | 52 | } |
52 | 53 |