for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Samurai\Project\Task;
use Samurai\Task\ITask;
use Samurai\Task\Task;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Class BootstrapImportation
* @package Samurai\Project\Task
* @author Raphaël Lefebvre <[email protected]>
*/
class BootstrapImportation extends Task
{
* @param InputInterface $input
* @param OutputInterface $output
* @return int
public function execute(InputInterface $input, OutputInterface $output)
if(!$this->getService('project')->getBootstrap()){
throw new \InvalidArgumentException('The bootstrap of the project is not defined');
}
$output->writeln(sprintf(
'<info>Installing project %s from %s</info>',
$this->getService('project')->getName(),
$this->getService('project')->getBootstrap()->getPackage()
));
return $this->getService('composer')->createProject($this->getService('project'), $this->getOptions()) === 0 ? ITask::NO_ERROR_CODE : ITask::BLOCKING_ERROR_CODE;
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.
* @return array
private function getOptions()
return array_filter([
'repository-url' => $this->getService('project')->getBootstrap()->getSource()
]);
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.