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;
|
||||
}
|
||||
|
||||
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
|
||||
$this->nested[$option][] = $value;
|
||||
$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)
|
||||
{
|
||||
try {
|
||||
if (\PHP_VERSION_ID < 70100 && null !== $parameterClass = $parameter->getClass()) {
|
||||
$parameterClass = $parameterClass->name;
|
||||
} elseif (\PHP_VERSION_ID >= 70100 && $parameter->hasType() && ($parameterType = $parameter->getType()) && !$parameterType->isBuiltin()) {
|
||||
if ($parameter->hasType() && ($parameterType = $parameter->getType()) && !$parameterType->isBuiltin()) {
|
||||
$parameterClass = $parameterType->getName();
|
||||
new \ReflectionClass($parameterClass); // throws a \ReflectionException if the class doesn't exist
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user