@@ -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 ($data instanceof $class_name) { |
| 64 | - $result = $this->classes[ $class_name ]; |
|
| 64 | + $result = $this->classes[$class_name]; |
|
| 65 | 65 | break; |
| 66 | 66 | } |
| 67 | 67 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | if (is_object($data)) { |
| 91 | 91 | $cfg = $this->getClassMappingConfigOrThrow($data); |
| 92 | - $data = [$cfg[ ResponseBuilder::KEY_KEY ] => $data->{$cfg[ ResponseBuilder::KEY_METHOD ]}()]; |
|
| 92 | + $data = [$cfg[ResponseBuilder::KEY_KEY] => $data->{$cfg[ResponseBuilder::KEY_METHOD]}()]; |
|
| 93 | 93 | } elseif (!is_array($data)) { |
| 94 | 94 | throw new \InvalidArgumentException( |
| 95 | 95 | sprintf('Invalid payload data. Must be null, array or object with mapping ("%s" given).', gettype($data))); |
@@ -129,15 +129,15 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | foreach ($data as $key => $val) { |
| 131 | 131 | if (is_array($val)) { |
| 132 | - $data[ $key ] = $this->convertArray($val); |
|
| 132 | + $data[$key] = $this->convertArray($val); |
|
| 133 | 133 | } elseif (is_object($val)) { |
| 134 | 134 | $cls = get_class($val); |
| 135 | 135 | $cfg = $this->getClassMappingConfigOrThrow($val); |
| 136 | 136 | if (array_key_exists($cls, $this->classes)) { |
| 137 | - $conversion_method = $this->classes[ $cls ][ ResponseBuilder::KEY_METHOD ]; |
|
| 137 | + $conversion_method = $this->classes[$cls][ResponseBuilder::KEY_METHOD]; |
|
| 138 | 138 | $converted_data = $val->$conversion_method(); |
| 139 | 139 | // $data = [$this->classes[ $cls ][ ResponseBuilder::KEY_KEY ] => $converted_data]; |
| 140 | - $data[ $key ] = $converted_data; |
|
| 140 | + $data[$key] = $converted_data; |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | $data = $converter->convert($data); |
| 438 | 438 | if ($data !== null && !is_object($data)) { |
| 439 | 439 | // ensure we get object in final JSON structure in data node |
| 440 | - $data = (object)$data; |
|
| 440 | + $data = (object) $data; |
|
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | /** @noinspection PhpUndefinedClassInspection */ |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | |
| 452 | 452 | if ($debug_data !== null) { |
| 453 | 453 | $debug_key = Config::get(static::CONF_KEY_DEBUG_DEBUG_KEY, self::KEY_DEBUG); |
| 454 | - $response[ $debug_key ] = $debug_data; |
|
| 454 | + $response[$debug_key] = $debug_data; |
|
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | return $response; |