Completed
Push — master ( b3df5d...2edadf )
by Andrea
14:05
created

BiCoreBundlePubblicamanualeCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 33.33%

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 27
ccs 5
cts 15
cp 0.3333
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A copiaManuale() 0 11 1
A execute() 0 3 1
A configure() 0 6 1
1
<?php
2
3
namespace Cdf\BiCoreBundle\Command;
4
5
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Output\OutputInterface;
8
use Symfony\Component\Finder\Finder;
9
10
class BiCoreBundlePubblicamanualeCommand extends ContainerAwareCommand
11
{
12
13 3
    protected function configure()
14
    {
15
        $this
16 3
                ->setName('bicorebundle:pubblicamanuale')
17 3
                ->setDescription('Copia il manuale dalla cartella Doc alla cartella Web')
18 3
                ->setHelp('Estende la pubblicazione degli assets al manuale');
19 3
    }
20
21
    protected function execute(InputInterface $input, OutputInterface $output)
22
    {
23
        $this->copiaManuale();
24
    }
25
26
    protected function copiaManuale()
27
    {
28
        $filesystem = $this->getContainer()->get('filesystem');
29
30
        $projectDir = $this->getContainer()->get('kernel')->getRootDir() .DIRECTORY_SEPARATOR . '..' ;
31
        $originDir = $projectDir . '/doc/manuale';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
32
        $targetDir = $projectDir . '/public';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
33
34
        $filesystem->mkdir($targetDir, 0777);
35
        //    // We use a custom iterator to ignore VCS files
36
        $filesystem->mirror($originDir, $targetDir, Finder::create()->name('manuale.pdf')->in($originDir));
37
    }
38
}
39