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\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\ArrayInput;
class BiCoreBundleDropdatabaseCommand extends ContainerAwareCommand
{
protected function configure()
$this
->setName('bicorebundle:dropdatabase')
->setDescription('Cancellazione database bicorebundle')
->setHelp('Cancella il database e tutti i dati di bicorebundle')
->addOption('force', null, InputOption::VALUE_NONE, 'Se non impostato, il comando non avrà effetto');
}
protected function execute(InputInterface $input, OutputInterface $output)
$force = $input->getOption('force');
if (!$force) {
echo "Specificare l'opzione --force per eseguire il comando";
return 1;
$command = $this->getApplication()->find('doctrine:schema:drop');
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.
$arguments = array('command' => 'doctrine:schema:drop', '--force' => true);
$inputcmd = new ArrayInput($arguments);
$command->run($inputcmd, $output);
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.