1 | <?php |
||
11 | class Reporter |
||
12 | { |
||
13 | /** |
||
14 | * @var \PHPSemVerChecker\Report\Report |
||
15 | */ |
||
16 | protected $report; |
||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $cwd; |
||
21 | /** |
||
22 | * @var bool |
||
23 | */ |
||
24 | protected $fullPath = false; |
||
25 | |||
26 | /** |
||
27 | * @param \PHPSemVerChecker\Report\Report $report |
||
28 | */ |
||
29 | 1 | public function __construct(Report $report) |
|
34 | |||
35 | /** |
||
36 | * @param bool $fullPath |
||
37 | * @return $this |
||
38 | */ |
||
39 | public function setFullPath($fullPath) |
||
45 | |||
46 | /** |
||
47 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
||
48 | */ |
||
49 | 1 | public function output(OutputInterface $output) |
|
50 | { |
||
51 | 1 | $suggestedChange = $this->report->getSuggestedLevel(); |
|
52 | |||
53 | 1 | $output->writeln(''); // line clear |
|
54 | 1 | $output->writeln('Suggested semantic versioning change: ' . Level::toString($suggestedChange)); |
|
55 | |||
56 | $contexts = [ |
||
57 | 1 | 'class', |
|
58 | 'function', |
||
59 | 'interface', |
||
60 | 'trait', |
||
61 | ]; |
||
62 | |||
63 | 1 | foreach ($contexts as $context) { |
|
64 | 1 | $this->outputReport($output, $this->report, $context); |
|
65 | } |
||
66 | 1 | } |
|
67 | |||
68 | /** |
||
69 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
||
70 | * @param \PHPSemVerChecker\Report\Report $report |
||
71 | * @param string $context |
||
72 | */ |
||
73 | 1 | protected function outputReport(OutputInterface $output, Report $report, $context) |
|
83 | |||
84 | /** |
||
85 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
||
86 | * @param \PHPSemVerChecker\Report\Report $report |
||
87 | * @param string $context |
||
88 | */ |
||
89 | 1 | protected function outputTable(OutputInterface $output, Report $report, $context) |
|
102 | |||
103 | /** |
||
104 | * @param \PHPSemVerChecker\Operation\Operation $operation |
||
105 | * @return string |
||
106 | */ |
||
107 | 1 | protected function getLocation(Operation $operation) |
|
117 | } |
||
118 |