@@ -145,7 +145,7 @@ |
||
| 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) |
@@ -35,8 +35,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -66,7 +66,7 @@ |
||
| 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 |