@@ -18,7 +18,7 @@ |
||
| 18 | 18 | array $topics, |
| 19 | 19 | array $attributes = [], |
| 20 | 20 | ?ResponseInterface $response = null |
| 21 | - ) { |
|
| 21 | + ){ |
|
| 22 | 22 | $this->success = $success; |
| 23 | 23 | $this->topics = $topics; |
| 24 | 24 | $this->attributes = $attributes; |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | BroadcastInterface $broadcast, |
| 23 | 23 | ResponseFactoryInterface $responseFactory, |
| 24 | 24 | ?string $authorizationPath = null |
| 25 | - ) { |
|
| 25 | + ){ |
|
| 26 | 26 | $this->responseFactory = $responseFactory; |
| 27 | 27 | $this->broadcast = $broadcast; |
| 28 | 28 | $this->authorizationPath = $authorizationPath; |
@@ -32,18 +32,18 @@ discard block |
||
| 32 | 32 | ServerRequestInterface $request, |
| 33 | 33 | RequestHandlerInterface $handler |
| 34 | 34 | ): ResponseInterface { |
| 35 | - if ($request->getUri()->getPath() !== $this->authorizationPath) { |
|
| 35 | + if ($request->getUri()->getPath() !== $this->authorizationPath){ |
|
| 36 | 36 | return $handler->handle($request); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - if ($this->broadcast instanceof GuardInterface) { |
|
| 39 | + if ($this->broadcast instanceof GuardInterface){ |
|
| 40 | 40 | $status = $this->broadcast->authorize($request); |
| 41 | 41 | |
| 42 | - if ($status->hasResponse()) { |
|
| 42 | + if ($status->hasResponse()){ |
|
| 43 | 43 | return $status->getResponse(); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if (!$status->isSuccessful()) { |
|
| 46 | + if (!$status->isSuccessful()){ |
|
| 47 | 47 | return $this->responseFactory->createResponse(403); |
| 48 | 48 | } |
| 49 | 49 | } |
@@ -32,18 +32,22 @@ |
||
| 32 | 32 | ServerRequestInterface $request, |
| 33 | 33 | RequestHandlerInterface $handler |
| 34 | 34 | ): ResponseInterface { |
| 35 | - if ($request->getUri()->getPath() !== $this->authorizationPath) { |
|
| 35 | + if ($request->getUri()->getPath() !== $this->authorizationPath) |
|
| 36 | + { |
|
| 36 | 37 | return $handler->handle($request); |
| 37 | 38 | } |
| 38 | 39 | |
| 39 | - if ($this->broadcast instanceof GuardInterface) { |
|
| 40 | + if ($this->broadcast instanceof GuardInterface) |
|
| 41 | + { |
|
| 40 | 42 | $status = $this->broadcast->authorize($request); |
| 41 | 43 | |
| 42 | - if ($status->hasResponse()) { |
|
| 44 | + if ($status->hasResponse()) |
|
| 45 | + { |
|
| 43 | 46 | return $status->getResponse(); |
| 44 | 47 | } |
| 45 | 48 | |
| 46 | - if (!$status->isSuccessful()) { |
|
| 49 | + if (!$status->isSuccessful()) |
|
| 50 | + { |
|
| 47 | 51 | return $this->responseFactory->createResponse(403); |
| 48 | 52 | } |
| 49 | 53 | } |