@@ -71,7 +71,7 @@ |
||
| 71 | 71 | */ |
| 72 | 72 | protected function createRelationship($object, RelationshipDefinition $definition, MappingContext $context): AbstractRelationship |
| 73 | 73 | { |
| 74 | - if (! $definition->isDataIncluded()) { |
|
| 74 | + if (!$definition->isDataIncluded()) { |
|
| 75 | 75 | return new NoDataRelationship(); |
| 76 | 76 | } |
| 77 | 77 | |
@@ -250,7 +250,7 @@ |
||
| 250 | 250 | */ |
| 251 | 251 | public function __toString(): string |
| 252 | 252 | { |
| 253 | - return 'Error-object with ' . ( |
|
| 253 | + return 'Error-object with '.( |
|
| 254 | 254 | $this->id === null |
| 255 | 255 | ? 'no ID' |
| 256 | 256 | : sprintf('ID: "%s"', $this->id) |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | foreach ($definition->getParameters() as $name => $value) |
| 116 | 116 | { |
| 117 | - if (! preg_match('~@(?:(?<namespace>[a-z0-9_\.]+)\:)?(?<name>[a-z0-9_\.]+)~i', $value, $matches)) { |
|
| 117 | + if (!preg_match('~@(?:(?<namespace>[a-z0-9_\.]+)\:)?(?<name>[a-z0-9_\.]+)~i', $value, $matches)) { |
|
| 118 | 118 | $resolved[$name] = $value; |
| 119 | 119 | continue; |
| 120 | 120 | } |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | continue; |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - if (! isset($scope[$matches['namespace']])) { |
|
| 127 | + if (!isset($scope[$matches['namespace']])) { |
|
| 128 | 128 | throw new \LogicException(sprintf('Object "%s" not found in the scope.', $matches['namespace'])); |
| 129 | 129 | } |
| 130 | 130 | |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | static protected function registerAnnotations() |
| 49 | 49 | { |
| 50 | 50 | if (self::$annotationsRegistered === false) { |
| 51 | - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Relationship.php'); |
|
| 52 | - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Attribute.php'); |
|
| 53 | - AnnotationRegistry::registerFile(__DIR__ . '/Annotation/Link.php'); |
|
| 51 | + AnnotationRegistry::registerFile(__DIR__.'/Annotation/Relationship.php'); |
|
| 52 | + AnnotationRegistry::registerFile(__DIR__.'/Annotation/Attribute.php'); |
|
| 53 | + AnnotationRegistry::registerFile(__DIR__.'/Annotation/Link.php'); |
|
| 54 | 54 | |
| 55 | 55 | self::$annotationsRegistered = true; |
| 56 | 56 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function getDefinition(string $class): Definition |
| 82 | 82 | { |
| 83 | - if (! isset($this->definitionCache[$class])) { |
|
| 83 | + if (!isset($this->definitionCache[$class])) { |
|
| 84 | 84 | $reflection = new \ReflectionClass($class); |
| 85 | 85 | |
| 86 | 86 | $this->definitionCache[$class] = $this->createDefinition($reflection); |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | */ |
| 203 | 203 | protected function validateMethodAttribute(AttributeAnnotation $annotation, \ReflectionMethod $method) |
| 204 | 204 | { |
| 205 | - if (! $method->isPublic()) { |
|
| 205 | + if (!$method->isPublic()) { |
|
| 206 | 206 | throw new \LogicException(sprintf( |
| 207 | 207 | 'Attribute annotation can be applied only to non public method "%s".', |
| 208 | 208 | $method->getName() |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | */ |
| 338 | 338 | protected function processDataType(string $definition, Attribute $attribute) |
| 339 | 339 | { |
| 340 | - if (! preg_match(self::DATATYPE_PATTERN, $definition, $matches)) { |
|
| 340 | + if (!preg_match(self::DATATYPE_PATTERN, $definition, $matches)) { |
|
| 341 | 341 | throw new \LogicException(sprintf('Data-type definition "%s" is invalid.', $definition)); |
| 342 | 342 | } |
| 343 | 343 | |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | |
| 395 | 395 | foreach (['get', 'is'] as $prefix) |
| 396 | 396 | { |
| 397 | - $getter = $prefix . ucfirst($name); |
|
| 397 | + $getter = $prefix.ucfirst($name); |
|
| 398 | 398 | |
| 399 | 399 | if ($class->hasMethod($getter) && $class->getMethod($getter)->isPublic()) { |
| 400 | 400 | return $getter; |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | throw new \LogicException(sprintf( |
| 405 | - 'Getter-method for the property "%s" cannot be resolved automatically. ' . |
|
| 405 | + 'Getter-method for the property "%s" cannot be resolved automatically. '. |
|
| 406 | 406 | 'Probably there is no get%2$s() or is%2$s() method or it is not public.', |
| 407 | 407 | $name, ucfirst($name) |
| 408 | 408 | )); |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | $name = $property->getName(); |
| 420 | 420 | $class = $property->getDeclaringClass(); |
| 421 | 421 | |
| 422 | - $setter = 'set' . ucfirst($name); |
|
| 422 | + $setter = 'set'.ucfirst($name); |
|
| 423 | 423 | |
| 424 | 424 | if ($class->hasMethod($setter) && $class->getMethod($setter)->isPublic()) { |
| 425 | 425 | return $setter; |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | */ |
| 451 | 451 | protected function createLink(LinkAnnotation $annotation): Link |
| 452 | 452 | { |
| 453 | - if (! preg_match(self::RESOURCE_PATTERN, $annotation->resource, $matches)) { |
|
| 453 | + if (!preg_match(self::RESOURCE_PATTERN, $annotation->resource, $matches)) { |
|
| 454 | 454 | throw new \LogicException(sprintf('Invalid resource definition: "%s"', $annotation->resource)); |
| 455 | 455 | } |
| 456 | 456 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | foreach ($definitions as $definition) |
| 159 | 159 | { |
| 160 | - if (! $definition->hasSetter()) { |
|
| 160 | + if (!$definition->hasSetter()) { |
|
| 161 | 161 | continue; |
| 162 | 162 | } |
| 163 | 163 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | { |
| 177 | 177 | $name = $definition->getName(); |
| 178 | 178 | |
| 179 | - if (! $resource->hasAttribute($name)) { |
|
| 179 | + if (!$resource->hasAttribute($name)) { |
|
| 180 | 180 | return; |
| 181 | 181 | } |
| 182 | 182 | |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | return; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - if (! $value instanceof \DateTimeInterface) { |
|
| 24 | + if (!$value instanceof \DateTimeInterface) { |
|
| 25 | 25 | $value = new \DateTimeImmutable((string) $value); |
| 26 | 26 | } |
| 27 | 27 | |
@@ -87,13 +87,13 @@ |
||
| 87 | 87 | $exceptionEvent = new ExceptionEvent($request, $exception); |
| 88 | 88 | $this->dispatcher->dispatch($this->exceptionEvent, $exceptionEvent); |
| 89 | 89 | |
| 90 | - if (! $exceptionEvent->hasResponse()) { |
|
| 90 | + if (!$exceptionEvent->hasResponse()) { |
|
| 91 | 91 | throw new RequestException($request, $exception); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | $response = $exceptionEvent->getResponse(); |
| 95 | 95 | |
| 96 | - if (! $exceptionEvent->isResponseEventEnabled()) { |
|
| 96 | + if (!$exceptionEvent->isResponseEventEnabled()) { |
|
| 97 | 97 | return $response; |
| 98 | 98 | } |
| 99 | 99 | } |
@@ -81,8 +81,7 @@ |
||
| 81 | 81 | |
| 82 | 82 | try { |
| 83 | 83 | $response = $this->client->request($request); |
| 84 | - } |
|
| 85 | - catch (\Throwable $exception) { |
|
| 84 | + } catch (\Throwable $exception) { |
|
| 86 | 85 | $exceptionEvent = new ExceptionEvent($request, $exception); |
| 87 | 86 | $this->dispatcher->dispatch($this->exceptionEvent, $exceptionEvent); |
| 88 | 87 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function getDefinition(string $class): Definition |
| 56 | 56 | { |
| 57 | - if (! isset($this->definitions[$class])) { |
|
| 57 | + if (!isset($this->definitions[$class])) { |
|
| 58 | 58 | $this->definitions[$class] = $this->provideDefinition($class); |
| 59 | 59 | } |
| 60 | 60 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function provideDefinition(string $class): Definition |
| 71 | 71 | { |
| 72 | - $key = self::PREFIX . md5($class); |
|
| 72 | + $key = self::PREFIX.md5($class); |
|
| 73 | 73 | $item = $this->cache->getItem($key); |
| 74 | 74 | |
| 75 | 75 | if ($item->isHit()) { |