Total Complexity | 5 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Coverage | 90% |
Changes | 0 |
1 | <?php |
||
13 | trait DynamicCommunicationLocator |
||
14 | { |
||
15 | /** |
||
16 | * @return \Xervice\Core\Business\Model\Facade\FacadeInterface |
||
17 | */ |
||
18 | 1 | public function getFacade(): FacadeInterface |
|
19 | { |
||
20 | 1 | return $this->getLocator()->facade(); |
|
21 | } |
||
22 | |||
23 | /** |
||
24 | * @return \Xervice\Core\Business\Model\Factory\FactoryInterface |
||
25 | */ |
||
26 | 1 | public function getFactory(): FactoryInterface |
|
27 | { |
||
28 | 1 | return $this->getLocator()->factory(); |
|
29 | } |
||
30 | |||
31 | /** |
||
32 | * @return \Xervice\Core\Business\Model\Locator\Proxy\Communication\CommunicationLocatorProxy |
||
33 | */ |
||
34 | 2 | protected function getLocator(): CommunicationLocatorProxy |
|
35 | { |
||
36 | 2 | return Locator::getInstance()->{$this->getServiceName()}()->communicationLocator(); |
|
37 | } |
||
38 | |||
39 | /** |
||
40 | * @return string |
||
41 | * @throws \Xervice\Core\Business\Exception\ServiceNotFoundException |
||
42 | */ |
||
43 | 2 | protected function getServiceName(): string |
|
50 | } |
||
51 | } |