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