SymfonyConsoleApplication   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 21
rs 10
c 1
b 0
f 0
wmc 2
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A registerIO() 0 6 1
1
<?php
2
/*
3
 * Copyright (c) 2015 Juan José Torroglosa Ramón
4
 *
5
 * This file is part of the Cliphar package.
6
 *
7
 * For the full copyright and license information, please view
8
 * the LICENSE file that was distributed with this source code.
9
 */
10
11
namespace Cliphar\Symfony;
12
13
use Cliphar\Binder;
14
use Psr\Log\LogLevel;
15
use Symfony\Component\Console\Application;
16
use Symfony\Component\Console\Formatter\OutputFormatter;
17
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
18
use Symfony\Component\Console\Input\ArgvInput;
19
use Symfony\Component\Console\Output\ConsoleOutput;
20
use Symfony\Component\Console\Output\OutputInterface;
21
22
/**
23
 * Class SymfonyConsoleApplication
24
 */
25
class SymfonyConsoleApplication extends Application
26
{
27
    /**
28
     * @var \Cliphar\Binder
29
     */
30
    private $binder;
31
32
    public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN', Binder $binder)
33
    {
34
        parent::__construct($name, $version);
35
        $this->binder = $binder;
36
    }
37
38
39
    public function registerIO($input, $output)
40
    {
41
        parent::configureIO($input, $output);
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (configureIO() instead of registerIO()). Are you sure this is correct? If so, you might want to change this to $this->configureIO().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
42
        $this->binder->bindToInstance('Symfony\Component\Console\Output\OutputInterface', $output);
0 ignored issues
show
Deprecated Code introduced by
The method Cliphar\Binder::bindToInstance() has been deprecated.

This method has been deprecated.

Loading history...
43
        $this->binder->bindToInstance('Symfony\Component\Console\Input\InputInterface', $input);
0 ignored issues
show
Deprecated Code introduced by
The method Cliphar\Binder::bindToInstance() has been deprecated.

This method has been deprecated.

Loading history...
44
    }
45
}