Skip to content

Commit

Permalink
Merge pull request #392 from phenaproxima/master
Browse files Browse the repository at this point in the history
  • Loading branch information
cweagans authored Jan 25, 2022
2 parents 59aeb91 + 5c74a3e commit 55c4289
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Patch.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace cweagans\Composer;

use Composer\Package\PackageInterface;

class Patch implements \JsonSerializable
{
/**
Expand Down Expand Up @@ -78,4 +80,17 @@ public function jsonSerialize()
'depth' => $this->depth,
];
}

/**
* 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());
}
}

0 comments on commit 55c4289

Please sign in to comment.