Skip to content

Commit 918ae55

Browse files
authored
PHP 7.4 ReflectionType deprecation fixes (#65)
1 parent ab139fe commit 918ae55

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ matrix:
66
- php: 7.2
77
env: deps=lowest
88
- php: 7.3
9+
- php: 7.4
910

1011
install:
1112
- if [ -z "$deps" ]; then composer install; fi;

src/ReflectionMethod.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function getReturnType()
7575

7676
if ($type = $this->method->getReturnType()) {
7777
// Self is not valid when used in different places.
78-
if ('self' === $type->__toString()) {
78+
if ('self' === $type->getName()) {
7979
return null;
8080
}
8181

src/ReflectionType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function __construct(\ReflectionType $type)
1515

1616
public function getName()
1717
{
18-
$name = (string) $this->type;
18+
$name = $this->type->getName();
1919

2020
// Some types can not be qualified
2121
if (in_array($name, self::NON_QUALIFIED_TYPES, true)) {

0 commit comments

Comments
 (0)