1
0
Fork 0

Replace tracking variable with direct package count check

pull/4422/head
Dennis Birkholz 2015-09-18 17:26:31 +02:00
parent 2fb7dd881a
commit 6b1c9882dd
1 changed files with 1 additions and 4 deletions

View File

@ -101,8 +101,6 @@ class PathRepository extends ArrayRepository
{ {
parent::initialize(); parent::initialize();
$foundPackage = false;
foreach ($this->getPaths() as $path) { foreach ($this->getPaths() as $path) {
$path = realpath($path) . '/'; $path = realpath($path) . '/';
@ -111,7 +109,6 @@ class PathRepository extends ArrayRepository
continue; continue;
} }
$foundPackage = true;
$json = file_get_contents($composerFilePath); $json = file_get_contents($composerFilePath);
$package = JsonFile::parseJson($json, $composerFilePath); $package = JsonFile::parseJson($json, $composerFilePath);
$package['dist'] = array( $package['dist'] = array(
@ -131,7 +128,7 @@ class PathRepository extends ArrayRepository
$this->addPackage($package); $this->addPackage($package);
} }
if (!$foundPackage) { if (count($this) == 0) {
throw new \RuntimeException(sprintf('No `composer.json` file found in any path repository in "%s"', $this->url)); throw new \RuntimeException(sprintf('No `composer.json` file found in any path repository in "%s"', $this->url));
} }
} }