[Config] Rename FileLoaderLoadException to LoaderLoadException
This commit is contained in:
parent
b6f17f4606
commit
24471a2780
|
@ -10,6 +10,7 @@ Config
|
|||
------
|
||||
|
||||
* Deprecated constructing a `TreeBuilder` without passing root node information.
|
||||
* Deprecated `FileLoaderLoadException`, use `LoaderLoadException` instead.
|
||||
|
||||
Console
|
||||
-------
|
||||
|
|
|
@ -12,6 +12,7 @@ Config
|
|||
* Dropped support for constructing a `TreeBuilder` without passing root node information.
|
||||
* Added the `getChildNodeDefinitions()` method to `ParentNodeDefinitionInterface`.
|
||||
* The `Processor` class has been made final
|
||||
* Removed `FileLoaderLoadException`, use `LoaderLoadException` instead.
|
||||
|
||||
Console
|
||||
-------
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
namespace Symfony\Bundle\FrameworkBundle\Routing;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser;
|
||||
use Symfony\Component\Config\Exception\FileLoaderLoadException;
|
||||
use Symfony\Component\Config\Exception\LoaderLoadException;
|
||||
use Symfony\Component\Config\Loader\DelegatingLoader as BaseDelegatingLoader;
|
||||
use Symfony\Component\Config\Loader\LoaderResolverInterface;
|
||||
|
||||
|
@ -64,7 +64,7 @@ class DelegatingLoader extends BaseDelegatingLoader
|
|||
// - this handles the case and prevents the second fatal error
|
||||
// by triggering an exception beforehand.
|
||||
|
||||
throw new FileLoaderLoadException($resource, null, null, null, $type);
|
||||
throw new LoaderLoadException($resource, null, null, null, $type);
|
||||
}
|
||||
$this->loading = true;
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ CHANGELOG
|
|||
-----
|
||||
|
||||
* deprecated constructing a `TreeBuilder` without passing root node information
|
||||
* renamed `FileLoaderLoadException` to `LoaderLoadException`
|
||||
|
||||
4.1.0
|
||||
-----
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Symfony\Component\Config\Exception;
|
|||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class FileLoaderImportCircularReferenceException extends FileLoaderLoadException
|
||||
class FileLoaderImportCircularReferenceException extends LoaderLoadException
|
||||
{
|
||||
public function __construct(array $resources, int $code = null, \Exception $previous = null)
|
||||
{
|
||||
|
|
|
@ -15,6 +15,8 @@ namespace Symfony\Component\Config\Exception;
|
|||
* Exception class for when a resource cannot be loaded or imported.
|
||||
*
|
||||
* @author Ryan Weaver <ryan@thatsquality.com>
|
||||
*
|
||||
* @deprecated since Symfony 4.2, use LoaderLoadException instead.
|
||||
*/
|
||||
class FileLoaderLoadException extends \Exception
|
||||
{
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Exception;
|
||||
|
||||
/**
|
||||
* Exception class for when a resource cannot be loaded or imported.
|
||||
*
|
||||
* @author Ryan Weaver <ryan@thatsquality.com>
|
||||
*/
|
||||
class LoaderLoadException extends FileLoaderLoadException
|
||||
{
|
||||
}
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
namespace Symfony\Component\Config\Loader;
|
||||
|
||||
use Symfony\Component\Config\Exception\FileLoaderLoadException;
|
||||
use Symfony\Component\Config\Exception\LoaderLoadException;
|
||||
|
||||
/**
|
||||
* DelegatingLoader delegates loading to other loaders using a loader resolver.
|
||||
|
@ -34,7 +34,7 @@ class DelegatingLoader extends Loader
|
|||
public function load($resource, $type = null)
|
||||
{
|
||||
if (false === $loader = $this->resolver->resolve($resource, $type)) {
|
||||
throw new FileLoaderLoadException($resource, null, null, null, $type);
|
||||
throw new LoaderLoadException($resource, null, null, null, $type);
|
||||
}
|
||||
|
||||
return $loader->load($resource, $type);
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
namespace Symfony\Component\Config\Loader;
|
||||
|
||||
use Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException;
|
||||
use Symfony\Component\Config\Exception\FileLoaderLoadException;
|
||||
use Symfony\Component\Config\Exception\FileLocatorFileNotFoundException;
|
||||
use Symfony\Component\Config\Exception\LoaderLoadException;
|
||||
use Symfony\Component\Config\FileLocatorInterface;
|
||||
use Symfony\Component\Config\Resource\FileExistenceResource;
|
||||
use Symfony\Component\Config\Resource\GlobResource;
|
||||
|
@ -66,7 +66,7 @@ abstract class FileLoader extends Loader
|
|||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @throws FileLoaderLoadException
|
||||
* @throws LoaderLoadException
|
||||
* @throws FileLoaderImportCircularReferenceException
|
||||
* @throws FileLocatorFileNotFoundException
|
||||
*/
|
||||
|
@ -161,11 +161,11 @@ abstract class FileLoader extends Loader
|
|||
} catch (\Exception $e) {
|
||||
if (!$ignoreErrors) {
|
||||
// prevent embedded imports from nesting multiple exceptions
|
||||
if ($e instanceof FileLoaderLoadException) {
|
||||
if ($e instanceof LoaderLoadException) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
throw new FileLoaderLoadException($resource, $sourceResource, null, $e, $type);
|
||||
throw new LoaderLoadException($resource, $sourceResource, null, $e, $type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
namespace Symfony\Component\Config\Loader;
|
||||
|
||||
use Symfony\Component\Config\Exception\FileLoaderLoadException;
|
||||
use Symfony\Component\Config\Exception\LoaderLoadException;
|
||||
|
||||
/**
|
||||
* Loader is the abstract class used by all built-in loaders.
|
||||
|
@ -59,7 +59,7 @@ abstract class Loader implements LoaderInterface
|
|||
*
|
||||
* @return $this|LoaderInterface
|
||||
*
|
||||
* @throws FileLoaderLoadException If no loader is found
|
||||
* @throws LoaderLoadException If no loader is found
|
||||
*/
|
||||
public function resolve($resource, $type = null)
|
||||
{
|
||||
|
@ -70,7 +70,7 @@ abstract class Loader implements LoaderInterface
|
|||
$loader = null === $this->resolver ? false : $this->resolver->resolve($resource, $type);
|
||||
|
||||
if (false === $loader) {
|
||||
throw new FileLoaderLoadException($resource, null, null, null, $type);
|
||||
throw new LoaderLoadException($resource, null, null, null, $type);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
|
|
|
@ -12,37 +12,37 @@
|
|||
namespace Symfony\Component\Config\Tests\Exception;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Config\Exception\FileLoaderLoadException;
|
||||
use Symfony\Component\Config\Exception\LoaderLoadException;
|
||||
|
||||
class FileLoaderLoadExceptionTest extends TestCase
|
||||
class LoaderLoadExceptionTest extends TestCase
|
||||
{
|
||||
public function testMessageCannotLoadResource()
|
||||
{
|
||||
$exception = new FileLoaderLoadException('resource', null);
|
||||
$exception = new LoaderLoadException('resource', null);
|
||||
$this->assertEquals('Cannot load resource "resource".', $exception->getMessage());
|
||||
}
|
||||
|
||||
public function testMessageCannotLoadResourceWithType()
|
||||
{
|
||||
$exception = new FileLoaderLoadException('resource', null, null, null, 'foobar');
|
||||
$exception = new LoaderLoadException('resource', null, null, null, 'foobar');
|
||||
$this->assertEquals('Cannot load resource "resource". Make sure there is a loader supporting the "foobar" type.', $exception->getMessage());
|
||||
}
|
||||
|
||||
public function testMessageCannotLoadResourceWithAnnotationType()
|
||||
{
|
||||
$exception = new FileLoaderLoadException('resource', null, null, null, 'annotation');
|
||||
$exception = new LoaderLoadException('resource', null, null, null, 'annotation');
|
||||
$this->assertEquals('Cannot load resource "resource". Make sure annotations are installed and enabled.', $exception->getMessage());
|
||||
}
|
||||
|
||||
public function testMessageCannotImportResourceFromSource()
|
||||
{
|
||||
$exception = new FileLoaderLoadException('resource', 'sourceResource');
|
||||
$exception = new LoaderLoadException('resource', 'sourceResource');
|
||||
$this->assertEquals('Cannot import resource "resource" from "sourceResource".', $exception->getMessage());
|
||||
}
|
||||
|
||||
public function testMessageCannotImportBundleResource()
|
||||
{
|
||||
$exception = new FileLoaderLoadException('@resource', 'sourceResource');
|
||||
$exception = new LoaderLoadException('@resource', 'sourceResource');
|
||||
$this->assertEquals(
|
||||
'Cannot import resource "@resource" from "sourceResource". '.
|
||||
'Make sure the "resource" bundle is correctly registered and loaded in the application kernel class. '.
|
||||
|
@ -53,7 +53,7 @@ class FileLoaderLoadExceptionTest extends TestCase
|
|||
|
||||
public function testMessageHasPreviousErrorWithDotAndUnableToLoad()
|
||||
{
|
||||
$exception = new FileLoaderLoadException(
|
||||
$exception = new LoaderLoadException(
|
||||
'resource',
|
||||
null,
|
||||
null,
|
||||
|
@ -67,7 +67,7 @@ class FileLoaderLoadExceptionTest extends TestCase
|
|||
|
||||
public function testMessageHasPreviousErrorWithoutDotAndUnableToLoad()
|
||||
{
|
||||
$exception = new FileLoaderLoadException(
|
||||
$exception = new LoaderLoadException(
|
||||
'resource',
|
||||
null,
|
||||
null,
|
||||
|
@ -81,7 +81,7 @@ class FileLoaderLoadExceptionTest extends TestCase
|
|||
|
||||
public function testMessageHasPreviousErrorAndUnableToLoadBundle()
|
||||
{
|
||||
$exception = new FileLoaderLoadException(
|
||||
$exception = new LoaderLoadException(
|
||||
'@resource',
|
||||
null,
|
||||
null,
|
|
@ -57,7 +57,7 @@ class DelegatingLoaderTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\Config\Exception\FileLoaderLoadException
|
||||
* @expectedException \Symfony\Component\Config\Exception\LoaderLoadException
|
||||
*/
|
||||
public function testLoadThrowsAnExceptionIfTheResourceCannotBeLoaded()
|
||||
{
|
||||
|
|
|
@ -44,7 +44,7 @@ class LoaderTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\Config\Exception\FileLoaderLoadException
|
||||
* @expectedException \Symfony\Component\Config\Exception\LoaderLoadException
|
||||
*/
|
||||
public function testResolveWhenResolverCannotFindLoader()
|
||||
{
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
namespace Symfony\Component\Routing;
|
||||
|
||||
use Symfony\Component\Config\Exception\FileLoaderLoadException;
|
||||
use Symfony\Component\Config\Exception\LoaderLoadException;
|
||||
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||
use Symfony\Component\Config\Resource\ResourceInterface;
|
||||
|
||||
|
@ -54,7 +54,7 @@ class RouteCollectionBuilder
|
|||
*
|
||||
* @return self
|
||||
*
|
||||
* @throws FileLoaderLoadException
|
||||
* @throws LoaderLoadException
|
||||
*/
|
||||
public function import($resource, $prefix = '/', $type = null)
|
||||
{
|
||||
|
@ -347,7 +347,7 @@ class RouteCollectionBuilder
|
|||
*
|
||||
* @return RouteCollection[]
|
||||
*
|
||||
* @throws FileLoaderLoadException If no loader is found
|
||||
* @throws LoaderLoadException If no loader is found
|
||||
*/
|
||||
private function load($resource, string $type = null): array
|
||||
{
|
||||
|
@ -362,11 +362,11 @@ class RouteCollectionBuilder
|
|||
}
|
||||
|
||||
if (null === $resolver = $this->loader->getResolver()) {
|
||||
throw new FileLoaderLoadException($resource, null, null, null, $type);
|
||||
throw new LoaderLoadException($resource, null, null, null, $type);
|
||||
}
|
||||
|
||||
if (false === $loader = $resolver->resolve($resource, $type)) {
|
||||
throw new FileLoaderLoadException($resource, null, null, null, $type);
|
||||
throw new LoaderLoadException($resource, null, null, null, $type);
|
||||
}
|
||||
|
||||
$collections = $loader->load($resource, $type);
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
"php": "^7.1.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/config": "~3.4|~4.0",
|
||||
"symfony/config": "~4.2",
|
||||
"symfony/http-foundation": "~3.4|~4.0",
|
||||
"symfony/yaml": "~3.4|~4.0",
|
||||
"symfony/expression-language": "~3.4|~4.0",
|
||||
|
@ -28,7 +28,7 @@
|
|||
"psr/log": "~1.0"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/config": "<3.4",
|
||||
"symfony/config": "<4.2",
|
||||
"symfony/dependency-injection": "<3.4",
|
||||
"symfony/yaml": "<3.4"
|
||||
},
|
||||
|
|
Reference in New Issue