diff --git a/.travis.yml b/.travis.yml index f2564bf..7e6be1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ matrix: - php: 7.2 env: deps=lowest - php: 7.3 + - php: 7.4 install: - if [ -z "$deps" ]; then composer install; fi; diff --git a/src/ReflectionMethod.php b/src/ReflectionMethod.php index f9c7779..100a644 100644 --- a/src/ReflectionMethod.php +++ b/src/ReflectionMethod.php @@ -75,7 +75,7 @@ public function getReturnType() if ($type = $this->method->getReturnType()) { // Self is not valid when used in different places. - if ('self' === $type->__toString()) { + if ('self' === $type->getName()) { return null; } diff --git a/src/ReflectionType.php b/src/ReflectionType.php index 4bc136b..4b7cb8b 100644 --- a/src/ReflectionType.php +++ b/src/ReflectionType.php @@ -15,7 +15,7 @@ public function __construct(\ReflectionType $type) public function getName() { - $name = (string) $this->type; + $name = $this->type->getName(); // Some types can not be qualified if (in_array($name, self::NON_QUALIFIED_TYPES, true)) {