@@ -31,15 +31,15 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | $hydrator = $this->getHydrator(); |
| 33 | 33 | |
| 34 | - if($scalarsOnly) { |
|
| 34 | + if ($scalarsOnly) { |
|
| 35 | 35 | foreach ($data as $key => $val) { |
| 36 | - if(!is_scalar($val)) { |
|
| 36 | + if (!is_scalar($val)) { |
|
| 37 | 37 | unset($data[$key]); |
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - if($useConversions && is_array($this->hydrateConversions)) { |
|
| 42 | + if ($useConversions && is_array($this->hydrateConversions)) { |
|
| 43 | 43 | $data = $this->convert($data, $this->hydrateConversions); |
| 44 | 44 | } |
| 45 | 45 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | $data = $hydrator->extract($this); |
| 54 | 54 | |
| 55 | - if($useConversions && is_array($this->extractConversions)) { |
|
| 55 | + if ($useConversions && is_array($this->extractConversions)) { |
|
| 56 | 56 | $data = $this->convert($data, $this->extractConversions); |
| 57 | 57 | } |
| 58 | 58 | |
@@ -62,12 +62,12 @@ discard block |
||
| 62 | 62 | protected function convert(array $data, $conversions) : array |
| 63 | 63 | { |
| 64 | 64 | foreach ($conversions as $from => $to) { |
| 65 | - if(isset($data[$to])) { |
|
| 65 | + if (isset($data[$to])) { |
|
| 66 | 66 | throw new \InvalidArgumentException('The $to argument in the $data object is already set'); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $tmp = $data[$from] ?? null; |
| 70 | - if($tmp) { |
|
| 70 | + if ($tmp) { |
|
| 71 | 71 | unset($data[$from]); |
| 72 | 72 | $data[$to] = $tmp; |
| 73 | 73 | } |