1 | <?php |
||
19 | class RoutingProvider implements ProviderInterface |
||
20 | { |
||
21 | const SLYTHERIN_CONTAINER = 'Rougin\Slytherin\Container\Container'; |
||
22 | |||
23 | const SLYTHERIN_ROUTER = 'Rougin\Slytherin\Routing\RouterInterface'; |
||
24 | |||
25 | const ZAPHEUS_ROUTER = 'Zapheus\Routing\RouterInterface'; |
||
26 | |||
27 | /** |
||
28 | * @var \Rougin\Slytherin\Routing\RouterInterface|null |
||
29 | */ |
||
30 | protected $router; |
||
31 | |||
32 | /** |
||
33 | * Initializes the provider instance. |
||
34 | * |
||
35 | * @param \Rougin\Slytherin\Routing\RouterInterface|null $router |
||
36 | */ |
||
37 | 6 | public function __construct(RouterInterface $router = null) |
|
41 | |||
42 | /** |
||
43 | * Registers the bindings in the container. |
||
44 | * |
||
45 | * @param \Zapheus\Container\WritableInterface $container |
||
46 | * @return \Zapheus\Container\ContainerInterface |
||
47 | */ |
||
48 | 6 | public function register(WritableInterface $container) |
|
62 | |||
63 | /** |
||
64 | * Returns the Slytherin router if it does exists from container. |
||
65 | * |
||
66 | * @param \Zapheus\Container\ContainerInterface $container |
||
67 | * @return \Zapheus\Routing\RouterInterface |
||
68 | */ |
||
69 | 6 | protected function slytherin(ContainerInterface $container) |
|
83 | |||
84 | /** |
||
85 | * Returns the Zapheus router if it does exists from container. |
||
86 | * |
||
87 | * @param \Zapheus\Container\ContainerInterface $container |
||
88 | * @return \Zapheus\Routing\RouterInterface |
||
89 | */ |
||
90 | 6 | protected function zapheus(ContainerInterface $container) |
|
98 | } |
||
99 |