mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 14:38:47 +02:00
N°6934 - Symfony 6.4 - upgrade Symfony bundles to 6.4 (#580)
* Update Symfony lib to version ~6.4.0 * Update code missing return type * Add an iTop general configuration entry to store application secret (Symfony mandatory parameter) * Use dependency injection in ExceptionListener & UserProvider classes
This commit is contained in:
@@ -13,17 +13,16 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator\Traits;
|
||||
|
||||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ReferenceConfigurator;
|
||||
use Symfony\Component\ExpressionLanguage\Expression;
|
||||
|
||||
trait FactoryTrait
|
||||
{
|
||||
/**
|
||||
* Sets a factory.
|
||||
*
|
||||
* @param string|array|ReferenceConfigurator $factory A PHP callable reference
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
final public function factory($factory): self
|
||||
final public function factory(string|array|ReferenceConfigurator|Expression $factory): static
|
||||
{
|
||||
if (\is_string($factory) && 1 === substr_count($factory, ':')) {
|
||||
$factoryParts = explode(':', $factory);
|
||||
@@ -31,6 +30,10 @@ trait FactoryTrait
|
||||
throw new InvalidArgumentException(sprintf('Invalid factory "%s": the "service:method" notation is not available when using PHP-based DI configuration. Use "[service(\'%s\'), \'%s\']" instead.', $factory, $factoryParts[0], $factoryParts[1]));
|
||||
}
|
||||
|
||||
if ($factory instanceof Expression) {
|
||||
$factory = '@='.$factory;
|
||||
}
|
||||
|
||||
$this->definition->setFactory(static::processValue($factory, true));
|
||||
|
||||
return $this;
|
||||
|
||||
Reference in New Issue
Block a user