| 1: | <?php declare(strict_types = 1); |
| 2: | |
| 3: | namespace PHPStan\Reflection; |
| 4: | |
| 5: | use PHPStan\TrinaryLogic; |
| 6: | use PHPStan\Type\Type; |
| 7: | |
| 8: | /** |
| 9: | * The purpose of this interface is to be able to |
| 10: | * answer more questions about methods |
| 11: | * without breaking backward compatibility |
| 12: | * with existing MethodsClassReflectionExtension. |
| 13: | * |
| 14: | * Developers are meant to only implement MethodReflection |
| 15: | * and its methods in their code. |
| 16: | * |
| 17: | * New methods on ExtendedMethodReflection will be added |
| 18: | * in minor versions. |
| 19: | * |
| 20: | * @api |
| 21: | */ |
| 22: | interface ExtendedMethodReflection extends MethodReflection |
| 23: | { |
| 24: | |
| 25: | /** |
| 26: | * @return ParametersAcceptorWithPhpDocs[] |
| 27: | */ |
| 28: | public function getVariants(): array; |
| 29: | |
| 30: | /** |
| 31: | * @return ParametersAcceptorWithPhpDocs[]|null |
| 32: | */ |
| 33: | public function getNamedArgumentsVariants(): ?array; |
| 34: | |
| 35: | public function acceptsNamedArguments(): bool; |
| 36: | |
| 37: | public function getAsserts(): Assertions; |
| 38: | |
| 39: | public function getSelfOutType(): ?Type; |
| 40: | |
| 41: | public function returnsByReference(): TrinaryLogic; |
| 42: | |
| 43: | public function isFinalByKeyword(): TrinaryLogic; |
| 44: | |
| 45: | public function isAbstract(): TrinaryLogic|bool; |
| 46: | |
| 47: | /** |
| 48: | * This indicates whether the method has phpstan-pure |
| 49: | * or phpstan-impure annotation above it. |
| 50: | * |
| 51: | * In most cases asking hasSideEffects() is much more practical |
| 52: | * as it also accounts for void return type (method being always impure). |
| 53: | */ |
| 54: | public function isPure(): TrinaryLogic; |
| 55: | |
| 56: | } |
| 57: |