Update to Drupal 8.0-dev-2015-11-17. Commits through da81cd220, Tue Nov 17 15:53:49 2015 +0000, Issue #2617224 by Wim Leers: Move around/fix some documentation.
This commit is contained in:
parent
4afb23bbd3
commit
7784f4c23d
929 changed files with 19798 additions and 5304 deletions
14
vendor/symfony/routing/Loader/YamlFileLoader.php
vendored
14
vendor/symfony/routing/Loader/YamlFileLoader.php
vendored
|
@ -23,8 +23,6 @@ use Symfony\Component\Config\Loader\FileLoader;
|
|||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Tobias Schultze <http://tobion.de>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class YamlFileLoader extends FileLoader
|
||||
{
|
||||
|
@ -42,8 +40,6 @@ class YamlFileLoader extends FileLoader
|
|||
* @return RouteCollection A RouteCollection instance
|
||||
*
|
||||
* @throws \InvalidArgumentException When a route can't be parsed because YAML is invalid
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function load($file, $type = null)
|
||||
{
|
||||
|
@ -62,7 +58,7 @@ class YamlFileLoader extends FileLoader
|
|||
}
|
||||
|
||||
try {
|
||||
$config = $this->yamlParser->parse(file_get_contents($path));
|
||||
$parsedConfig = $this->yamlParser->parse(file_get_contents($path));
|
||||
} catch (ParseException $e) {
|
||||
throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $path), 0, $e);
|
||||
}
|
||||
|
@ -71,16 +67,16 @@ class YamlFileLoader extends FileLoader
|
|||
$collection->addResource(new FileResource($path));
|
||||
|
||||
// empty file
|
||||
if (null === $config) {
|
||||
if (null === $parsedConfig) {
|
||||
return $collection;
|
||||
}
|
||||
|
||||
// not an array
|
||||
if (!is_array($config)) {
|
||||
if (!is_array($parsedConfig)) {
|
||||
throw new \InvalidArgumentException(sprintf('The file "%s" must contain a YAML array.', $path));
|
||||
}
|
||||
|
||||
foreach ($config as $name => $config) {
|
||||
foreach ($parsedConfig as $name => $config) {
|
||||
if (isset($config['pattern'])) {
|
||||
if (isset($config['path'])) {
|
||||
throw new \InvalidArgumentException(sprintf('The file "%s" cannot define both a "path" and a "pattern" attribute. Use only "path".', $path));
|
||||
|
@ -106,8 +102,6 @@ class YamlFileLoader extends FileLoader
|
|||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function supports($resource, $type = null)
|
||||
{
|
||||
|
|
Reference in a new issue