From 790f67f1286beb3bd63f77fae9e0f440c13d5852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81my=20DECOOL?= Date: Thu, 2 Aug 2018 23:54:16 +0200 Subject: [PATCH 1/2] Add phpstan 0.10 compatibility --- composer.json | 2 +- src/Reflection/EnumMethodReflection.php | 25 +++++++------------------ 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/composer.json b/composer.json index 69270f1..ba9b734 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "license": "MIT", "require": { "myclabs/php-enum": "^1.2", - "phpstan/phpstan": "^0.6 || ^0.7 || ^0.8 || ^0.9" + "phpstan/phpstan": "^0.10" }, "require-dev": { "phpunit/phpunit": "^6.0" diff --git a/src/Reflection/EnumMethodReflection.php b/src/Reflection/EnumMethodReflection.php index 2006437..34dbbc8 100644 --- a/src/Reflection/EnumMethodReflection.php +++ b/src/Reflection/EnumMethodReflection.php @@ -4,10 +4,9 @@ namespace Timeweb\PHPStan\Reflection; +use PHPStan\Reflection\ClassMemberReflection; use PHPStan\Reflection\ClassReflection; use PHPStan\Reflection\MethodReflection; -use PHPStan\Type\ObjectType; -use PHPStan\Type\Type; class EnumMethodReflection implements MethodReflection { @@ -32,21 +31,6 @@ public function getName(): string return $this->name; } - public function getParameters(): array - { - return []; - } - - public function isVariadic(): bool - { - return false; - } - - public function getReturnType(): Type - { - return new ObjectType($this->classReflection->getName(), false); - } - public function getDeclaringClass(): ClassReflection { return $this->classReflection; @@ -67,8 +51,13 @@ public function isPublic(): bool return true; } - public function getPrototype(): MethodReflection + public function getPrototype(): ClassMemberReflection { return $this; } + + public function getVariants(): array + { + return []; + } } From 823c58cb42d2211efb5487ec5a7ec24116db1536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81my=20DECOOL?= Date: Fri, 3 Aug 2018 00:34:35 +0200 Subject: [PATCH 2/2] Remove PHP 7.0 from Travis matrix (phpstan incompatibility) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fbb68c6..fa4a63d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,8 @@ language: php php: - - "7.0" - "7.1" + - "7.2" - nightly env: