1 | <?php |
||
27 | class ControllerResolver extends BaseControllerResolver |
||
28 | { |
||
29 | |||
30 | protected $request; |
||
31 | |||
32 | /** |
||
33 | * Constructor. |
||
34 | * |
||
35 | * @param ServiceLocatorInterface $serviceManager A ServiceLocatorInterface instance |
||
36 | * @param ControllerNameParser $parser A ControllerNameParser instance |
||
37 | * @param LoggerInterface $logger A LoggerInterface instance |
||
38 | */ |
||
39 | public function __construct(ServiceLocatorInterface $serviceManager, ControllerNameParser $parser, LoggerInterface $logger = null) |
||
45 | |||
46 | /** |
||
47 | * Returns a callable for the given controller. |
||
48 | * |
||
49 | * @param string $controller A Controller string |
||
50 | * |
||
51 | * @throws \LogicException When the name could not be parsed |
||
52 | * @throws \InvalidArgumentException When the controller class does not exist |
||
53 | * |
||
54 | * @return mixed A PHP callable |
||
55 | */ |
||
56 | protected function createController($controller) |
||
78 | |||
79 | /** |
||
80 | * @param string $class |
||
81 | * @return object |
||
82 | */ |
||
83 | protected function instantiateController($class) |
||
92 | |||
93 | } |
||
94 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: