Skip to content

Commit 24471a2

Browse files
ProgMinernicolas-grekas
authored andcommitted
[Config] Rename FileLoaderLoadException to LoaderLoadException
1 parent b6f17f4 commit 24471a2

15 files changed

+57
-31
lines changed

UPGRADE-4.2.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Config
1010
------
1111

1212
* Deprecated constructing a `TreeBuilder` without passing root node information.
13+
* Deprecated `FileLoaderLoadException`, use `LoaderLoadException` instead.
1314

1415
Console
1516
-------

UPGRADE-5.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Config
1212
* Dropped support for constructing a `TreeBuilder` without passing root node information.
1313
* Added the `getChildNodeDefinitions()` method to `ParentNodeDefinitionInterface`.
1414
* The `Processor` class has been made final
15+
* Removed `FileLoaderLoadException`, use `LoaderLoadException` instead.
1516

1617
Console
1718
-------

src/Symfony/Bundle/FrameworkBundle/Routing/DelegatingLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Routing;
1313

1414
use Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser;
15-
use Symfony\Component\Config\Exception\FileLoaderLoadException;
15+
use Symfony\Component\Config\Exception\LoaderLoadException;
1616
use Symfony\Component\Config\Loader\DelegatingLoader as BaseDelegatingLoader;
1717
use Symfony\Component\Config\Loader\LoaderResolverInterface;
1818

@@ -64,7 +64,7 @@ public function load($resource, $type = null)
6464
// - this handles the case and prevents the second fatal error
6565
// by triggering an exception beforehand.
6666

67-
throw new FileLoaderLoadException($resource, null, null, null, $type);
67+
throw new LoaderLoadException($resource, null, null, null, $type);
6868
}
6969
$this->loading = true;
7070

src/Symfony/Component/Config/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
-----
66

77
* deprecated constructing a `TreeBuilder` without passing root node information
8+
* renamed `FileLoaderLoadException` to `LoaderLoadException`
89

910
4.1.0
1011
-----

src/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @author Fabien Potencier <fabien@symfony.com>
1818
*/
19-
class FileLoaderImportCircularReferenceException extends FileLoaderLoadException
19+
class FileLoaderImportCircularReferenceException extends LoaderLoadException
2020
{
2121
public function __construct(array $resources, int $code = null, \Exception $previous = null)
2222
{

src/Symfony/Component/Config/Exception/FileLoaderLoadException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* Exception class for when a resource cannot be loaded or imported.
1616
*
1717
* @author Ryan Weaver <ryan@thatsquality.com>
18+
*
19+
* @deprecated since Symfony 4.2, use LoaderLoadException instead.
1820
*/
1921
class FileLoaderLoadException extends \Exception
2022
{
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Config\Exception;
13+
14+
/**
15+
* Exception class for when a resource cannot be loaded or imported.
16+
*
17+
* @author Ryan Weaver <ryan@thatsquality.com>
18+
*/
19+
class LoaderLoadException extends FileLoaderLoadException
20+
{
21+
}

src/Symfony/Component/Config/Loader/DelegatingLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Config\Loader;
1313

14-
use Symfony\Component\Config\Exception\FileLoaderLoadException;
14+
use Symfony\Component\Config\Exception\LoaderLoadException;
1515

1616
/**
1717
* DelegatingLoader delegates loading to other loaders using a loader resolver.
@@ -34,7 +34,7 @@ public function __construct(LoaderResolverInterface $resolver)
3434
public function load($resource, $type = null)
3535
{
3636
if (false === $loader = $this->resolver->resolve($resource, $type)) {
37-
throw new FileLoaderLoadException($resource, null, null, null, $type);
37+
throw new LoaderLoadException($resource, null, null, null, $type);
3838
}
3939

4040
return $loader->load($resource, $type);

src/Symfony/Component/Config/Loader/FileLoader.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
namespace Symfony\Component\Config\Loader;
1313

1414
use Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException;
15-
use Symfony\Component\Config\Exception\FileLoaderLoadException;
1615
use Symfony\Component\Config\Exception\FileLocatorFileNotFoundException;
16+
use Symfony\Component\Config\Exception\LoaderLoadException;
1717
use Symfony\Component\Config\FileLocatorInterface;
1818
use Symfony\Component\Config\Resource\FileExistenceResource;
1919
use Symfony\Component\Config\Resource\GlobResource;
@@ -66,7 +66,7 @@ public function getLocator()
6666
*
6767
* @return mixed
6868
*
69-
* @throws FileLoaderLoadException
69+
* @throws LoaderLoadException
7070
* @throws FileLoaderImportCircularReferenceException
7171
* @throws FileLocatorFileNotFoundException
7272
*/
@@ -161,11 +161,11 @@ private function doImport($resource, $type = null, bool $ignoreErrors = false, $
161161
} catch (\Exception $e) {
162162
if (!$ignoreErrors) {
163163
// prevent embedded imports from nesting multiple exceptions
164-
if ($e instanceof FileLoaderLoadException) {
164+
if ($e instanceof LoaderLoadException) {
165165
throw $e;
166166
}
167167

168-
throw new FileLoaderLoadException($resource, $sourceResource, null, $e, $type);
168+
throw new LoaderLoadException($resource, $sourceResource, null, $e, $type);
169169
}
170170
}
171171
}

src/Symfony/Component/Config/Loader/Loader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Config\Loader;
1313

14-
use Symfony\Component\Config\Exception\FileLoaderLoadException;
14+
use Symfony\Component\Config\Exception\LoaderLoadException;
1515

1616
/**
1717
* Loader is the abstract class used by all built-in loaders.
@@ -59,7 +59,7 @@ public function import($resource, $type = null)
5959
*
6060
* @return $this|LoaderInterface
6161
*
62-
* @throws FileLoaderLoadException If no loader is found
62+
* @throws LoaderLoadException If no loader is found
6363
*/
6464
public function resolve($resource, $type = null)
6565
{
@@ -70,7 +70,7 @@ public function resolve($resource, $type = null)
7070
$loader = null === $this->resolver ? false : $this->resolver->resolve($resource, $type);
7171

7272
if (false === $loader) {
73-
throw new FileLoaderLoadException($resource, null, null, null, $type);
73+
throw new LoaderLoadException($resource, null, null, null, $type);
7474
}
7575

7676
return $loader;

0 commit comments

Comments
 (0)