src/PatchExecutor/PatchPatcher.php
public function patchIsAlreadyApplied(Patch $patch, $baseDirectory, $patchLevel)
    {
        $command = $this->buildCommand($patch->getLocalPath(), $baseDirectory, $patchLevel, true);
        list($rc, $stdOut, $stdErr) = $this->run($command);
        if ($stdErr === '') {
            $stdErr = $stdOut;
        }
        if ($rc === 1 && strpos($stdErr, 'Skipping patch.') !== false && preg_match('/^(\\d+) out of \\1 hunks? ignored/m', $stdErr)) {
            return true;
        }

        return false;
    }
public function patchIsAlreadyApplied(Patch $patch, $baseDirectory, $patchLevel)
    {
        $command = $this->buildCommand($patch->getLocalPath(), $baseDirectory, $patchLevel, true);
        list($rc, $stdOut, $stdErr) = $this->run($command);
        if ($stdErr === '') {
            $stdErr = $stdOut;
        }
        if ($rc === 1 && strpos($stdErr, 'Skipping patch.') !== false && preg_match('/^(\\d+) out of \\1 hunks? ignored/m', $stdErr)) {
            return true;
        }

        return false;
    }
public function patchIsAlreadyApplied ( Patch $ patch , $ baseDirectory , $ patchLevel ) { $ command = $ this -> buildCommand ( $ patch -> getLocalPath ( ) , $ baseDirectory , $ patchLevel , true ) ; list ( $ rc , $ stdOut , $ stdErr ) = $ this -> run ( $ command ) ; if ( $ stdErr === '' ) { $ stdErr = $ stdOut ; } if ( $ rc === 1 && strpos ( $ stdErr , 'Skipping patch.' ) !== false && preg_match ( '/^(\\d+) out of \\1 hunks? ignored/m' , $ stdErr ) ) { return true ; } return false ; }
Check if a patch is already applied.

@param \ComposerPatcher\Patch $patch the patch to be analyzed
@param string $baseDirectory the directory where the patch should be applied
@param string $patchLevel the patch level

@return bool
Check if a patch is already applied .