src/PatchExecutor.php
protected function checkCommandExists($commandName, $argument = '--version')
    {
        $command = $commandName;
        $argument = (string) $argument;
        if ($argument !== '') {
            $command .= ' '.$argument;
        }
        list($rc, , $stdErr) = $this->run($command);
        if ($rc !== 0) {
            throw new Exception\CommandNotFound($commandName, $stdErr ? $stdErr : null);
        }
    }
protected function checkCommandExists($commandName, $argument = '--version')
    {
        $command = $commandName;
        $argument = (string) $argument;
        if ($argument !== '') {
            $command .= ' '.$argument;
        }
        list($rc, , $stdErr) = $this->run($command);
        if ($rc !== 0) {
            throw new Exception\CommandNotFound($commandName, $stdErr ? $stdErr : null);
        }
    }
protected function checkCommandExists ( $ commandName , $ argument = '--version' ) { $ command = $ commandName ; $ argument = ( string ) $ argument ; if ( $ argument !== '' ) { $ command .= ' ' . $ argument ; } list ( $ rc , , $ stdErr ) = $ this -> run ( $ command ) ; if ( $ rc !== 0 ) { throw new Exception \ CommandNotFound ( $ commandName , $ stdErr ? $ stdErr : null ) ; } }
Check if a command exists.

@param string $commandName the command name
@param string $argument the argument to be used to run the command

@throws \ComposerPatcher\Exception\CommandNotFound
Check if a command exists .