Skip to content

Commit a80c1a1

Browse files
committed
minor #12844 Make custom routers compatible with the LoaderInterface (atailouloute)
This PR was merged into the 5.0 branch. Discussion ---------- Make custom routers compatible with the LoaderInterface Commits ------- a49af0d Make custom routers compatible with the LoaderInterface
2 parents 63bb6ed + a49af0d commit a80c1a1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

routing/custom_route_loader.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ you do. The resource name itself is not actually used in the example::
253253
{
254254
private $isLoaded = false;
255255

256-
public function load($resource, $type = null)
256+
public function load($resource, string $type = null)
257257
{
258258
if (true === $this->isLoaded) {
259259
throw new \RuntimeException('Do not add the "extra" loader twice');
@@ -280,7 +280,7 @@ you do. The resource name itself is not actually used in the example::
280280
return $routes;
281281
}
282282

283-
public function supports($resource, $type = null)
283+
public function supports($resource, string $type = null)
284284
{
285285
return 'extra' === $type;
286286
}
@@ -419,7 +419,7 @@ configuration file - you can call the
419419

420420
class AdvancedLoader extends Loader
421421
{
422-
public function load($resource, $type = null)
422+
public function load($resource, string $type = null)
423423
{
424424
$routes = new RouteCollection();
425425

@@ -433,7 +433,7 @@ configuration file - you can call the
433433
return $routes;
434434
}
435435

436-
public function supports($resource, $type = null)
436+
public function supports($resource, string $type = null)
437437
{
438438
return 'advanced_extra' === $type;
439439
}

0 commit comments

Comments
 (0)