Remove calls to deprecated ReflectionParameter::getClass().
This commit is contained in:
parent
a205f4e15c
commit
1575d853f1
@ -201,7 +201,7 @@ class OptionsResolver implements Options
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($params[0]) && null !== ($class = $params[0]->getClass()) && self::class === $class->name && (!isset($params[1]) || (null !== ($class = $params[1]->getClass()) && Options::class === $class->name))) {
|
if (isset($params[0]) && null !== ($type = $params[0]->getType()) && self::class === $type->getName() && (!isset($params[1]) || (null !== ($type = $params[1]->getType()) && Options::class === $type->getName()))) {
|
||||||
// Store closure for later evaluation
|
// Store closure for later evaluation
|
||||||
$this->nested[$option][] = $value;
|
$this->nested[$option][] = $value;
|
||||||
$this->defaults[$option] = [];
|
$this->defaults[$option] = [];
|
||||||
|
@ -522,9 +522,7 @@ abstract class AbstractNormalizer implements NormalizerInterface, DenormalizerIn
|
|||||||
protected function denormalizeParameter(\ReflectionClass $class, \ReflectionParameter $parameter, $parameterName, $parameterData, array $context, $format = null)
|
protected function denormalizeParameter(\ReflectionClass $class, \ReflectionParameter $parameter, $parameterName, $parameterData, array $context, $format = null)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (\PHP_VERSION_ID < 70100 && null !== $parameterClass = $parameter->getClass()) {
|
if ($parameter->hasType() && ($parameterType = $parameter->getType()) && !$parameterType->isBuiltin()) {
|
||||||
$parameterClass = $parameterClass->name;
|
|
||||||
} elseif (\PHP_VERSION_ID >= 70100 && $parameter->hasType() && ($parameterType = $parameter->getType()) && !$parameterType->isBuiltin()) {
|
|
||||||
$parameterClass = $parameterType->getName();
|
$parameterClass = $parameterType->getName();
|
||||||
new \ReflectionClass($parameterClass); // throws a \ReflectionException if the class doesn't exist
|
new \ReflectionClass($parameterClass); // throws a \ReflectionException if the class doesn't exist
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user