These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php namespace Comodojo\Foundation\Console; |
||
2 | |||
3 | use Symfony\Component\Console\Event\ConsoleCommandEvent; |
||
4 | use Symfony\Component\Console\Logger\ConsoleLogger; |
||
5 | |||
6 | /** |
||
7 | * @package Comodojo Foundation |
||
8 | * @author Marco Giovinazzi <[email protected]> |
||
9 | * @license MIT |
||
10 | * |
||
11 | * LICENSE: |
||
12 | * |
||
13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||
14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||
15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||
16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||
17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||
18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
||
19 | * THE SOFTWARE. |
||
20 | */ |
||
21 | |||
22 | class StartEventListener { |
||
23 | |||
24 | static public function listen(ConsoleCommandEvent $event) { |
||
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
25 | |||
26 | $output = $event->getOutput(); |
||
27 | $command = $event->getCommand(); |
||
28 | $application = $command->getApplication(); |
||
29 | |||
30 | if ( $command instanceof AbstractCommand ) { |
||
31 | |||
32 | $logger = new ConsoleLogger($output); |
||
33 | $command->setLogger($logger); |
||
34 | |||
35 | $command->setStartTime(); |
||
36 | |||
37 | $output->writeln([ |
||
38 | '', |
||
39 | $application->getVersion(), |
||
40 | '-----------------------------', |
||
41 | '' |
||
42 | ]); |
||
43 | |||
44 | } |
||
45 | |||
46 | } |
||
47 | |||
48 | } |
||
49 |