Skip to content

Make custom routers compatible with the LoaderInterface #12844

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions routing/custom_route_loader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ you do. The resource name itself is not actually used in the example::
{
private $isLoaded = false;

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

public function supports($resource, $type = null)
public function supports($resource, string $type = null)
{
return 'extra' === $type;
}
Expand Down Expand Up @@ -419,7 +419,7 @@ configuration file - you can call the

class AdvancedLoader extends Loader
{
public function load($resource, $type = null)
public function load($resource, string $type = null)
{
$routes = new RouteCollection();

Expand All @@ -433,7 +433,7 @@ configuration file - you can call the
return $routes;
}

public function supports($resource, $type = null)
public function supports($resource, string $type = null)
{
return 'advanced_extra' === $type;
}
Expand Down