Completed
Push — 6.13 ( ec4891...06e30d )
by André
60:01 queued 41:05
created

ConsoleInitEvent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
namespace eZ\Publish\Core\MVC\Symfony\Event;
8
9
use Symfony\Component\Console\Command\Command;
10
use Symfony\Component\Console\Event\ConsoleEvent;
11
use Symfony\Component\Console\Input\InputInterface;
12
use Symfony\Component\Console\Output\OutputInterface;
13
use Symfony\Component\HttpKernel\Kernel;
14
15
/**
16
 * Allows to do things before the command is loaded, like configuring system based on input.
17
 */
18
class ConsoleInitEvent extends ConsoleEvent
19
{
20
    public function __construct(InputInterface $input, OutputInterface $output)
21
    {
22
        // Only relevant for 6.x, as in Symfony 2.x command argument is not optional
23
        if (Kernel::MAJOR_VERSION < 3) {
24
            parent::__construct(new Command('invalid'), $input, $output);
25
        } else {
26
            parent::__construct(null, $input, $output);
27
        }
28
    }
29
}
30