mirror of
https://github.com/composer/composer
synced 2025-05-11 01:22:54 +00:00
Use pretty name/version in lock file and debug:packages, fixes #98
This commit is contained in:
parent
8df2436be8
commit
3b8ee5dd54
4 changed files with 11 additions and 5 deletions
|
@ -13,6 +13,7 @@
|
|||
namespace Composer\Repository;
|
||||
|
||||
use Composer\Package\PackageInterface;
|
||||
use Composer\Package\Version\VersionParser;
|
||||
|
||||
/**
|
||||
* A repository implementation that simply stores packages in an array
|
||||
|
@ -29,6 +30,11 @@ class ArrayRepository implements RepositoryInterface
|
|||
*/
|
||||
public function findPackage($name, $version)
|
||||
{
|
||||
// normalize version & name
|
||||
$versionParser = new VersionParser();
|
||||
$version = $versionParser->normalize($version);
|
||||
$name = strtolower($name);
|
||||
|
||||
foreach ($this->getPackages() as $package) {
|
||||
if ($name === $package->getName() && $version === $package->getVersion()) {
|
||||
return $package;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue