mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-28 21:18:46 +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:
@@ -22,19 +22,21 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||
*/
|
||||
final class AttributeAutoconfigurationPass extends AbstractRecursivePass
|
||||
{
|
||||
private $classAttributeConfigurators = [];
|
||||
private $methodAttributeConfigurators = [];
|
||||
private $propertyAttributeConfigurators = [];
|
||||
private $parameterAttributeConfigurators = [];
|
||||
protected bool $skipScalars = true;
|
||||
|
||||
private array $classAttributeConfigurators = [];
|
||||
private array $methodAttributeConfigurators = [];
|
||||
private array $propertyAttributeConfigurators = [];
|
||||
private array $parameterAttributeConfigurators = [];
|
||||
|
||||
public function process(ContainerBuilder $container): void
|
||||
{
|
||||
if (80000 > \PHP_VERSION_ID || !$container->getAutoconfiguredAttributes()) {
|
||||
if (!$container->getAutoconfiguredAttributes()) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($container->getAutoconfiguredAttributes() as $attributeName => $callable) {
|
||||
$callableReflector = new \ReflectionFunction(\Closure::fromCallable($callable));
|
||||
$callableReflector = new \ReflectionFunction($callable(...));
|
||||
if ($callableReflector->getNumberOfParameters() <= 2) {
|
||||
$this->classAttributeConfigurators[$attributeName] = $callable;
|
||||
continue;
|
||||
@@ -55,7 +57,7 @@ final class AttributeAutoconfigurationPass extends AbstractRecursivePass
|
||||
|
||||
try {
|
||||
$attributeReflector = new \ReflectionClass($attributeName);
|
||||
} catch (\ReflectionException $e) {
|
||||
} catch (\ReflectionException) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -78,7 +80,7 @@ final class AttributeAutoconfigurationPass extends AbstractRecursivePass
|
||||
parent::process($container);
|
||||
}
|
||||
|
||||
protected function processValue($value, bool $isRoot = false)
|
||||
protected function processValue(mixed $value, bool $isRoot = false): mixed
|
||||
{
|
||||
if (!$value instanceof Definition
|
||||
|| !$value->isAutoconfigured()
|
||||
@@ -103,7 +105,7 @@ final class AttributeAutoconfigurationPass extends AbstractRecursivePass
|
||||
if ($this->parameterAttributeConfigurators) {
|
||||
try {
|
||||
$constructorReflector = $this->getConstructor($value, false);
|
||||
} catch (RuntimeException $e) {
|
||||
} catch (RuntimeException) {
|
||||
$constructorReflector = null;
|
||||
}
|
||||
|
||||
@@ -120,7 +122,7 @@ final class AttributeAutoconfigurationPass extends AbstractRecursivePass
|
||||
|
||||
if ($this->methodAttributeConfigurators || $this->parameterAttributeConfigurators) {
|
||||
foreach ($classReflector->getMethods(\ReflectionMethod::IS_PUBLIC) as $methodReflector) {
|
||||
if ($methodReflector->isStatic() || $methodReflector->isConstructor() || $methodReflector->isDestructor()) {
|
||||
if ($methodReflector->isConstructor() || $methodReflector->isDestructor()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user