Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

Commit

Permalink
Update Command.php
Browse files Browse the repository at this point in the history
Symfony 4 proof
  • Loading branch information
RamonSmit authored Aug 11, 2018
1 parent 6319b04 commit 87c044e
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions src/Helpers/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ class Command
*/
protected static function command($prefix, $args)
{
$process = new Process(self::builder($prefix, $args));
$arguments = array_merge([$prefix], $args);

$process = new Process($arguments);
$process->run();

// executes after the command finishes
Expand All @@ -28,21 +30,4 @@ protected static function command($prefix, $args)

return $process->getOutput();
}

/**
* @param $prefix
* @param array $args
*
* @return string
*/
public static function builder($prefix, $args)
{
$builder = new ProcessBuilder();
$builder->setPrefix($prefix);

return $builder
->setArguments($args)
->getProcess()
->getCommandLine();
}
}

0 comments on commit 87c044e

Please sign in to comment.