Skip to content

Commit

Permalink
When adding $extrafiles, support any object that implements the Packa…
Browse files Browse the repository at this point in the history
…geInterface.
  • Loading branch information
saltybeagle committed Mar 7, 2011
1 parent fa91c87 commit 91de94b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/PEAR2/Pyrus/Developer/PackageFile/Commands.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,12 @@ function package($frontend, $args, $options)
}
foreach ($extrafiles as $path => $file) {
if (is_object($file)) {
if ($file instanceof \PEAR2\Pyrus\Package) {
if ($file instanceof \PEAR2\Pyrus\PackageInterface
|| $file instanceof \PEAR2\Pyrus\PackageFileInterface) {
continue;
}
throw new \PEAR2\Pyrus\Developer\Creator\Exception(
'extrasetup file object must be a \PEAR2\Pyrus\Package object');
'extrasetup file object must implement \PEAR2\Pyrus\PackageInterface or \PEAR2\Pyrus\PackageFileInterface');
}
if (!file_exists($file)) {
throw new \PEAR2\Pyrus\Developer\Creator\Exception(
Expand Down

0 comments on commit 91de94b

Please sign in to comment.