1 | <?php |
||
31 | class FetchCommand extends Command |
||
32 | { |
||
33 | use LoggerAwareTrait; |
||
34 | |||
35 | /** |
||
36 | * @var ManagerInterface |
||
37 | */ |
||
38 | protected $manager; |
||
39 | |||
40 | /** |
||
41 | * @var SourcesRegistryInterface |
||
42 | */ |
||
43 | protected $sourcesRegistry; |
||
44 | |||
45 | /** |
||
46 | * @var \Swift_Mailer |
||
47 | */ |
||
48 | protected $mailer; |
||
49 | |||
50 | /** |
||
51 | * @var EngineInterface |
||
52 | */ |
||
53 | protected $templateEngine; |
||
54 | |||
55 | /** |
||
56 | * @var SymfonyStyle |
||
57 | */ |
||
58 | protected $outputStyle; |
||
59 | |||
60 | public function __construct(ManagerInterface $manager, SourcesRegistryInterface $sourcesRegistry) |
||
66 | |||
67 | public function setMailer(\Swift_Mailer $mailer) |
||
72 | |||
73 | public function setTemplateEngine(EngineInterface $templateEngine) |
||
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | protected function configure() |
||
91 | |||
92 | /** |
||
93 | * {@inheritdoc} |
||
94 | */ |
||
95 | protected function execute(InputInterface $input, OutputInterface $output) |
||
120 | |||
121 | |||
122 | /** |
||
123 | * Clean date from console input. |
||
124 | * |
||
125 | * @param InputInterface $input Console input. |
||
126 | * @param OutputStyle $outputStyle Output style to use. |
||
127 | * @return FetchCommand $this Fluent interface. |
||
128 | * |
||
129 | * @throws \Exception |
||
130 | */ |
||
131 | protected function cleanInputDate(InputInterface $input, OutputStyle $outputStyle) |
||
150 | |||
151 | /** |
||
152 | * Clean sources from console input. |
||
153 | * |
||
154 | * @param InputInterface $input Console input. |
||
155 | * @param OutputStyle $outputStyle Output style to use. |
||
156 | * @return FetchCommand $this Fluent interface. |
||
157 | * |
||
158 | * @throws \Exception |
||
159 | */ |
||
160 | protected function cleanInputSources(InputInterface $input, OutputStyle $outputStyle) |
||
184 | |||
185 | /** |
||
186 | * Display command begin note. |
||
187 | * |
||
188 | * @param InputInterface $input Console input. |
||
189 | * @param OutputStyle $outputStyle Console style. |
||
190 | * @return FetchCommand $this Fluent interface. |
||
191 | */ |
||
192 | protected function displayCommandBegin(InputInterface $input, OutputStyle $outputStyle) |
||
205 | |||
206 | /** |
||
207 | * Do fetch rates. |
||
208 | * |
||
209 | * @param InputInterface $input Console input. |
||
210 | * @return FetchCommand $this Fluent interface. |
||
211 | * @throws \Exception |
||
212 | */ |
||
213 | protected function doFetch(InputInterface $input) |
||
240 | |||
241 | /** |
||
242 | * Display command success note. |
||
243 | * |
||
244 | * @param OutputStyle $outputStyle |
||
245 | * @return FetchCommand $this Fluent interface. |
||
246 | */ |
||
247 | protected function displayCommandSuccess(OutputStyle $outputStyle) |
||
252 | |||
253 | protected function notifySuccess() |
||
258 | |||
259 | /** |
||
260 | * Display command fail note. |
||
261 | * |
||
262 | * @param OutputStyle $outputStyle |
||
263 | * @return FetchCommand $this Fluent interface. |
||
264 | */ |
||
265 | protected function displayCommandFail(OutputStyle $outputStyle) |
||
271 | |||
272 | protected function notifyFail() |
||
276 | } |
||
277 |
PHP Analyzer performs a side-effects analysis of your code. A side-effect is basically anything that might be visible after the scope of the method is left.
Let’s take a look at an example:
If we look at the
getEmail()
method, we can see that it has no side-effect. Whether you call this method or not, no future calls to other methods are affected by this. As such code as the following is useless:On the hand, if we look at the
setEmail()
, this method _has_ side-effects. In the following case, we could not remove the method call: