Skip to content

Commit cc4dce0

Browse files
authored
Merge pull request #3 from jdecool/phpstan-010-compatibility
Add phpstan 0.10 compatibility
2 parents 13cb281 + 823c58c commit cc4dce0

File tree

3 files changed

+9
-20
lines changed

3 files changed

+9
-20
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
language: php
33

44
php:
5-
- "7.0"
65
- "7.1"
6+
- "7.2"
77
- nightly
88

99
env:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "MIT",
66
"require": {
77
"myclabs/php-enum": "^1.2",
8-
"phpstan/phpstan": "^0.6 || ^0.7 || ^0.8 || ^0.9"
8+
"phpstan/phpstan": "^0.10"
99
},
1010
"require-dev": {
1111
"phpunit/phpunit": "^6.0"

src/Reflection/EnumMethodReflection.php

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44

55
namespace Timeweb\PHPStan\Reflection;
66

7+
use PHPStan\Reflection\ClassMemberReflection;
78
use PHPStan\Reflection\ClassReflection;
89
use PHPStan\Reflection\MethodReflection;
9-
use PHPStan\Type\ObjectType;
10-
use PHPStan\Type\Type;
1110

1211
class EnumMethodReflection implements MethodReflection
1312
{
@@ -32,21 +31,6 @@ public function getName(): string
3231
return $this->name;
3332
}
3433

35-
public function getParameters(): array
36-
{
37-
return [];
38-
}
39-
40-
public function isVariadic(): bool
41-
{
42-
return false;
43-
}
44-
45-
public function getReturnType(): Type
46-
{
47-
return new ObjectType($this->classReflection->getName(), false);
48-
}
49-
5034
public function getDeclaringClass(): ClassReflection
5135
{
5236
return $this->classReflection;
@@ -67,8 +51,13 @@ public function isPublic(): bool
6751
return true;
6852
}
6953

70-
public function getPrototype(): MethodReflection
54+
public function getPrototype(): ClassMemberReflection
7155
{
7256
return $this;
7357
}
58+
59+
public function getVariants(): array
60+
{
61+
return [];
62+
}
7463
}

0 commit comments

Comments
 (0)