1 | <?php |
||
23 | abstract class AbstractCommand extends Command |
||
24 | { |
||
25 | const FOLDER_RESOURCES = '/../../app/Resources/config/'; |
||
26 | |||
27 | /** |
||
28 | * @var InputInterface |
||
29 | */ |
||
30 | protected $oInput; |
||
31 | |||
32 | /** |
||
33 | * @var OutputInterface |
||
34 | */ |
||
35 | protected $oOutput; |
||
36 | |||
37 | /** |
||
38 | * @var ContainerBuilder |
||
39 | */ |
||
40 | private $oContainer; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | private static $sHomeDir = ''; |
||
46 | |||
47 | /** |
||
48 | * @inheritdoc |
||
49 | */ |
||
50 | 25 | public function __construct($name = null) |
|
57 | |||
58 | /** |
||
59 | * @inheritdoc |
||
60 | */ |
||
61 | 20 | protected function initialize(InputInterface $oInput, OutputInterface $oOutput) |
|
68 | |||
69 | /** |
||
70 | * Executes the current command. |
||
71 | * |
||
72 | * This method is not abstract because you can use this class |
||
73 | * as a concrete class. In this case, instead of defining the |
||
74 | * execute() method, you set the code to execute by passing |
||
75 | * a Closure to the setCode() method. |
||
76 | * |
||
77 | * @param InputInterface $oInput An InputInterface instance |
||
78 | * @param OutputInterface $oOutput An OutputInterface instance |
||
79 | * |
||
80 | * @return integer null or 0 if everything went fine, or an error code |
||
81 | * |
||
82 | * @throws \LogicException When this abstract method is not implemented |
||
83 | * |
||
84 | * @see setCode() |
||
85 | */ |
||
86 | 14 | protected function execute(InputInterface $oInput, OutputInterface $oOutput) |
|
100 | |||
101 | /** |
||
102 | * @return int |
||
103 | */ |
||
104 | abstract protected function process(); |
||
105 | |||
106 | /** |
||
107 | * @return ContainerBuilder |
||
108 | */ |
||
109 | protected function getContainer() |
||
130 | |||
131 | /** |
||
132 | * @return string |
||
133 | */ |
||
134 | 6 | protected function getParameterFileName() |
|
141 | |||
142 | /** |
||
143 | * @return bool |
||
144 | */ |
||
145 | 3 | protected function isAppRunable() |
|
162 | |||
163 | /** |
||
164 | * @return string |
||
165 | */ |
||
166 | 1 | protected function getHomeDir() |
|
183 | |||
184 | /** |
||
185 | * @return string |
||
186 | */ |
||
187 | 1 | protected function getCacheDir() |
|
194 | |||
195 | /** |
||
196 | * @return string |
||
197 | */ |
||
198 | protected function getWorkingDir() |
||
202 | |||
203 | /** |
||
204 | * @param string $sPath |
||
205 | * @param string $sFile |
||
206 | * @param ContainerBuilder $oContainer |
||
207 | */ |
||
208 | private function loadParameterConfig($sPath, $sFile, $oContainer) |
||
217 | } |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.