Skip to content

Commit 363a2d1

Browse files
[DI] fix
1 parent 365f147 commit 363a2d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Exception/InvalidParameterTypeException.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ public function __construct(string $serviceId, string $type, \ReflectionParamete
2323
{
2424
$acceptedType = $parameter->getType();
2525
$acceptedType = $acceptedType instanceof \ReflectionNamedType ? $acceptedType->getName() : (string) $acceptedType;
26+
$this->code = $type;
2627

27-
parent::__construct(sprintf('Invalid definition for service "%s": argument %d of "%s::%s" accepts "%s", "%s" passed.', $serviceId, 1 + $parameter->getPosition(), $parameter->getDeclaringClass()->getName(), $parameter->getDeclaringFunction()->getName(), $acceptedType, $type), $type);
28+
parent::__construct(sprintf('Invalid definition for service "%s": argument %d of "%s::%s" accepts "%s", "%s" passed.', $serviceId, 1 + $parameter->getPosition(), $parameter->getDeclaringClass()->getName(), $parameter->getDeclaringFunction()->getName(), $acceptedType, $type));
2829
}
2930
}

0 commit comments

Comments
 (0)