Augmentation vers version 3.3.0
This commit is contained in:
@@ -23,8 +23,9 @@ class FileLoaderLoadException extends \Exception
|
||||
* @param string $sourceResource The original resource importing the new resource
|
||||
* @param int $code The error code
|
||||
* @param \Exception $previous A previous exception
|
||||
* @param string $type The type of resource
|
||||
*/
|
||||
public function __construct($resource, $sourceResource = null, $code = null, $previous = null)
|
||||
public function __construct($resource, $sourceResource = null, $code = null, $previous = null, $type = null)
|
||||
{
|
||||
$message = '';
|
||||
if ($previous) {
|
||||
@@ -60,6 +61,13 @@ class FileLoaderLoadException extends \Exception
|
||||
$bundle = substr($parts[0], 1);
|
||||
$message .= sprintf(' Make sure the "%s" bundle is correctly registered and loaded in the application kernel class.', $bundle);
|
||||
$message .= sprintf(' If the bundle is registered, make sure the bundle path "%s" is not empty.', $resource);
|
||||
} elseif (null !== $type) {
|
||||
// maybe there is no loader for this specific type
|
||||
if ('annotation' === $type) {
|
||||
$message .= ' Make sure annotations are installed and enabled.';
|
||||
} else {
|
||||
$message .= sprintf(' Make sure there is a loader supporting the "%s" type.', $type);
|
||||
}
|
||||
}
|
||||
|
||||
parent::__construct($message, $code, $previous);
|
||||
@@ -72,7 +80,7 @@ class FileLoaderLoadException extends \Exception
|
||||
}
|
||||
|
||||
if (\is_array($var)) {
|
||||
$a = array();
|
||||
$a = [];
|
||||
foreach ($var as $k => $v) {
|
||||
$a[] = sprintf('%s => %s', $k, $this->varToString($v));
|
||||
}
|
||||
|
||||
34
vendor/symfony/config/Exception/FileLocatorFileNotFoundException.php
vendored
Normal file
34
vendor/symfony/config/Exception/FileLocatorFileNotFoundException.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* File locator exception if a file does not exist.
|
||||
*
|
||||
* @author Leo Feyer <https://github.com/leofeyer>
|
||||
*/
|
||||
class FileLocatorFileNotFoundException extends \InvalidArgumentException
|
||||
{
|
||||
private $paths;
|
||||
|
||||
public function __construct($message = '', $code = 0, $previous = null, array $paths = [])
|
||||
{
|
||||
parent::__construct($message, $code, $previous);
|
||||
|
||||
$this->paths = $paths;
|
||||
}
|
||||
|
||||
public function getPaths()
|
||||
{
|
||||
return $this->paths;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user