namespace Symfony\Component\Config\Loader;
-use Symfony\Component\Config\FileLocatorInterface;
-use Symfony\Component\Config\Exception\FileLoaderLoadException;
use Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException;
+use Symfony\Component\Config\Exception\FileLoaderLoadException;
use Symfony\Component\Config\Exception\FileLocatorFileNotFoundException;
+use Symfony\Component\Config\FileLocatorInterface;
use Symfony\Component\Config\Resource\FileExistenceResource;
use Symfony\Component\Config\Resource\GlobResource;
*/
public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null)
{
- if (is_string($resource) && strlen($resource) !== $i = strcspn($resource, '*?{[')) {
+ if (\is_string($resource) && \strlen($resource) !== $i = strcspn($resource, '*?{[')) {
$ret = array();
$isSubpath = 0 !== $i && false !== strpos(substr($resource, 0, $i), '/');
foreach ($this->glob($resource, false, $_, $ignoreErrors || !$isSubpath) as $path => $info) {
*/
protected function glob($pattern, $recursive, &$resource = null, $ignoreErrors = false)
{
- if (strlen($pattern) === $i = strcspn($pattern, '*?{[')) {
+ if (\strlen($pattern) === $i = strcspn($pattern, '*?{[')) {
$prefix = $pattern;
$pattern = '';
} elseif (0 === $i || false === strpos(substr($pattern, 0, $i), '/')) {
$prefix = '.';
$pattern = '/'.$pattern;
} else {
- $prefix = dirname(substr($pattern, 0, 1 + $i));
- $pattern = substr($pattern, strlen($prefix));
+ $prefix = \dirname(substr($pattern, 0, 1 + $i));
+ $pattern = substr($pattern, \strlen($prefix));
}
try {
$resource = $loader->getLocator()->locate($resource, $this->currentDir, false);
}
- $resources = is_array($resource) ? $resource : array($resource);
- for ($i = 0; $i < $resourcesCount = count($resources); ++$i) {
+ $resources = \is_array($resource) ? $resource : array($resource);
+ for ($i = 0; $i < $resourcesCount = \count($resources); ++$i) {
if (isset(self::$loading[$resources[$i]])) {
if ($i == $resourcesCount - 1) {
throw new FileLoaderImportCircularReferenceException(array_keys(self::$loading));