mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-02 06:58:49 +02:00
N°8017 - Security - dependabot - Symfony's VarDumper vulnerable to un… (#731)
Upgrade all Symfony components to last security fix (~6.4.0)
This commit is contained in:
@@ -25,9 +25,9 @@ class AutowireCallable extends Autowire
|
||||
* @param bool|class-string $lazy Whether to use lazy-loading for this argument
|
||||
*/
|
||||
public function __construct(
|
||||
string|array $callable = null,
|
||||
string $service = null,
|
||||
string $method = null,
|
||||
string|array|null $callable = null,
|
||||
?string $service = null,
|
||||
?string $method = null,
|
||||
bool|string $lazy = false,
|
||||
) {
|
||||
if (!(null !== $callable xor null !== $service)) {
|
||||
@@ -42,7 +42,7 @@ class AutowireCallable extends Autowire
|
||||
|
||||
public function buildDefinition(mixed $value, ?string $type, \ReflectionParameter $parameter): Definition
|
||||
{
|
||||
return (new Definition($type = \is_string($this->lazy) ? $this->lazy : ($type ?: 'Closure')))
|
||||
return (new Definition($type = \is_array($this->lazy) ? current($this->lazy) : ($type ?: 'Closure')))
|
||||
->setFactory(['Closure', 'fromCallable'])
|
||||
->setArguments([\is_array($value) ? $value + [1 => '__invoke'] : $value])
|
||||
->setLazy($this->lazy || 'Closure' !== $type && 'callable' !== (string) $parameter->getType());
|
||||
|
||||
Reference in New Issue
Block a user