Conditions | 7 |
Paths | 11 |
Total Lines | 32 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 56 |
Changes | 0 |
1 | <?php |
||
18 | public function process(FilesCollection $files, Report $report) { |
||
19 | |||
20 | $isDebug = $this->getOutput()->isDebug(); |
||
21 | |||
22 | foreach ($files as $file) { |
||
23 | $errorsNum = $report->count(); |
||
24 | |||
25 | if ($isDebug) { |
||
26 | $this->getOutput()->writeln('⚑ open : ' . $file->getPath()); |
||
27 | } |
||
28 | |||
29 | foreach ($this->getTools() as $tool) { |
||
30 | |||
31 | if (!$tool->canProcess($file)) { |
||
32 | continue; |
||
33 | } |
||
34 | |||
35 | $tool->process($file, $report); |
||
36 | if ($errorsNum === $report->count()) { |
||
37 | if ($isDebug) { |
||
38 | |||
39 | $this->getOutput()->writeln('✔ ok : ' . $tool->getDescription() . ' (' . $tool->getName() . ')'); |
||
40 | } |
||
41 | continue; |
||
42 | } |
||
43 | |||
44 | |||
45 | $this->getOutput()->writeln('✘ error : ' . $tool->getDescription() . ' (' . $tool->getName() . ')'); |
||
46 | } |
||
47 | } |
||
48 | |||
49 | } |
||
50 | |||
51 | } |