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

DefaultCommand::execute()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 2
eloc 6
nc 2
nop 2
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