@@ -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; |
@@ -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; |
@@ -69,12 +69,12 @@ discard block |
||
| 69 | 69 | // check for exact class name match... |
| 70 | 70 | $cls = get_class($data); |
| 71 | 71 | if (array_key_exists($cls, $this->classes)) { |
| 72 | - $result = $this->classes[ $cls ]; |
|
| 72 | + $result = $this->classes[$cls]; |
|
| 73 | 73 | } else { |
| 74 | 74 | // no exact match, then lets try with `instanceof` |
| 75 | 75 | foreach (array_keys($this->classes) as $class_name) { |
| 76 | 76 | if ($data instanceof $class_name) { |
| 77 | - $result = $this->classes[ $class_name ]; |
|
| 77 | + $result = $this->classes[$class_name]; |
|
| 78 | 78 | break; |
| 79 | 79 | } |
| 80 | 80 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | if (is_object($data)) { |
| 104 | 104 | $cfg = $this->getClassMappingConfigOrThrow($data); |
| 105 | - $data = [$cfg[ ResponseBuilder::KEY_KEY ] => $data->{$cfg[ ResponseBuilder::KEY_METHOD ]}()]; |
|
| 105 | + $data = [$cfg[ResponseBuilder::KEY_KEY] => $data->{$cfg[ResponseBuilder::KEY_METHOD]}()]; |
|
| 106 | 106 | } elseif (!is_array($data)) { |
| 107 | 107 | throw new \InvalidArgumentException( |
| 108 | 108 | sprintf('Invalid payload data. Must be null, array or object with mapping ("%s" given).', gettype($data))); |
@@ -142,13 +142,13 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | foreach ($data as $key => $val) { |
| 144 | 144 | if (is_array($val)) { |
| 145 | - $data[ $key ] = $this->convertArray($val); |
|
| 145 | + $data[$key] = $this->convertArray($val); |
|
| 146 | 146 | } elseif (is_object($val)) { |
| 147 | 147 | $cls = get_class($val); |
| 148 | 148 | if (array_key_exists($cls, $this->classes)) { |
| 149 | - $conversion_method = $this->classes[ $cls ][ ResponseBuilder::KEY_METHOD ]; |
|
| 149 | + $conversion_method = $this->classes[$cls][ResponseBuilder::KEY_METHOD]; |
|
| 150 | 150 | $converted_data = $val->$conversion_method(); |
| 151 | - $data[ $key ] = $converted_data; |
|
| 151 | + $data[$key] = $converted_data; |
|
| 152 | 152 | } |
| 153 | 153 | } |
| 154 | 154 | } |
@@ -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 | /** |