mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 22:48:45 +02:00
migration symfony 5 4 (#300)
* symfony 5.4 (diff dev) * symfony 5.4 (working) * symfony 5.4 (update autoload) * symfony 5.4 (remove swiftmailer mailer implementation) * symfony 5.4 (php doc and split Global accessor class) ### Impacted packages: composer require php:">=7.2.5 <8.0.0" symfony/console:5.4.* symfony/dotenv:5.4.* symfony/framework-bundle:5.4.* symfony/twig-bundle:5.4.* symfony/yaml:5.4.* --update-with-dependencies composer require symfony/stopwatch:5.4.* symfony/web-profiler-bundle:5.4.* --dev --update-with-dependencies
This commit is contained in:
@@ -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.
|
||||
@@ -21,6 +21,12 @@ use Symfony\Component\Config\Exception\FileLoaderLoadException;
|
||||
abstract class Loader implements LoaderInterface
|
||||
{
|
||||
protected $resolver;
|
||||
protected $env;
|
||||
|
||||
public function __construct(string $env = null)
|
||||
{
|
||||
$this->env = $env;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
@@ -46,7 +52,7 @@ abstract class Loader implements LoaderInterface
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function import($resource, $type = null)
|
||||
public function import($resource, string $type = null)
|
||||
{
|
||||
return $this->resolve($resource, $type)->load($resource, $type);
|
||||
}
|
||||
@@ -57,11 +63,11 @@ abstract class Loader implements LoaderInterface
|
||||
* @param mixed $resource A resource
|
||||
* @param string|null $type The resource type or null if unknown
|
||||
*
|
||||
* @return $this|LoaderInterface
|
||||
* @return LoaderInterface
|
||||
*
|
||||
* @throws FileLoaderLoadException If no loader is found
|
||||
* @throws LoaderLoadException If no loader is found
|
||||
*/
|
||||
public function resolve($resource, $type = null)
|
||||
public function resolve($resource, string $type = null)
|
||||
{
|
||||
if ($this->supports($resource, $type)) {
|
||||
return $this;
|
||||
@@ -70,7 +76,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, 0, null, $type);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
|
||||
Reference in New Issue
Block a user