1 | <?php |
||
12 | final class Application extends AbstractApplication |
||
13 | { |
||
14 | /** |
||
15 | * Process builder object. |
||
16 | * |
||
17 | * @var ProcessBuilder |
||
18 | */ |
||
19 | protected $processBuilder; |
||
20 | |||
21 | /** |
||
22 | * Application constructor. |
||
23 | * |
||
24 | * @param string $name |
||
25 | * @param string $version |
||
26 | */ |
||
27 | public function __construct(string $name = 'lighthouse-audit', string $version = '0.2.0') |
||
31 | |||
32 | /** |
||
33 | * Disable XDebug. This method is copied from: |
||
34 | * https://github.com/sebastianbergmann/phpcpd/blob/ca6b97f32ebdd3585652a3035d6221a8d2a6c11b/src/CLI/Application.php#L87. |
||
35 | * |
||
36 | * @return void |
||
37 | */ |
||
38 | private function disableXdebug() :void |
||
49 | |||
50 | /** |
||
51 | * Run the Lighthouse Audit application. |
||
52 | * |
||
53 | * @param InputInterface $input |
||
54 | * @param OutputInterface $output |
||
55 | * |
||
56 | * @throws \Throwable |
||
57 | * |
||
58 | * @return int |
||
59 | */ |
||
60 | public function doRun(InputInterface $input, OutputInterface $output) :int |
||
66 | |||
67 | /** |
||
68 | * Get Lighthouse Audit command name. |
||
69 | * |
||
70 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
||
71 | * |
||
72 | * @param InputInterface $input |
||
73 | * |
||
74 | * @return string |
||
75 | */ |
||
76 | protected function getCommandName(InputInterface $input) :string |
||
80 | |||
81 | /** |
||
82 | * Gets the default commands that should always be available. |
||
83 | * |
||
84 | * @return array |
||
85 | */ |
||
86 | protected function getDefaultCommands() :array |
||
94 | |||
95 | /** |
||
96 | * Gets the default input definition. |
||
97 | * |
||
98 | * @return InputDefinition |
||
99 | */ |
||
100 | protected function getDefaultInputDefinition() :InputDefinition |
||
109 | |||
110 | /** |
||
111 | * Gets the InputDefinition related to this Application. |
||
112 | * This method is copied from : |
||
113 | * https://github.com/sebastianbergmann/phpcpd/blob/ca6b97f32ebdd3585652a3035d6221a8d2a6c11b/src/CLI/Application.php#L31. |
||
114 | * |
||
115 | * @return InputDefinition |
||
116 | */ |
||
117 | public function getDefinition() :InputDefinition |
||
124 | |||
125 | /** |
||
126 | * Get the process builder object. |
||
127 | * |
||
128 | * @return ProcessBuilder |
||
129 | */ |
||
130 | public function getProcessBuilder() :ProcessBuilder |
||
138 | |||
139 | /** |
||
140 | * Set the process builder object. |
||
141 | * |
||
142 | * @param ProcessBuilder $builder |
||
143 | */ |
||
144 | public function setProcessBuilder(ProcessBuilder $builder) :void |
||
148 | } |
||
149 |