@@ -92,7 +92,7 @@ |
||
92 | 92 | if (is_numeric($key)) { |
93 | 93 | continue; |
94 | 94 | } |
95 | - $array[ $key ] = $this->mergeConfig($value, $merging[ $key ]); |
|
95 | + $array[$key] = $this->mergeConfig($value, $merging[$key]); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | return $array; |
@@ -112,7 +112,7 @@ |
||
112 | 112 | |
113 | 113 | $map = static::getMap(); |
114 | 114 | |
115 | - return $map[ $api_code ] ?? null; |
|
115 | + return $map[$api_code] ?? null; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | public static function isCodeValid($code): bool |
@@ -56,12 +56,12 @@ discard block |
||
56 | 56 | // check for exact class name match... |
57 | 57 | $cls = get_class($data); |
58 | 58 | if (array_key_exists($cls, $this->classes)) { |
59 | - $result = $this->classes[ $cls ]; |
|
59 | + $result = $this->classes[$cls]; |
|
60 | 60 | } else { |
61 | 61 | // no exact match, then lets try with `instanceof` |
62 | 62 | foreach ($this->classes as $class_name => $params) { |
63 | 63 | if ($cls instanceof $class_name) { |
64 | - $result = $this->classes[ $cls ]; |
|
64 | + $result = $this->classes[$cls]; |
|
65 | 65 | break; |
66 | 66 | } |
67 | 67 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | { |
80 | 80 | if (is_object($data)) { |
81 | 81 | $cfg = $this->getClassMappingConfigOrThrow($data); |
82 | - $data = [$cfg[ ResponseBuilder::KEY_KEY ] => $data->{$cfg[ ResponseBuilder::KEY_METHOD ]}()]; |
|
82 | + $data = [$cfg[ResponseBuilder::KEY_KEY] => $data->{$cfg[ResponseBuilder::KEY_METHOD]}()]; |
|
83 | 83 | } else { |
84 | 84 | if (!is_array($data) && $data !== null) { |
85 | 85 | throw new \InvalidArgumentException( |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | if (is_object($data)) { |
113 | 113 | $cfg = $this->getClassMappingConfigOrThrow($data); |
114 | 114 | |
115 | - return [$cfg[ ResponseBuilder::KEY_KEY ] => $data->{$cfg[ ResponseBuilder::KEY_METHOD ]}()]; |
|
115 | + return [$cfg[ResponseBuilder::KEY_KEY] => $data->{$cfg[ResponseBuilder::KEY_METHOD]}()]; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | // This is to ensure that we either have array with user provided keys i.e. ['foo'=>'bar'], which will then |
@@ -144,15 +144,15 @@ discard block |
||
144 | 144 | // sprintf('Invalid payload data. Must be null, array or object ("%s" given).', gettype($data))); |
145 | 145 | // } |
146 | 146 | } |
147 | - $data[ $key ] = $this->convertArray($val); |
|
147 | + $data[$key] = $this->convertArray($val); |
|
148 | 148 | } elseif (is_object($val)) { |
149 | 149 | $cls = get_class($val); |
150 | 150 | $cfg = $this->getClassMappingConfigOrThrow($val); |
151 | 151 | if (array_key_exists($cls, $this->classes)) { |
152 | - $conversion_method = $this->classes[ $cls ][ ResponseBuilder::KEY_METHOD ]; |
|
152 | + $conversion_method = $this->classes[$cls][ResponseBuilder::KEY_METHOD]; |
|
153 | 153 | $converted_data = $val->$conversion_method(); |
154 | 154 | // $data = [$this->classes[ $cls ][ ResponseBuilder::KEY_KEY ] => $converted_data]; |
155 | - $data[ $key ] = $converted_data; |
|
155 | + $data[$key] = $converted_data; |
|
156 | 156 | } |
157 | 157 | } |
158 | 158 | } |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | |
470 | 470 | if ($data !== null && !is_object($data)) { |
471 | 471 | // ensure we get object in final JSON structure in data node |
472 | - $data = (object)$data; |
|
472 | + $data = (object) $data; |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | /** @noinspection PhpUndefinedClassInspection */ |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | |
484 | 484 | if ($debug_data !== null) { |
485 | 485 | $debug_key = Config::get(static::CONF_KEY_DEBUG_DEBUG_KEY, self::KEY_DEBUG); |
486 | - $response[ $debug_key ] = $debug_data; |
|
486 | + $response[$debug_key] = $debug_data; |
|
487 | 487 | } |
488 | 488 | |
489 | 489 | return $response; |