Passed
Pull Request — dev (#170)
by
unknown
09:56
created
src/ApiCodesHelpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
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
 	/**
Please login to merge, or discard this patch.
src/lang/de/builder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     'http_422'                 => 'Kann nicht verarbeitet werden',
45 45
     'http_423'                 => 'Gesperrt',
46 46
     'http_424'                 => 'Vorhergehende Bedingung nicht erfüllt',
47
-    'http_425'                 => 'Too Early',  // FIXME
47
+    'http_425'                 => 'Too Early', // FIXME
48 48
     'http_426'                 => 'Update benötigt',
49 49
     'http_428'                 => ' Vorbedingung benötigt',
50 50
     'http_429'                 => 'Zu viele Anfragen',
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
     'http_503'                 => 'Dienst nicht verfügbar',
58 58
     'http_504'                 => 'Portal-Auszeit',
59 59
     'http_505'                 => 'HTTP-Version nicht unterstützt',
60
-    'http_506'                 => 'Variant Also Negotiates',  // FIXME
60
+    'http_506'                 => 'Variant Also Negotiates', // FIXME
61 61
     'http_507'                 => 'Speicher des Servers reicht nicht aus',
62 62
     'http_508'                 => 'Endlosschleife',
63
-    'http_509'                 => 'Unassigned',     // FIXME
63
+    'http_509'                 => 'Unassigned', // FIXME
64 64
     'http_510'                 => 'Zu wenig Informationen',
65 65
     'http_511'                 => 'Identizifierung benötigt',
66 66
 ];
Please login to merge, or discard this patch.
src/ExceptionHandlers/HttpExceptionHandler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,12 +42,12 @@
 block discarded – undo
42 42
 		$config = \array_replace($default_config, $user_config);
43 43
 
44 44
 		$http_code = $ex->getStatusCode();
45
-		$result = $config[ $http_code ] ?? null;
45
+		$result = $config[$http_code] ?? null;
46 46
 
47 47
 		// If we do not have dedicated entry fort this particular http_code,
48 48
 		// fall back to default value.
49 49
 		if ($result === null) {
50
-			$result = $config[ RB::KEY_DEFAULT ];
50
+			$result = $config[RB::KEY_DEFAULT];
51 51
 		}
52 52
 
53 53
 		// Some defaults to fall back to if not set in user config.
Please login to merge, or discard this patch.
src/ResponseBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -375,7 +375,7 @@
 block discarded – undo
375 375
 
376 376
 		if ($debug_data !== null) {
377 377
 			$debug_key = Config::get(RB::CONF_KEY_DEBUG_DEBUG_KEY, RB::KEY_DEBUG);
378
-			$response[ $debug_key ] = $debug_data;
378
+			$response[$debug_key] = $debug_data;
379 379
 		}
380 380
 
381 381
 		return $response;
Please login to merge, or discard this patch.
src/ExceptionHandlerHelper.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
 		do {
46 46
 			if ($cfg === null) {
47 47
 				// Default handler MUST be present by design and always return something useful.
48
-				$cfg = self::getExceptionHandlerConfig()[ RB::KEY_DEFAULT ];
48
+				$cfg = self::getExceptionHandlerConfig()[RB::KEY_DEFAULT];
49 49
 			}
50 50
 
51
-			$handler = new $cfg[ RB::KEY_HANDLER ]();
52
-			$handler_result = $handler->handle($cfg[ RB::KEY_CONFIG ], $ex);
51
+			$handler = new $cfg[RB::KEY_HANDLER]();
52
+			$handler_result = $handler->handle($cfg[RB::KEY_CONFIG], $ex);
53 53
 			if ($handler_result !== null) {
54 54
 				$result = self::processException($ex, $handler_result);
55 55
 			} else {
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 		$cfg = self::getExceptionHandlerConfig();
148 148
 
149 149
 		// This config entry is guaranted to exist. Enforced by tests.
150
-		$cfg = $cfg[ HttpException::class ][ RB::KEY_CONFIG ][ HttpResponse::HTTP_UNAUTHORIZED ];
150
+		$cfg = $cfg[HttpException::class][RB::KEY_CONFIG][HttpResponse::HTTP_UNAUTHORIZED];
151 151
 
152 152
 		return static::processException($exception, $cfg, HttpResponse::HTTP_UNAUTHORIZED);
153 153
 	}
@@ -277,13 +277,13 @@  discard block
 block discarded – undo
277 277
 
278 278
 			// check for exact class name match...
279 279
 			if (\array_key_exists($cls, $cfg)) {
280
-				$result = $cfg[ $cls ];
280
+				$result = $cfg[$cls];
281 281
 			} else {
282 282
 				// no exact match, then lets try with `instanceof`
283 283
 				// Config entries are already sorted by priority.
284 284
 				foreach (\array_keys($cfg) as $class_name) {
285 285
 					if ($ex instanceof $class_name) {
286
-						$result = $cfg[ $class_name ];
286
+						$result = $cfg[$class_name];
287 287
 						break;
288 288
 					}
289 289
 				}
Please login to merge, or discard this patch.
src/Util.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -40,20 +40,20 @@
 block discarded – undo
40 40
 		$array = $original;
41 41
 		foreach ($merging as $m_key => $m_val) {
42 42
 			if (\array_key_exists($m_key, $original)) {
43
-				$orig_type = \gettype($original[ $m_key ]);
43
+				$orig_type = \gettype($original[$m_key]);
44 44
 				$m_type = \gettype($m_val);
45 45
 				if ($orig_type !== $m_type) {
46 46
 					throw new Ex\IncompatibleTypeException(
47 47
 						"Incompatible types. Cannot merge {$m_type} into {$orig_type} (key '{$m_key}').");
48 48
 				}
49 49
 
50
-				if (\is_array($merging[ $m_key ])) {
51
-					$array[ $m_key ] = static::mergeConfig($original[ $m_key ], $m_val);
50
+				if (\is_array($merging[$m_key])) {
51
+					$array[$m_key] = static::mergeConfig($original[$m_key], $m_val);
52 52
 				} else {
53
-					$array[ $m_key ] = $m_val;
53
+					$array[$m_key] = $m_val;
54 54
 				}
55 55
 			} else {
56
-				$array[ $m_key ] = $m_val;
56
+				$array[$m_key] = $m_val;
57 57
 			}
58 58
 		}
59 59
 
Please login to merge, or discard this patch.
src/Converter.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 		$result = null;
61 61
 
62 62
 		$type = \gettype($data);
63
-		$result = $this->primitives[ $type ] ?? null;
63
+		$result = $this->primitives[$type] ?? null;
64 64
 
65 65
 		if ($result === null) {
66 66
 			throw new Ex\ConfigurationNotFoundException(
@@ -92,13 +92,13 @@  discard block
 block discarded – undo
92 92
 		$cls = \get_class($data);
93 93
 		if (\is_string($cls)) {
94 94
 			if (\array_key_exists($cls, $this->classes)) {
95
-				$result = $this->classes[ $cls ];
95
+				$result = $this->classes[$cls];
96 96
 				$debug_result = 'exact config match';
97 97
 			} else {
98 98
 				// no exact match, then lets try with `instanceof`
99 99
 				foreach (\array_keys($this->classes) as $class_name) {
100 100
 					if ($data instanceof $class_name) {
101
-						$result = $this->classes[ $class_name ];
101
+						$result = $this->classes[$class_name];
102 102
 						$debug_result = "subclass of {$class_name}";
103 103
 						break;
104 104
 					}
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
 
145 145
 		if ($result === null && \is_object($data)) {
146 146
 			$cfg = $this->getClassMappingConfigOrThrow($data);
147
-			$worker = new $cfg[ RB::KEY_HANDLER ]();
147
+			$worker = new $cfg[RB::KEY_HANDLER]();
148 148
 			$result = $worker->convert($data, $cfg);
149
-			$result = $cfg[ RB::KEY_KEY ] === null ? $result : [$cfg[ RB::KEY_KEY ] => $result];
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)) {
@@ -154,12 +154,12 @@  discard block
 block discarded – undo
154 154
 
155 155
 			$result = $this->convertArray($data);
156 156
 			if (!Util::isArrayWithNonNumericKeys($data)) {
157
-				$result = [$cfg[ RB::KEY_KEY ] => $result];
157
+				$result = [$cfg[RB::KEY_KEY] => $result];
158 158
 			}
159 159
 		}
160 160
 
161 161
 		if (\is_bool($data) || \is_float($data) || \is_int($data) || \is_string($data)) {
162
-			$result = [$this->getPrimitiveMappingConfigOrThrow($data)[ RB::KEY_KEY ] => $data];
162
+			$result = [$this->getPrimitiveMappingConfigOrThrow($data)[RB::KEY_KEY] => $data];
163 163
 		}
164 164
 
165 165
 		return $result;
@@ -179,12 +179,12 @@  discard block
 block discarded – undo
179 179
 
180 180
 		foreach ($data as $key => $val) {
181 181
 			if (\is_array($val)) {
182
-				$data[ $key ] = $this->convertArray($val);
182
+				$data[$key] = $this->convertArray($val);
183 183
 			} elseif (\is_object($val)) {
184 184
 				$cfg = $this->getClassMappingConfigOrThrow($val);
185
-				$worker = new $cfg[ RB::KEY_HANDLER ]();
185
+				$worker = new $cfg[RB::KEY_HANDLER]();
186 186
 				$converted_data = $worker->convert($val, $cfg);
187
-				$data[ $key ] = $converted_data;
187
+				$data[$key] = $converted_data;
188 188
 			}
189 189
 		}
190 190
 
Please login to merge, or discard this patch.