1 | <?php |
||
13 | abstract class AbstractCommand |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * Application |
||
18 | * |
||
19 | * @var Application |
||
20 | */ |
||
21 | private $application; |
||
22 | |||
23 | /** |
||
24 | * Migrations command |
||
25 | * |
||
26 | * @var MigrationsCommand |
||
27 | */ |
||
28 | private $migrationsCommand; |
||
29 | |||
30 | /** |
||
31 | * Configuration |
||
32 | * |
||
33 | * @var Configuration |
||
34 | */ |
||
35 | private $configuration; |
||
36 | |||
37 | /** |
||
38 | * Output |
||
39 | * |
||
40 | * @var OutputInterface |
||
41 | */ |
||
42 | private $output; |
||
43 | |||
44 | /** |
||
45 | * Migrations config |
||
46 | * |
||
47 | * @var array |
||
48 | */ |
||
49 | private $migrationsConfig; |
||
50 | |||
51 | /** |
||
52 | * Constructor |
||
53 | * |
||
54 | * @param Application $application |
||
55 | * @param MigrationsCommand $migrationsCommand |
||
56 | * @param Configuration $configuration |
||
57 | * @param OutputInterface $output |
||
58 | * @param array $migrationsConfig |
||
59 | */ |
||
60 | public function __construct( |
||
70 | |||
71 | public function __invoke(Route $route, AdapterInterface $console) |
||
94 | |||
95 | /** |
||
96 | * Get input command |
||
97 | * |
||
98 | * @param Route $route |
||
99 | * @return string |
||
100 | */ |
||
101 | abstract public function getInputCommand(Route $route); |
||
102 | |||
103 | /** |
||
104 | * Apply boolean params |
||
105 | * |
||
106 | * @param array $params |
||
107 | * @param array $matches |
||
108 | * @return array |
||
109 | */ |
||
110 | protected function applyBooleanParams(array $params, array $matches) |
||
119 | |||
120 | /** |
||
121 | * Get application |
||
122 | * |
||
123 | * @return Application |
||
124 | */ |
||
125 | public function getApplication() |
||
129 | |||
130 | /** |
||
131 | * Get migrations command |
||
132 | * |
||
133 | * @return MigrationsCommand |
||
134 | */ |
||
135 | public function getMigrationsCommand() |
||
139 | |||
140 | /** |
||
141 | * Get configuration |
||
142 | * |
||
143 | * @return Configuration |
||
144 | */ |
||
145 | public function getConfiguration() |
||
149 | |||
150 | /** |
||
151 | * Get migrations config |
||
152 | * |
||
153 | * @return the array |
||
154 | */ |
||
155 | public function getMigrationsConfig() |
||
159 | |||
160 | /** |
||
161 | * Get output |
||
162 | * |
||
163 | * @return OutputInterface |
||
164 | */ |
||
165 | public function getOutput() |
||
169 | } |
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: