Total Complexity | 5 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Coverage | 33.33% |
Changes | 0 |
1 | <?php |
||
17 | class PhpDiResolver implements SelfResolvingDefinition, CacheableDefinition { |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $name; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $elgg_dic_key; |
||
28 | |||
29 | /** |
||
30 | * Constructor |
||
31 | * |
||
32 | * @param string $name Entry name. E.g. "Elgg\Menu\Service" |
||
33 | * @param string $elgg_dic_key Key on Elgg's DIC. E.g. "menus" |
||
34 | */ |
||
35 | 18 | public function __construct($name, $elgg_dic_key) { |
|
36 | 18 | $this->name = $name; |
|
37 | 18 | $this->elgg_dic_key = $elgg_dic_key; |
|
38 | 18 | } |
|
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | public function getName() { |
||
44 | return $this->name; |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | public function getScope() { |
||
52 | } |
||
53 | |||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | public function resolve(ContainerInterface $container) { |
||
59 | return _elgg_services()->{$this->elgg_dic_key}; |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | public function isResolvable(ContainerInterface $container) { |
||
67 | } |
||
68 | } |
||
69 |