@@ -22,19 +22,19 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | final class ToArrayConverter implements ConverterContract |
| 24 | 24 | { |
| 25 | - /** |
|
| 26 | - * Returns array representation of the object. |
|
| 27 | - * |
|
| 28 | - * @param object $obj Object to be converted |
|
| 29 | - * @param array $config Converter config array to be used for this object (based on exact class |
|
| 30 | - * name match or inheritance). |
|
| 31 | - * |
|
| 32 | - * @return array |
|
| 33 | - */ |
|
| 34 | - public function convert(object $obj, /** @scrutinizer ignore-unused */ array $config): array |
|
| 35 | - { |
|
| 36 | - Validator::assertIsObject('obj', $obj); |
|
| 25 | + /** |
|
| 26 | + * Returns array representation of the object. |
|
| 27 | + * |
|
| 28 | + * @param object $obj Object to be converted |
|
| 29 | + * @param array $config Converter config array to be used for this object (based on exact class |
|
| 30 | + * name match or inheritance). |
|
| 31 | + * |
|
| 32 | + * @return array |
|
| 33 | + */ |
|
| 34 | + public function convert(object $obj, /** @scrutinizer ignore-unused */ array $config): array |
|
| 35 | + { |
|
| 36 | + Validator::assertIsObject('obj', $obj); |
|
| 37 | 37 | |
| 38 | - return $obj->toArray(); |
|
| 39 | - } |
|
| 38 | + return $obj->toArray(); |
|
| 39 | + } |
|
| 40 | 40 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | $worker = new $cfg[ RB::KEY_HANDLER ](); |
| 148 | 148 | $result = $worker->convert($data, $cfg); |
| 149 | 149 | $result = $cfg[ RB::KEY_KEY ] === null ? $result : [$cfg[ RB::KEY_KEY ] => $result]; |
| 150 | - } |
|
| 150 | + } |
|
| 151 | 151 | |
| 152 | 152 | if ($result === null && \is_array($data)) { |
| 153 | 153 | $cfg = $this->getPrimitiveMappingConfigOrThrow($data); |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | "Missing '{$key_name}' entry in '{$class_name}' class mapping config."); |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - Validator::assertIsType(RB::KEY_KEY, $class_config[$key_name], $allowed_types); |
|
| 228 | + Validator::assertIsType(RB::KEY_KEY, $class_config[$key_name], $allowed_types); |
|
| 229 | 229 | } |
| 230 | 230 | } |
| 231 | 231 | } |