Completed
Pull Request — master (#56)
by Robin
07:16
created

StyleCIConfigUpdateCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 7 1
A execute() 0 5 1
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 17 and the first side effect is on line 10.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
namespace SLLH\StyleCIBridge\Console\Command;
4
5
use SLLH\StyleCIBridge\StyleCI\FixersGenerator;
6
use Symfony\Component\Console\Command\Command;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
@trigger_error('The '.__NAMESPACE__.'\StyleCIConfigUpdateCommand class is deprecated since 1.4 and will be removed in 2.0.', E_USER_DEPRECATED);
0 ignored issues
show
Security Best Practice introduced by
It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 144 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
11
12
/**
13
 * @author Sullivan Senechal <[email protected]>
14
 *
15
 * @deprecated since 1.4, will be removed in 2.0.
16
 */
17
class StyleCIConfigUpdateCommand extends Command
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22
    protected function configure()
23
    {
24
        $this
25
            ->setName('styleci:config:update')
26
            ->setDescription('Update StyleCI fixers config from official repository.')
27
        ;
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    protected function execute(InputInterface $input, OutputInterface $output)
34
    {
35
        $generator = new FixersGenerator();
0 ignored issues
show
Deprecated Code introduced by
The class SLLH\StyleCIBridge\StyleCI\FixersGenerator has been deprecated with message: since 1.4, will be removed in 2.0.

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
36
        $generator->generate();
37
    }
38
}
39