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() |
|
21 | { |
||
22 | 1 | if ($this->container->hasParameter('dtc_queue.job_timing_manager')) { |
|
23 | $this->validateManagerType('dtc_queue.manager.run'); |
||
24 | } else { |
||
25 | 1 | $this->validateManagerType('dtc_queue.manager.job'); |
|
26 | } |
||
27 | 1 | } |
|
28 | |||
29 | /** |
||
30 | * @param string $type |
||
31 | */ |
||
32 | 5 | protected function validateManagerType($type) |
|
39 | |||
40 | 7 | protected function addCssJs(array &$params) |
|
48 | } |
||
49 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: