Allow running the validating array loader with multiple packages
parent
1682532b80
commit
a80001ad97
|
@ -24,21 +24,19 @@ class ValidatingArrayLoader implements LoaderInterface
|
||||||
private $loader;
|
private $loader;
|
||||||
private $versionParser;
|
private $versionParser;
|
||||||
private $ignoreErrors;
|
private $ignoreErrors;
|
||||||
private $errors = array();
|
private $errors;
|
||||||
private $config;
|
private $config;
|
||||||
|
|
||||||
public function __construct(LoaderInterface $loader, $ignoreErrors = true, VersionParser $parser = null)
|
public function __construct(LoaderInterface $loader, $ignoreErrors = true, VersionParser $parser = null)
|
||||||
{
|
{
|
||||||
$this->loader = $loader;
|
$this->loader = $loader;
|
||||||
$this->ignoreErrors = $ignoreErrors;
|
$this->ignoreErrors = $ignoreErrors;
|
||||||
if (!$parser) {
|
$this->versionParser = $parser ?: new VersionParser();
|
||||||
$parser = new VersionParser();
|
|
||||||
}
|
|
||||||
$this->versionParser = $parser;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function load(array $config, $class = 'Composer\Package\CompletePackage')
|
public function load(array $config, $class = 'Composer\Package\CompletePackage')
|
||||||
{
|
{
|
||||||
|
$this->errors = array();
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
|
|
||||||
$this->validateRegex('name', '[A-Za-z0-9][A-Za-z0-9_.-]*/[A-Za-z0-9][A-Za-z0-9_.-]*', true);
|
$this->validateRegex('name', '[A-Za-z0-9][A-Za-z0-9_.-]*/[A-Za-z0-9][A-Za-z0-9_.-]*', true);
|
||||||
|
|
Loading…
Reference in New Issue