Passed
Push — master ( 7a5b9c...a3c1ba )
by Michael
06:08
created
src/Hydrator/DocumentHydrator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Hydrator/Extension/LinksExtension.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Hydrator/Extension/ExtensionInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Hydrator/Extension/ErrorsExtension.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Hydrator/Extension/IncludedExtension.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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),
Please login to merge, or discard this patch.
src/Hydrator/Extension/JsonApiExtension.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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)
Please login to merge, or discard this patch.
src/Hydrator/Extension/RelationshipExtension.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Hydrator/Extension/MetadataExtension.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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),
Please login to merge, or discard this patch.
src/Mapper/Definition/AnnotationProcessor/AbstractProcessor.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.