1 | <?php |
||
17 | class ServiceInjectingSlumberAnnotation extends SlumberAnnotation |
||
18 | { |
||
19 | /** |
||
20 | * The ID of the request service |
||
21 | * |
||
22 | * @var string |
||
23 | * |
||
24 | * @Annotation\Required() |
||
25 | */ |
||
26 | public $service; |
||
27 | |||
28 | /** |
||
29 | * The class that the service must be an instance of |
||
30 | * |
||
31 | * @var string |
||
32 | * |
||
33 | * @Annotation\Required() |
||
34 | */ |
||
35 | public $ofClass; |
||
36 | |||
37 | /** |
||
38 | * @return string |
||
39 | */ |
||
40 | public function getServiceDefinition() |
||
44 | |||
45 | /** |
||
46 | * @return null |
||
47 | */ |
||
48 | public function getServiceDefinitionDefault() |
||
52 | |||
53 | /** |
||
54 | * @return string |
||
55 | */ |
||
56 | public function getServiceClassDefinition() |
||
60 | |||
61 | /** |
||
62 | * @return string |
||
63 | */ |
||
64 | public function getServiceClassDefinitionDefault() |
||
68 | |||
69 | /** |
||
70 | * |
||
71 | * @param ValidationContext $context |
||
72 | * |
||
73 | * @throws SlumberException |
||
74 | */ |
||
75 | public function validate(ValidationContext $context) |
||
85 | |||
86 | /** |
||
87 | * @param ContainerInterface $provider |
||
88 | * |
||
89 | * @return mixed |
||
90 | */ |
||
91 | protected function getService(ContainerInterface $provider) |
||
97 | |||
98 | private function validateParamAreSet(ValidationContext $context) |
||
110 | |||
111 | private function validateServiceIsPresentInContainer(ValidationContext $context) |
||
122 | |||
123 | private function validateServiceClassExists(ValidationContext $context) |
||
134 | |||
135 | private function validateServiceHasCorrectType(ValidationContext $context) |
||
151 | } |
||
152 |