GrumPHP\Collection\ProcessArgumentsCollection::forExecutable PHP Method

forExecutable() public static method

public static forExecutable ( string $executable ) : ProcessArgumentsCollection
$executable string
return ProcessArgumentsCollection
    public static function forExecutable($executable)
    {
        return new ProcessArgumentsCollection([$executable]);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function run(ContextInterface $context)
 {
     $files = $context->getFiles()->name('*.php');
     if (0 === count($files)) {
         return;
     }
     $config = $this->getConfiguration();
     $arguments = ProcessArgumentsCollection::forExecutable($this->getCommandLocation());
     $arguments->addOptionalArgument('--configuration=%s', $config['config_file']);
     $this->processBuilder->setArguments($arguments->getValues());
     $process = $this->processBuilder->getProcess();
     $process->run();
     if (!$process->isSuccessful()) {
         throw new RuntimeException($process->getOutput());
     }
 }
All Usage Examples Of GrumPHP\Collection\ProcessArgumentsCollection::forExecutable