Skip to content

Commit ad1a184

Browse files
committed
ReferenceTester.php: inc. code readability
1 parent ea9fbf4 commit ad1a184

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tools/raml2html/src/Test/ReferenceTester.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,14 @@ private function parseRouterOutput($consolePath)
170170
continue;
171171
}
172172
$lineParts = preg_split('/\s+/', $outputLine);
173-
$routeId = $lineParts[0];
174-
$methods = explode('|', $lineParts[1]);
173+
$routeProperties = array_combine(['Name', 'Method', 'Scheme', 'Host', 'Path'], $lineParts);
174+
$routeId = $routeProperties['Name'];
175+
$methods = explode('|', $routeProperties['Method']);
175176
foreach ($methods as $method) {
176177
if ('OPTIONS' === $method) {
177178
continue;
178179
}
179-
$routePath = str_replace($this->apiUri, '', $lineParts[4]);
180+
$routePath = str_replace($this->apiUri, '', $routeProperties['Path']);
180181
if (!array_key_exists($routePath, $confRoutes)) {
181182
$confRoutes[$routePath] = ['methods' => []];
182183
}

0 commit comments

Comments
 (0)