diff --git a/src/Patches.php b/src/Patches.php index 4f77eb3b..52e4203a 100644 --- a/src/Patches.php +++ b/src/Patches.php @@ -564,6 +564,19 @@ protected function applyPatchWithGit($install_path, $patch_levels, $filename) { return $patched; } + /** + * Indicates if a package has been patched. + * + * @param \Composer\Package\PackageInterface $package + * The package to check. + * + * @return bool + * TRUE if the package has been patched. + */ + public static function isPackagePatched(PackageInterface $package) { + return array_key_exists('patches_applied', $package->getExtra()); + } + /** * {@inheritDoc} */