Total Complexity | 10 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Coverage | 82.61% |
Changes | 0 |
1 | <?php |
||
7 | trait ControllerTrait |
||
8 | { |
||
9 | 1 | protected function validateJobTimingManager() |
|
10 | { |
||
11 | 1 | if ($this->container->hasParameter('dtc_queue.manager.job_timing')) { |
|
12 | $this->validateManagerType('dtc_queue.manager.job_timing'); |
||
13 | 1 | } elseif ($this->container->hasParameter('dtc_queue.manager.job_timing')) { |
|
14 | $this->validateManagerType('dtc_queue.manager.run'); |
||
15 | } else { |
||
16 | 1 | $this->validateManagerType('dtc_queue.manager.job'); |
|
17 | } |
||
18 | 1 | } |
|
19 | |||
20 | 1 | protected function validateRunManager() |
|
26 | } |
||
27 | 1 | } |
|
28 | |||
29 | /** |
||
30 | * @param string $type |
||
31 | */ |
||
32 | 5 | protected function validateManagerType($type) |
|
33 | { |
||
34 | 5 | $managerType = $this->container->getParameter($type); |
|
35 | 5 | if ('mongodb' !== $managerType && 'orm' != $managerType && 'odm' != $managerType) { |
|
36 | throw new UnsupportedException("Unsupported manager type: $managerType"); |
||
37 | } |
||
38 | 5 | } |
|
39 | |||
40 | 7 | protected function addCssJs(array &$params) |
|
47 | 7 | } |
|
48 | } |
||
49 |