mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°5809 Update Symfony artifacts from 6.4.0 to 6.4.2
symfony/console symfony/dotenv symfony/framework-bundle symfony/http-foundation symfony/http-kernel symfony/var-dumper symfony/web-profiler-bundle
This commit is contained in:
@@ -454,20 +454,30 @@ class AutowirePass extends AbstractRecursivePass
|
||||
$name = $target = (array_filter($reference->getAttributes(), static fn ($a) => $a instanceof Target)[0] ?? null)?->name;
|
||||
|
||||
if (null !== $name ??= $reference->getName()) {
|
||||
if ($this->container->has($alias = $type.' $'.$name) && !$this->container->findDefinition($alias)->isAbstract()) {
|
||||
return new TypedReference($alias, $type, $reference->getInvalidBehavior());
|
||||
}
|
||||
|
||||
if (null !== ($alias = $this->getCombinedAlias($type, $name)) && !$this->container->findDefinition($alias)->isAbstract()) {
|
||||
return new TypedReference($alias, $type, $reference->getInvalidBehavior());
|
||||
}
|
||||
|
||||
$parsedName = (new Target($name))->getParsedName();
|
||||
|
||||
if ($this->container->has($alias = $type.' $'.$parsedName) && !$this->container->findDefinition($alias)->isAbstract()) {
|
||||
return new TypedReference($alias, $type, $reference->getInvalidBehavior());
|
||||
}
|
||||
|
||||
if (null !== ($alias = $this->getCombinedAlias($type, $parsedName) ?? null) && !$this->container->findDefinition($alias)->isAbstract()) {
|
||||
if (null !== ($alias = $this->getCombinedAlias($type, $parsedName)) && !$this->container->findDefinition($alias)->isAbstract()) {
|
||||
return new TypedReference($alias, $type, $reference->getInvalidBehavior());
|
||||
}
|
||||
|
||||
if ($this->container->has($name) && !$this->container->findDefinition($name)->isAbstract()) {
|
||||
if (($this->container->has($n = $name) && !$this->container->findDefinition($n)->isAbstract())
|
||||
|| ($this->container->has($n = $parsedName) && !$this->container->findDefinition($n)->isAbstract())
|
||||
) {
|
||||
foreach ($this->container->getAliases() as $id => $alias) {
|
||||
if ($name === (string) $alias && str_starts_with($id, $type.' $')) {
|
||||
return new TypedReference($name, $type, $reference->getInvalidBehavior());
|
||||
if ($n === (string) $alias && str_starts_with($id, $type.' $')) {
|
||||
return new TypedReference($n, $type, $reference->getInvalidBehavior());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -481,7 +491,7 @@ class AutowirePass extends AbstractRecursivePass
|
||||
return new TypedReference($type, $type, $reference->getInvalidBehavior());
|
||||
}
|
||||
|
||||
if (null !== ($alias = $this->getCombinedAlias($type) ?? null) && !$this->container->findDefinition($alias)->isAbstract()) {
|
||||
if (null !== ($alias = $this->getCombinedAlias($type)) && !$this->container->findDefinition($alias)->isAbstract()) {
|
||||
return new TypedReference($alias, $type, $reference->getInvalidBehavior());
|
||||
}
|
||||
|
||||
|
||||
@@ -190,16 +190,19 @@ class ResolveBindingsPass extends AbstractRecursivePass
|
||||
|
||||
$typeHint = ltrim(ProxyHelper::exportType($parameter) ?? '', '?');
|
||||
|
||||
$name = Target::parseName($parameter);
|
||||
$name = Target::parseName($parameter, parsedName: $parsedName);
|
||||
|
||||
if ($typeHint && \array_key_exists($k = preg_replace('/(^|[(|&])\\\\/', '\1', $typeHint).' $'.$name, $bindings)) {
|
||||
if ($typeHint && (
|
||||
\array_key_exists($k = preg_replace('/(^|[(|&])\\\\/', '\1', $typeHint).' $'.$name, $bindings)
|
||||
|| \array_key_exists($k = preg_replace('/(^|[(|&])\\\\/', '\1', $typeHint).' $'.$parsedName, $bindings)
|
||||
)) {
|
||||
$arguments[$key] = $this->getBindingValue($bindings[$k]);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (\array_key_exists('$'.$name, $bindings)) {
|
||||
$arguments[$key] = $this->getBindingValue($bindings['$'.$name]);
|
||||
if (\array_key_exists($k = '$'.$name, $bindings) || \array_key_exists($k = '$'.$parsedName, $bindings)) {
|
||||
$arguments[$key] = $this->getBindingValue($bindings[$k]);
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -210,7 +213,7 @@ class ResolveBindingsPass extends AbstractRecursivePass
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isset($bindingNames[$name]) || isset($bindingNames[$parameter->name])) {
|
||||
if (isset($bindingNames[$name]) || isset($bindingNames[$parsedName]) || isset($bindingNames[$parameter->name])) {
|
||||
$bindingKey = array_search($binding, $bindings, true);
|
||||
$argumentType = substr($bindingKey, 0, strpos($bindingKey, ' '));
|
||||
$this->errorMessages[] = sprintf('Did you forget to add the type "%s" to argument "$%s" of method "%s::%s()"?', $argumentType, $parameter->name, $reflectionMethod->class, $reflectionMethod->name);
|
||||
|
||||
Reference in New Issue
Block a user