@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Mikemirten\Component\JsonApi\Hydrator; |
| 5 | 5 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function hydrate($source): AbstractDocument |
| 51 | 51 | { |
| 52 | - if (! isset($source->data)) { |
|
| 52 | + if (!isset($source->data)) { |
|
| 53 | 53 | return $this->processNoDataDocument($source); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -139,11 +139,11 @@ discard block |
||
| 139 | 139 | */ |
| 140 | 140 | public function hydrateResource($source): ResourceObject |
| 141 | 141 | { |
| 142 | - if (! isset($source->id)) { |
|
| 142 | + if (!isset($source->id)) { |
|
| 143 | 143 | throw new InvalidDocumentException('Resource contains no ID'); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - if (! isset($source->type)) { |
|
| 146 | + if (!isset($source->type)) { |
|
| 147 | 147 | throw new InvalidDocumentException('Resource contains no type'); |
| 148 | 148 | } |
| 149 | 149 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Mikemirten\Component\JsonApi\Hydrator\Extension; |
| 5 | 5 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function hydrate($object, $source, DocumentHydrator $hydrator) |
| 24 | 24 | { |
| 25 | - if (! $object instanceof LinksAwareInterface) { |
|
| 25 | + if (!$object instanceof LinksAwareInterface) { |
|
| 26 | 26 | throw new InvalidDocumentException(sprintf( |
| 27 | 27 | 'Given instance of "%s" does not implements "%s"', |
| 28 | 28 | get_class($object), |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | return new LinkObject($source); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - if (! isset($source->href)) { |
|
| 54 | + if (!isset($source->href)) { |
|
| 55 | 55 | throw new InvalidDocumentException('Link must be a string or an object contains "href" attribute.'); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Mikemirten\Component\JsonApi\Hydrator\Extension; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Mikemirten\Component\JsonApi\Hydrator\Extension; |
| 5 | 5 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function hydrate($object, $source, DocumentHydrator $hydrator) |
| 24 | 24 | { |
| 25 | - if (! $object instanceof ErrorsAwareInterface) { |
|
| 25 | + if (!$object instanceof ErrorsAwareInterface) { |
|
| 26 | 26 | throw new InvalidDocumentException(sprintf( |
| 27 | 27 | 'Given instance of "%s" does not implements "%s"', |
| 28 | 28 | get_class($object), |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | foreach (['id', 'status', 'code', 'title', 'detail'] as $property) |
| 53 | 53 | { |
| 54 | 54 | if (isset($source->$property)) { |
| 55 | - $error->{'set' . ucfirst($property)}($source->$property); |
|
| 55 | + $error->{'set'.ucfirst($property)}($source->$property); |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Mikemirten\Component\JsonApi\Hydrator\Extension; |
| 5 | 5 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | public function hydrate($object, $source, DocumentHydrator $hydrator) |
| 22 | 22 | { |
| 23 | - if (! $object instanceof IncludedResourcesAwareInterface) { |
|
| 23 | + if (!$object instanceof IncludedResourcesAwareInterface) { |
|
| 24 | 24 | throw new InvalidDocumentException(sprintf( |
| 25 | 25 | 'Given instance of "%s" does not implements "%s"', |
| 26 | 26 | get_class($object), |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Mikemirten\Component\JsonApi\Hydrator\Extension; |
| 5 | 5 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function hydrate($object, $source, DocumentHydrator $hydrator) |
| 24 | 24 | { |
| 25 | - if (! $object instanceof AbstractDocument) { |
|
| 25 | + if (!$object instanceof AbstractDocument) { |
|
| 26 | 26 | throw new InvalidDocumentException(sprintf( |
| 27 | 27 | 'Only top-level of document can contains "jsonapi"-object. Instance of "%s" given.', |
| 28 | 28 | get_class($object) |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Mikemirten\Component\JsonApi\Hydrator\Extension; |
| 5 | 5 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | public function hydrate($object, $source, DocumentHydrator $hydrator) |
| 26 | 26 | { |
| 27 | - if (! $object instanceof RelationshipsAwareInterface) { |
|
| 27 | + if (!$object instanceof RelationshipsAwareInterface) { |
|
| 28 | 28 | throw new InvalidDocumentException(sprintf( |
| 29 | 29 | 'Given instance of "%s" does not implements "%s"', |
| 30 | 30 | get_class($object), |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function createRelationship($source, DocumentHydrator $hydrator): AbstractRelationship |
| 51 | 51 | { |
| 52 | - if (! isset($source->data)) { |
|
| 52 | + if (!isset($source->data)) { |
|
| 53 | 53 | return $this->processNoDataRelationship($source, $hydrator); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -127,11 +127,11 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | protected function createResourceIdentifier($source, DocumentHydrator $hydrator): ResourceIdentifierObject |
| 129 | 129 | { |
| 130 | - if (! isset($source->id)) { |
|
| 130 | + if (!isset($source->id)) { |
|
| 131 | 131 | throw new InvalidDocumentException('Resource identifier contains no ID'); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - if (! isset($source->type)) { |
|
| 134 | + if (!isset($source->type)) { |
|
| 135 | 135 | throw new InvalidDocumentException('Resource identifier contains no type'); |
| 136 | 136 | } |
| 137 | 137 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Mikemirten\Component\JsonApi\Hydrator\Extension; |
| 5 | 5 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public function hydrate($object, $source, DocumentHydrator $hydrator) |
| 23 | 23 | { |
| 24 | - if (! $object instanceof MetadataAwareInterface) { |
|
| 24 | + if (!$object instanceof MetadataAwareInterface) { |
|
| 25 | 25 | throw new InvalidDocumentException(sprintf( |
| 26 | 26 | 'Given instance of "%s" does not implements "%s"', |
| 27 | 27 | get_class($object), |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Mikemirten\Component\JsonApi\Mapper\Definition\AnnotationProcessor; |
| 5 | 5 | |
@@ -54,10 +54,10 @@ discard block |
||
| 54 | 54 | static protected function registerAnnotations() |
| 55 | 55 | { |
| 56 | 56 | if (self::$annotationsRegistered === false) { |
| 57 | - AnnotationRegistry::registerFile(__DIR__ . '/../Annotation/ResourceIdentifier.php'); |
|
| 58 | - AnnotationRegistry::registerFile(__DIR__ . '/../Annotation/Relationship.php'); |
|
| 59 | - AnnotationRegistry::registerFile(__DIR__ . '/../Annotation/Attribute.php'); |
|
| 60 | - AnnotationRegistry::registerFile(__DIR__ . '/../Annotation/Link.php'); |
|
| 57 | + AnnotationRegistry::registerFile(__DIR__.'/../Annotation/ResourceIdentifier.php'); |
|
| 58 | + AnnotationRegistry::registerFile(__DIR__.'/../Annotation/Relationship.php'); |
|
| 59 | + AnnotationRegistry::registerFile(__DIR__.'/../Annotation/Attribute.php'); |
|
| 60 | + AnnotationRegistry::registerFile(__DIR__.'/../Annotation/Link.php'); |
|
| 61 | 61 | |
| 62 | 62 | self::$annotationsRegistered = true; |
| 63 | 63 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | protected function createLink(LinkAnnotation $annotation): Link |
| 73 | 73 | { |
| 74 | - if (! preg_match(self::RESOURCE_PATTERN, $annotation->resource, $matches)) { |
|
| 74 | + if (!preg_match(self::RESOURCE_PATTERN, $annotation->resource, $matches)) { |
|
| 75 | 75 | throw new \LogicException(sprintf('Invalid resource definition: "%s"', $annotation->resource)); |
| 76 | 76 | } |
| 77 | 77 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | foreach (['get', 'is'] as $prefix) |
| 102 | 102 | { |
| 103 | - $getter = $prefix . ucfirst($name); |
|
| 103 | + $getter = $prefix.ucfirst($name); |
|
| 104 | 104 | |
| 105 | 105 | if ($class->hasMethod($getter) && $class->getMethod($getter)->isPublic()) { |
| 106 | 106 | return $getter; |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | throw new \LogicException(sprintf( |
| 111 | - 'Getter-method for the property "%s" cannot be resolved automatically. ' . |
|
| 111 | + 'Getter-method for the property "%s" cannot be resolved automatically. '. |
|
| 112 | 112 | 'Probably there is no get%2$s() or is%2$s() method or it is not public.', |
| 113 | 113 | $name, ucfirst($name) |
| 114 | 114 | )); |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $name = $property->getName(); |
| 126 | 126 | $class = $property->getDeclaringClass(); |
| 127 | 127 | |
| 128 | - $setter = 'set' . ucfirst($name); |
|
| 128 | + $setter = 'set'.ucfirst($name); |
|
| 129 | 129 | |
| 130 | 130 | if ($class->hasMethod($setter) && $class->getMethod($setter)->isPublic()) { |
| 131 | 131 | return $setter; |