Skip to content

Commit

Permalink
Merge pull request #45 from gsteel/route-collector-interface-retrieval
Browse files Browse the repository at this point in the history
Allow retrieval of `RouteCollectorInterface` from the container
  • Loading branch information
gsteel committed Mar 29, 2023
2 parents 087ba14 + ffd5b43 commit 4d95b07
Show file tree
Hide file tree
Showing 5 changed files with 293 additions and 40 deletions.
5 changes: 3 additions & 2 deletions composer.json
Expand Up @@ -50,10 +50,11 @@
"require-dev": {
"laminas/laminas-coding-standard": "~2.5.0",
"laminas/laminas-diactoros": "^2.24",
"laminas/laminas-servicemanager": "^3.20.0",
"laminas/laminas-stratigility": "^3.9.0",
"phpunit/phpunit": "^10.0.12",
"phpunit/phpunit": "^10.0.19",
"psalm/plugin-phpunit": "^0.18.4",
"vimeo/psalm": "^5.7.7"
"vimeo/psalm": "^5.8"
},
"suggest": {
"mezzio/mezzio-aurarouter": "^3.0 to use the Aura.Router routing adapter",
Expand Down
217 changes: 180 additions & 37 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/ConfigProvider.php
Expand Up @@ -5,7 +5,10 @@
namespace Mezzio\Router;

/**
* @psalm-type DependencyConfig = array{factories: array<class-string, class-string>}
* @psalm-type DependencyConfig = array{
* factories: array<class-string, class-string>,
* aliases?: array<class-string, class-string>,
* }
*/
class ConfigProvider
{
Expand All @@ -29,6 +32,9 @@ public function getDependencies(): array
Middleware\RouteMiddleware::class => Middleware\RouteMiddlewareFactory::class,
RouteCollector::class => RouteCollectorFactory::class,
],
'aliases' => [
RouteCollectorInterface::class => RouteCollector::class,
],
];
}
}

0 comments on commit 4d95b07

Please sign in to comment.