Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
language: php

php:
- "7.0"
- "7.1"
- "7.2"
- nightly

env:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
25 changes: 7 additions & 18 deletions src/Reflection/EnumMethodReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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;
Expand All @@ -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 [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem right - you should return at least a single item. Can be a FunctionVariant instance.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because you have to report the return type of this method: new ObjectType($this->classReflection->getName(), false).

}
}