Skip to content

Commit cf4f53e

Browse files
committed
Move route URL addition to the constructor so it applies to the routes() method, too.
1 parent e284a84 commit cf4f53e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/Config.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ public function __construct(array $environmentVariables = null, string $envPrefi
156156

157157
if ($routes = $this->getValue('ROUTES')) {
158158
$this->routesDef = $this->decode($routes);
159+
foreach ($this->routesDef as $url => $route) {
160+
$this->routesDef[$url]['url'] = $url;
161+
}
159162
}
160163
if ($relationships = $this->getValue('RELATIONSHIPS')) {
161164
$this->relationshipsDef = $this->decode($relationships);
@@ -318,8 +321,6 @@ public function getRoute(string $id) : array
318321
{
319322
foreach ($this->routes() as $url => $route) {
320323
if ($route['id'] == $id) {
321-
// This is non-standard, but means we don't need to return the array key in parallel.
322-
$route['url'] = $url;
323324
return $route;
324325
}
325326
}

0 commit comments

Comments
 (0)