for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Cdf\BiCoreBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Finder\Finder;
class BiPubblicamanualeCommand extends ContainerAwareCommand
{
protected function configure()
$this
->setName('bi:pubblicamanuale')
->setDescription('Copia il manuale dalla cartella Doc alla cartella Web')
->setHelp('Estende la pubblicazione degli assets al manuale');
}
protected function execute(InputInterface $input, OutputInterface $output)
$this->copiaManuale();
protected function copiaManuale()
$filesystem = $this->getContainer()->get('filesystem');
$projectDir = $this->getContainer()->get('kernel')->getRootDir() .DIRECTORY_SEPARATOR . '..' ;
$originDir = $projectDir . '/doc/manuale';
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
will produce no issues.
$targetDir = $projectDir . '/public';
$filesystem->mkdir($targetDir, 0777);
// // We use a custom iterator to ignore VCS files
$filesystem->mirror($originDir, $targetDir, Finder::create()->name('manuale.pdf')->in($originDir));
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
will produce issues in the first and second line, while this second example
will produce no issues.