Skip to content

Commit

Permalink
+ ComposerJsonGoal::hasRequire/Dev/Any
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Nov 19, 2015
1 parent b186d89 commit 61bb4b4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/goals/ComposerJsonGoal.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,20 @@ public function getAutoload()

return $autoload;
}
public function hasRequireAny($package)
{
return $this->hasRequire($package) || $this->hasRequireDev($package);
}

public function hasRequire($package)
{
$this->runAction('load');
return $this->has('require') && array_key_exists($package, $this->get('require'));
}

public function hasRequireDev($package)
{
$this->runAction('load');
return $this->has('require-dev') && array_key_exists($package, $this->get('require-dev'));
}
}

0 comments on commit 61bb4b4

Please sign in to comment.