@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $isOptional = $configuration->isOptional(); |
| 75 | 75 | $isJsonApi = $request->headers->contains('Content-Type', 'application/vnd.api+json'); |
| 76 | 76 | |
| 77 | - if (! $isOptional && ! $isJsonApi) { |
|
| 77 | + if (!$isOptional && !$isJsonApi) { |
|
| 78 | 78 | throw new BadRequestHttpException(sprintf( |
| 79 | 79 | 'Invalid media-type of request, "application/vnd.api+json" expected, "%s" given.', |
| 80 | 80 | implode(', ', (array) $request->headers->get('Content-Type')) |
@@ -83,11 +83,11 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | $content = $request->getContent(); |
| 85 | 85 | |
| 86 | - if (! empty($content)) { |
|
| 86 | + if (!empty($content)) { |
|
| 87 | 87 | return $content; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - if (! $isOptional) { |
|
| 90 | + if (!$isOptional) { |
|
| 91 | 91 | throw new BadRequestHttpException('Request body is empty'); |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | * Decode JSON |
| 98 | 98 | * |
| 99 | 99 | * @param string $content |
| 100 | - * @return mixed |
|
| 100 | + * @return \stdClass |
|
| 101 | 101 | * @throws BadRequestHttpException |
| 102 | 102 | */ |
| 103 | 103 | protected function decodeContent(string $content): \stdClass |
@@ -34,14 +34,14 @@ discard block |
||
| 34 | 34 | * |
| 35 | 35 | * @var ObjectHandlerInterface[] |
| 36 | 36 | */ |
| 37 | - protected $objectHandlers = []; |
|
| 37 | + protected $objectHandlers = [ ]; |
|
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * Object-handlers resolved by supported class |
| 41 | 41 | * |
| 42 | 42 | * @var ObjectHandlerInterface[] |
| 43 | 43 | */ |
| 44 | - protected $resolvedObjectHandlers = []; |
|
| 44 | + protected $resolvedObjectHandlers = [ ]; |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * Add object-handler |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function addObjectHandler(ObjectHandlerInterface $handler) |
| 52 | 52 | { |
| 53 | - $this->objectHandlers[] = $handler; |
|
| 53 | + $this->objectHandlers[ ] = $handler; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | { |
| 63 | 63 | $result = $event->getControllerResult(); |
| 64 | 64 | |
| 65 | - if (! is_object($result)) { |
|
| 65 | + if (!is_object($result)) { |
|
| 66 | 66 | return; |
| 67 | 67 | } |
| 68 | 68 | |
@@ -223,13 +223,13 @@ discard block |
||
| 223 | 223 | */ |
| 224 | 224 | protected function getHandler(string $class): ObjectHandlerInterface |
| 225 | 225 | { |
| 226 | - if (isset($this->resolvedObjectHandlers[$class])) { |
|
| 227 | - return $this->resolvedObjectHandlers[$class]; |
|
| 226 | + if (isset($this->resolvedObjectHandlers[ $class ])) { |
|
| 227 | + return $this->resolvedObjectHandlers[ $class ]; |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | foreach ($this->objectHandlers as $handler) { |
| 231 | 231 | if ($handler->supports($class)) { |
| 232 | - $this->resolvedObjectHandlers[$class] = $handler; |
|
| 232 | + $this->resolvedObjectHandlers[ $class ] = $handler; |
|
| 233 | 233 | return $handler; |
| 234 | 234 | } |
| 235 | 235 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function addIncludedObject($object) |
| 26 | 26 | { |
| 27 | - $this->includedObjects[] = $object; |
|
| 27 | + $this->includedObjects[ ] = $object; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | * |
| 18 | 18 | * @var array |
| 19 | 19 | */ |
| 20 | - protected $headers = []; |
|
| 20 | + protected $headers = [ ]; |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Set status code |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function setHeader(string $name, string $value) |
| 51 | 51 | { |
| 52 | - $this->headers[$name] = $value; |
|
| 52 | + $this->headers[ $name ] = $value; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | * @param int $status |
| 26 | 26 | * @param array $headers |
| 27 | 27 | */ |
| 28 | - public function __construct($object, int $status = 200, array $headers = []) |
|
| 28 | + public function __construct($object, int $status = 200, array $headers = [ ]) |
|
| 29 | 29 | { |
| 30 | 30 | $this->object = $object; |
| 31 | 31 | $this->statusCode = $status; |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | * @param int $status |
| 26 | 26 | * @param array $headers |
| 27 | 27 | */ |
| 28 | - public function __construct(\Traversable $iterator, int $status = 200, array $headers = []) |
|
| 28 | + public function __construct(\Traversable $iterator, int $status = 200, array $headers = [ ]) |
|
| 29 | 29 | { |
| 30 | 30 | $this->iterator = $iterator; |
| 31 | 31 | $this->statusCode = $status; |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | * @param int $status |
| 32 | 32 | * @param array $headers |
| 33 | 33 | */ |
| 34 | - public function __construct(AbstractDocument $document, int $status = 200, array $headers = []) |
|
| 34 | + public function __construct(AbstractDocument $document, int $status = 200, array $headers = [ ]) |
|
| 35 | 35 | { |
| 36 | 36 | $this->document = $document; |
| 37 | 37 | $this->statusCode = $status; |