Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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());
}
}