@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $result = null; |
61 | 61 | |
62 | 62 | $type = \gettype($data); |
63 | - $result = $this->primitives[ $type ] ?? null; |
|
63 | + $result = $this->primitives[$type] ?? null; |
|
64 | 64 | |
65 | 65 | if ($result === null) { |
66 | 66 | throw new Ex\ConfigurationNotFoundException( |
@@ -92,13 +92,13 @@ discard block |
||
92 | 92 | $cls = \get_class($data); |
93 | 93 | if (\is_string($cls)) { |
94 | 94 | if (\array_key_exists($cls, $this->classes)) { |
95 | - $result = $this->classes[ $cls ]; |
|
95 | + $result = $this->classes[$cls]; |
|
96 | 96 | $debug_result = 'exact config match'; |
97 | 97 | } else { |
98 | 98 | // no exact match, then lets try with `instanceof` |
99 | 99 | foreach (\array_keys($this->classes) as $class_name) { |
100 | 100 | if ($data instanceof $class_name) { |
101 | - $result = $this->classes[ $class_name ]; |
|
101 | + $result = $this->classes[$class_name]; |
|
102 | 102 | $debug_result = "subclass of {$class_name}"; |
103 | 103 | break; |
104 | 104 | } |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | |
145 | 145 | if ($result === null && \is_object($data)) { |
146 | 146 | $cfg = $this->getClassMappingConfigOrThrow($data); |
147 | - $worker = new $cfg[ RB::KEY_HANDLER ](); |
|
148 | - $result = [$cfg[ RB::KEY_KEY ] => $worker->convert($data, $cfg)]; |
|
147 | + $worker = new $cfg[RB::KEY_HANDLER](); |
|
148 | + $result = [$cfg[RB::KEY_KEY] => $worker->convert($data, $cfg)]; |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | if ($result === null && \is_array($data)) { |
@@ -153,12 +153,12 @@ discard block |
||
153 | 153 | |
154 | 154 | $result = $this->convertArray($data); |
155 | 155 | if (!Util::isArrayWithNonNumericKeys($data)) { |
156 | - $result = [$cfg[ RB::KEY_KEY ] => $result]; |
|
156 | + $result = [$cfg[RB::KEY_KEY] => $result]; |
|
157 | 157 | } |
158 | 158 | } |
159 | 159 | |
160 | 160 | if (\is_bool($data) || \is_float($data) || \is_int($data) || \is_string($data)) { |
161 | - $result = [$this->getPrimitiveMappingConfigOrThrow($data)[ RB::KEY_KEY ] => $data]; |
|
161 | + $result = [$this->getPrimitiveMappingConfigOrThrow($data)[RB::KEY_KEY] => $data]; |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | return $result; |
@@ -178,12 +178,12 @@ discard block |
||
178 | 178 | |
179 | 179 | foreach ($data as $key => $val) { |
180 | 180 | if (\is_array($val)) { |
181 | - $data[ $key ] = $this->convertArray($val); |
|
181 | + $data[$key] = $this->convertArray($val); |
|
182 | 182 | } elseif (\is_object($val)) { |
183 | 183 | $cfg = $this->getClassMappingConfigOrThrow($val); |
184 | - $worker = new $cfg[ RB::KEY_HANDLER ](); |
|
184 | + $worker = new $cfg[RB::KEY_HANDLER](); |
|
185 | 185 | $converted_data = $worker->convert($val, $cfg); |
186 | - $data[ $key ] = $converted_data; |
|
186 | + $data[$key] = $converted_data; |
|
187 | 187 | } |
188 | 188 | } |
189 | 189 |