Passed
Push — master ( 1ea14c...c9f8c6 )
by Andrea
14:03
created

BiPubblicamanualeCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
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 BiPubblicamanualeCommand extends ContainerAwareCommand
11
{
12
13 3
    protected function configure()
14
    {
15
        $this
16 3
                ->setName('bi: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