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 = '1.0.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 | * @return int |
||
56 | * @throws \Throwable |
||
57 | */ |
||
58 | public function doRun(InputInterface $input, OutputInterface $output) :int |
||
64 | |||
65 | /** |
||
66 | * Get Lighthouse Audit command name. |
||
67 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
||
68 | * |
||
69 | * @param InputInterface $input |
||
70 | * @return string |
||
71 | */ |
||
72 | protected function getCommandName(InputInterface $input) :string |
||
76 | |||
77 | /** |
||
78 | * Gets the default commands that should always be available. |
||
79 | * |
||
80 | * @return array |
||
81 | */ |
||
82 | protected function getDefaultCommands() :array |
||
90 | |||
91 | /** |
||
92 | * Gets the default input definition. |
||
93 | * |
||
94 | * @return InputDefinition |
||
95 | */ |
||
96 | protected function getDefaultInputDefinition() :InputDefinition |
||
105 | |||
106 | /** |
||
107 | * Gets the InputDefinition related to this Application. |
||
108 | * This method is copied from : |
||
109 | * https://github.com/sebastianbergmann/phpcpd/blob/ca6b97f32ebdd3585652a3035d6221a8d2a6c11b/src/CLI/Application.php#L31 |
||
110 | * |
||
111 | * @return InputDefinition |
||
112 | */ |
||
113 | public function getDefinition() :InputDefinition |
||
120 | |||
121 | /** |
||
122 | * Get the process builder object. |
||
123 | * |
||
124 | * @return ProcessBuilder |
||
125 | */ |
||
126 | public function getProcessBuilder() :ProcessBuilder |
||
133 | |||
134 | /** |
||
135 | * Set the process builder object. |
||
136 | * |
||
137 | * @param ProcessBuilder $builder |
||
138 | */ |
||
139 | public function setProcessBuilder(ProcessBuilder $builder) :void |
||
143 | } |
||
144 |