Completed
Pull Request — master (#4)
by
unknown
03:40 queued 01:17
created
src/ArrayHydrator.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@
 block discarded – undo
145 145
      * @param $entity
146 146
      * @param $propertyName
147 147
      * @param $value
148
-     * @param null $reflectionObject
148
+     * @param \ReflectionObject $reflectionObject
149 149
      * @return mixed
150 150
      */
151 151
     protected function setProperty($entity, $propertyName, $value, $reflectionObject = null)
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,8 +35,7 @@  discard block
 block discarded – undo
35 35
     {
36 36
         if (is_string($entity) && class_exists($entity)) {
37 37
             $entity = new $entity;
38
-        }
39
-        elseif (!is_object($entity)) {
38
+        } elseif (!is_object($entity)) {
40 39
             throw new Exception('Entity passed to ArrayHydrator::hydrate() must be a class name or entity object');
41 40
         }
42 41
 
@@ -130,8 +129,7 @@  discard block
 block discarded – undo
130 129
         foreach ($values as $value) {
131 130
             if (is_array($value)) {
132 131
                 $assocationObjects[] = $this->hydrate($mapping['targetEntity'], $value);
133
-            }
134
-            elseif ($associationObject = $this->fetchAssociationEntity($mapping['targetEntity'], $value)) {
132
+            } elseif ($associationObject = $this->fetchAssociationEntity($mapping['targetEntity'], $value)) {
135 133
                 $assocationObjects[] = $associationObject;
136 134
             }
137 135
         }
Please login to merge, or discard this patch.
src/JsonApiHydrator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
     protected function mapRelationshipsArray(array $data)
67 67
     {
68 68
         return array_map(
69
-            function ($relation) {
69
+            function($relation) {
70 70
                 return $this->getResourceId($relation) ?: ['attributes' => $relation];
71 71
             },
72 72
             $data
Please login to merge, or discard this patch.