1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Node;
4:
5: use Override;
6: use PhpParser\Node\Stmt\ClassLike;
7: use PhpParser\NodeAbstract;
8: use PHPStan\Node\Method\MethodCall;
9: use PHPStan\Reflection\ClassReflection;
10:
11: /**
12: * @api
13: */
14: final class ClassMethodsNode extends NodeAbstract implements VirtualNode
15: {
16:
17: /**
18: * @param ClassMethod[] $methods
19: * @param array<int, MethodCall> $methodCalls
20: */
21: public function __construct(private ClassLike $class, private array $methods, private array $methodCalls, private ClassReflection $classReflection)
22: {
23: parent::__construct($class->getAttributes());
24: }
25:
26: public function getClass(): ClassLike
27: {
28: return $this->class;
29: }
30:
31: /**
32: * @return ClassMethod[]
33: */
34: public function getMethods(): array
35: {
36: return $this->methods;
37: }
38:
39: /**
40: * @return array<int, MethodCall>
41: */
42: public function getMethodCalls(): array
43: {
44: return $this->methodCalls;
45: }
46:
47: #[Override]
48: public function getType(): string
49: {
50: return 'PHPStan_Node_ClassMethodsNode';
51: }
52:
53: /**
54: * @return string[]
55: */
56: #[Override]
57: public function getSubNodeNames(): array
58: {
59: return [];
60: }
61:
62: public function getClassReflection(): ClassReflection
63: {
64: return $this->classReflection;
65: }
66:
67: }
68: