Assume that getType is available

From PHP7 getType is always available. No need to check it nowdays.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
Daniel Kesselberg 2019-10-12 22:55:07 +02:00
parent ace74ef866
commit 0ecc70c497
No known key found for this signature in database
GPG Key ID: 36E3664E099D0614
1 changed files with 4 additions and 7 deletions

View File

@ -72,13 +72,10 @@ class ControllerMethodReflector implements IControllerMethodReflector {
}
foreach ($reflection->getParameters() as $param) {
// extract type information from PHP 7 scalar types and prefer them
// over phpdoc annotations
if (method_exists($param, 'getType')) {
$type = $param->getType();
if ($type instanceof \ReflectionNamedType) {
$this->types[$param->getName()] = $type->getName();
}
// extract type information from PHP 7 scalar types and prefer them over phpdoc annotations
$type = $param->getType();
if ($type instanceof \ReflectionNamedType) {
$this->types[$param->getName()] = $type->getName();
}
$default = null;