From 615ee5789874e28cf0f8a1981b360c571385b0c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=C3=A9na=20Proxima?= Date: Tue, 25 Jan 2022 12:59:16 -0500 Subject: [PATCH] Add isPackagePatched --- src/Patches.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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} */