Completed
Push — master ( 441321...88de30 )
by Martijn van
02:09
created

DefaultCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 10 2
A checkProtection() 0 5 1
1
<?php
2
3
use Symfony\Component\Console\Command\ListCommand;
4
use Symfony\Component\Console\Input\InputInterface;
5
use Symfony\Component\Console\Output\OutputInterface;
6
7
/**
8
 * Class SilverstripeListCommand
9
 *
10
 * We really need NameSpaces in Silverstripe....
11
 */
12
class DefaultCommand extends ListCommand
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
13
{
14
15
    protected function execute(InputInterface $input, OutputInterface $output)
16
    {
17
        parent::execute($input, $output);
18
19
        $msg = $this->checkProtection();
20
        if((bool)$msg) {
21
            $output->writeln("\n");
22
            $output->writeln('<error>'.$msg.'</error>');
23
        }
24
    }
25
26
    /**
27
     * @return bool|string
28
     */
29
    public function checkProtection()
30
    {
31
        $checker =  new SuperSakeChecker();
32
        return $checker->superSakeIsNotProtected();
33
    }
34
35
}
36