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 getAsserts(): Assertions;
36:
37: public function getSelfOutType(): ?Type;
38:
39: public function returnsByReference(): TrinaryLogic;
40:
41: public function isFinalByKeyword(): TrinaryLogic;
42:
43: public function isAbstract(): TrinaryLogic|bool;
44:
45: /**
46: * This indicates whether the method has phpstan-pure
47: * or phpstan-impure annotation above it.
48: *
49: * In most cases asking hasSideEffects() is much more practical
50: * as it also accounts for void return type (method being always impure).
51: */
52: public function isPure(): TrinaryLogic;
53:
54: }
55: