1
0
Fork 0

Add config>platform checking

pull/6281/head^2
Parallel 2017-03-20 23:58:05 +08:00 committed by GitHub
parent 74f18133da
commit 6ad7caa25e
1 changed files with 10 additions and 0 deletions

View File

@ -63,6 +63,16 @@ class ValidatingArrayLoader implements LoaderInterface
unset($this->config['version']);
}
}
if (!empty($this->config['config']['platform'])) {
foreach ((array)$this->config['config']['platform'] as $key=>$platform) {
try {
$this->versionParser->normalize($platform);
} catch (\Exception $e) {
$this->errors[] = 'config.platform.' . $key . ' : invalid value ('.$platform.'): '.$e->getMessage();
}
}
}
$this->validateRegex('type', '[A-Za-z0-9-]+');
$this->validateString('target-dir');