Passed
Push — master ( 016923...04b6e4 )
by Viktoras
01:37
created
src/Entities/ObjectFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         $data = json_decode($json, true);
21 21
 
22 22
         if (!is_array($data)) {
23
-            $data = [];
23
+            $data = [ ];
24 24
         }
25 25
 
26 26
         return $this->makeFromArray($data);
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
 
29 29
     public function makeFromArray(array $data): ObjectInterface
30 30
     {
31
-        if (!isset($data['object'])) {
31
+        if (!isset($data[ 'object' ])) {
32 32
             throw new InvalidArgumentException('Invalid data format');
33 33
         }
34 34
 
35 35
         // Load class name from map or generate one
36
-        $type = self::CLASS_MAPPING[$data['object']] ?? __NAMESPACE__ . '\\' . ucfirst($data['object']);
36
+        $type = self::CLASS_MAPPING[ $data[ 'object' ] ] ?? __NAMESPACE__ . '\\' . ucfirst($data[ 'object' ]);
37 37
 
38 38
         if (!class_exists($type) || !in_array(ObjectInterface::class, class_implements($type), true)) {
39 39
             throw new UnexpectedValueException('Unsupported object');
Please login to merge, or discard this patch.