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 list<ExtendedParametersAcceptor>
27: */
28: public function getVariants(): array;
29:
30: /**
31: * @internal
32: */
33: public function getOnlyVariant(): ExtendedParametersAcceptor;
34:
35: /**
36: * @return list<ExtendedParametersAcceptor>|null
37: */
38: public function getNamedArgumentsVariants(): ?array;
39:
40: public function acceptsNamedArguments(): TrinaryLogic;
41:
42: public function getAsserts(): Assertions;
43:
44: public function getSelfOutType(): ?Type;
45:
46: public function returnsByReference(): TrinaryLogic;
47:
48: public function isFinalByKeyword(): TrinaryLogic;
49:
50: public function isAbstract(): TrinaryLogic|bool;
51:
52: /**
53: * This indicates whether the method has phpstan-pure
54: * or phpstan-impure annotation above it.
55: *
56: * In most cases asking hasSideEffects() is much more practical
57: * as it also accounts for void return type (method being always impure).
58: */
59: public function isPure(): TrinaryLogic;
60:
61: }
62: