Merge branch '5.0' into 5.1
* 5.0: [DI] fix Use "composer/package-versions-deprecated" when possible Fix
This commit is contained in:
commit
eea6abf318
|
@ -107,6 +107,7 @@
|
|||
"async-aws/ses": "^1.0",
|
||||
"async-aws/sqs": "^1.0",
|
||||
"cache/integration-tests": "dev-master",
|
||||
"composer/package-versions-deprecated": "^1.8",
|
||||
"doctrine/annotations": "~1.0",
|
||||
"doctrine/cache": "~1.6",
|
||||
"doctrine/collections": "~1.0",
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
"symfony/service-contracts": "^1.1|^2"
|
||||
},
|
||||
"require-dev": {
|
||||
"composer/package-versions-deprecated": "^1.8",
|
||||
"symfony/stopwatch": "^4.4|^5.0",
|
||||
"symfony/cache": "^5.1",
|
||||
"symfony/config": "^4.4|^5.0",
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,10 +45,10 @@ final class ArgumentMetadataFactory implements ArgumentMetadataFactoryInterface
|
|||
*/
|
||||
private function getType(\ReflectionParameter $parameter, \ReflectionFunctionAbstract $function): ?string
|
||||
{
|
||||
if (!($type = $parameter->getType()) instanceof \ReflectionNamedType) {
|
||||
if (!$type = $parameter->getType()) {
|
||||
return null;
|
||||
}
|
||||
$name = $type->getName();
|
||||
$name = $type instanceof \ReflectionNamedType ? $type->getName() : (string) $type;
|
||||
|
||||
if ($function instanceof \ReflectionMethod) {
|
||||
$lcName = strtolower($name);
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
]
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"version": "2.99",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.1-dev"
|
||||
|
|
Reference in New Issue