Skip to content

Commit

Permalink
PHP 7.4 ReflectionType deprecation fixes (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
janlam7 authored Oct 22, 2020
1 parent ab139fe commit 918ae55
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/ReflectionMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/ReflectionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 918ae55

Please sign in to comment.