1
0
Fork 0

Allow running the validating array loader with multiple packages

pull/1288/head
Jordi Boggiano 2012-11-04 17:06:24 +01:00
parent 1682532b80
commit a80001ad97
1 changed files with 3 additions and 5 deletions

View File

@ -24,21 +24,19 @@ class ValidatingArrayLoader implements LoaderInterface
private $loader;
private $versionParser;
private $ignoreErrors;
private $errors = array();
private $errors;
private $config;
public function __construct(LoaderInterface $loader, $ignoreErrors = true, VersionParser $parser = null)
{
$this->loader = $loader;
$this->ignoreErrors = $ignoreErrors;
if (!$parser) {
$parser = new VersionParser();
}
$this->versionParser = $parser;
$this->versionParser = $parser ?: new VersionParser();
}
public function load(array $config, $class = 'Composer\Package\CompletePackage')
{
$this->errors = array();
$this->config = $config;
$this->validateRegex('name', '[A-Za-z0-9][A-Za-z0-9_.-]*/[A-Za-z0-9][A-Za-z0-9_.-]*', true);