mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 11:38:44 +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:
@@ -12,6 +12,7 @@
|
||||
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Loader\ParamConfigurator;
|
||||
use Symfony\Component\DependencyInjection\Alias;
|
||||
use Symfony\Component\DependencyInjection\Argument\AbstractArgument;
|
||||
use Symfony\Component\DependencyInjection\Argument\ArgumentInterface;
|
||||
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
|
||||
@@ -26,13 +27,16 @@ abstract class AbstractConfigurator
|
||||
public const FACTORY = 'unknown';
|
||||
|
||||
/**
|
||||
* @var callable(mixed, bool)|null
|
||||
* @var \Closure(mixed, bool):mixed|null
|
||||
*/
|
||||
public static $valuePreProcessor;
|
||||
|
||||
/** @internal */
|
||||
protected $definition;
|
||||
protected Definition|Alias|null $definition = null;
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function __call(string $method, array $args)
|
||||
{
|
||||
if (method_exists($this, 'set'.$method)) {
|
||||
@@ -42,14 +46,14 @@ abstract class AbstractConfigurator
|
||||
throw new \BadMethodCallException(sprintf('Call to undefined method "%s::%s()".', static::class, $method));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function __sleep()
|
||||
public function __sleep(): array
|
||||
{
|
||||
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function __wakeup()
|
||||
{
|
||||
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
|
||||
@@ -58,12 +62,11 @@ abstract class AbstractConfigurator
|
||||
/**
|
||||
* Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @param bool $allowServices whether Definition and Reference are allowed; by default, only scalars and arrays are
|
||||
* @param bool $allowServices whether Definition and Reference are allowed; by default, only scalars, arrays and enum are
|
||||
*
|
||||
* @return mixed the value, optionally cast to a Definition/Reference
|
||||
*/
|
||||
public static function processValue($value, $allowServices = false)
|
||||
public static function processValue(mixed $value, bool $allowServices = false): mixed
|
||||
{
|
||||
if (\is_array($value)) {
|
||||
foreach ($value as $k => $v) {
|
||||
@@ -101,6 +104,7 @@ abstract class AbstractConfigurator
|
||||
switch (true) {
|
||||
case null === $value:
|
||||
case \is_scalar($value):
|
||||
case $value instanceof \UnitEnum:
|
||||
return $value;
|
||||
|
||||
case $value instanceof ArgumentInterface:
|
||||
|
||||
Reference in New Issue
Block a user