1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace BEAR\Package\Provide\Router; |
||
6 | |||
7 | use BEAR\Sunday\Extension\Router\RouterInterface; |
||
8 | use Ray\Di\Di\Named; |
||
9 | use Ray\Di\ProviderInterface; |
||
10 | |||
11 | /** @implements ProviderInterface<RouterCollection> */ |
||
12 | class RouterCollectionProvider implements ProviderInterface |
||
13 | { |
||
14 | public function __construct( |
||
15 | #[Named('primary_router')] |
||
16 | private RouterInterface $primaryRouter, |
||
17 | private WebRouterInterface $webRouter, |
||
18 | ) { |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * {@inheritDoc} |
||
23 | */ |
||
24 | public function get(): RouterCollection |
||
25 | { |
||
26 | return new RouterCollection([$this->primaryRouter, $this->webRouter]); |
||
0 ignored issues
–
show
|
|||
27 | } |
||
28 | } |
||
29 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: