mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-22 11:09:11 -04:00
ALPHA 3.0.2a
This commit is contained in:
18
vendor/symfony/routing/Loader/YamlFileLoader.php
vendored
18
vendor/symfony/routing/Loader/YamlFileLoader.php
vendored
@@ -11,13 +11,13 @@
|
||||
|
||||
namespace Symfony\Component\Routing\Loader;
|
||||
|
||||
use Symfony\Component\Routing\RouteCollection;
|
||||
use Symfony\Component\Routing\Route;
|
||||
use Symfony\Component\Config\Loader\FileLoader;
|
||||
use Symfony\Component\Config\Resource\FileResource;
|
||||
use Symfony\Component\Routing\Route;
|
||||
use Symfony\Component\Routing\RouteCollection;
|
||||
use Symfony\Component\Yaml\Exception\ParseException;
|
||||
use Symfony\Component\Yaml\Parser as YamlParser;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Symfony\Component\Config\Loader\FileLoader;
|
||||
|
||||
/**
|
||||
* YamlFileLoader loads Yaml routing files.
|
||||
@@ -73,7 +73,7 @@ class YamlFileLoader extends FileLoader
|
||||
}
|
||||
|
||||
// not an array
|
||||
if (!is_array($parsedConfig)) {
|
||||
if (!\is_array($parsedConfig)) {
|
||||
throw new \InvalidArgumentException(sprintf('The file "%s" must contain a YAML array.', $path));
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ class YamlFileLoader extends FileLoader
|
||||
*/
|
||||
public function supports($resource, $type = null)
|
||||
{
|
||||
return is_string($resource) && in_array(pathinfo($resource, PATHINFO_EXTENSION), array('yml', 'yaml'), true) && (!$type || 'yaml' === $type);
|
||||
return \is_string($resource) && \in_array(pathinfo($resource, PATHINFO_EXTENSION), array('yml', 'yaml'), true) && (!$type || 'yaml' === $type);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,7 +120,7 @@ class YamlFileLoader extends FileLoader
|
||||
$defaults['_controller'] = $config['controller'];
|
||||
}
|
||||
|
||||
if (is_array($config['path'])) {
|
||||
if (\is_array($config['path'])) {
|
||||
$route = new Route('', $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
|
||||
|
||||
foreach ($config['path'] as $locale => $path) {
|
||||
@@ -161,11 +161,11 @@ class YamlFileLoader extends FileLoader
|
||||
$defaults['_controller'] = $config['controller'];
|
||||
}
|
||||
|
||||
$this->setCurrentDir(dirname($path));
|
||||
$this->setCurrentDir(\dirname($path));
|
||||
|
||||
$imported = $this->import($config['resource'], $type, false, $file);
|
||||
|
||||
if (!is_array($imported)) {
|
||||
if (!\is_array($imported)) {
|
||||
$imported = array($imported);
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ class YamlFileLoader extends FileLoader
|
||||
*/
|
||||
protected function validate($config, $name, $path)
|
||||
{
|
||||
if (!is_array($config)) {
|
||||
if (!\is_array($config)) {
|
||||
throw new \InvalidArgumentException(sprintf('The definition of "%s" in "%s" must be a YAML array.', $name, $path));
|
||||
}
|
||||
if ($extraKeys = array_diff(array_keys($config), self::$availableKeys)) {
|
||||
|
||||
Reference in New Issue
Block a user