1 | <?php |
||
9 | class CallableService |
||
10 | { |
||
11 | /** |
||
12 | * @var ContainerInterface |
||
13 | */ |
||
14 | private $container; |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $serviceName; |
||
20 | |||
21 | /** |
||
22 | * Constructs the object that will resolve and return the $serviceName service |
||
23 | * on __invoke. |
||
24 | * |
||
25 | * @param ContainerInterface $container |
||
26 | * @param string $serviceName |
||
27 | */ |
||
28 | public function __construct(ContainerInterface $container, $serviceName) |
||
33 | |||
34 | /** |
||
35 | * Returns the $serviceName service. |
||
36 | * |
||
37 | * @return object |
||
38 | */ |
||
39 | public function __invoke() |
||
43 | } |
||
44 |