This commit is contained in:
Nicolas Grekas 2020-06-18 21:50:30 +02:00
parent 03b9ff177d
commit d2efe50eee
1 changed files with 2 additions and 1 deletions

View File

@ -23,7 +23,8 @@ class InvalidParameterTypeException extends InvalidArgumentException
{
$acceptedType = $parameter->getType();
$acceptedType = $acceptedType instanceof \ReflectionNamedType ? $acceptedType->getName() : (string) $acceptedType;
$this->code = $type;
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);
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));
}
}