1111use PHPStan \Analyser \NodeCallbackInvoker ;
1212use PHPStan \Analyser \Scope ;
1313use PHPStan \Php \PhpVersions ;
14+ use PHPStan \Reflection \Assertions ;
1415use PHPStan \Reflection \ClassConstantReflection ;
1516use PHPStan \Reflection \ClassReflection ;
1617use PHPStan \Reflection \ExtendedMethodReflection ;
2122use PHPStan \ShouldNotHappenException ;
2223use PHPStan \TrinaryLogic ;
2324use PHPStan \Type \ClosureType ;
25+ use PHPStan \Type \Generic \TemplateTypeMap ;
2426use PHPStan \Type \Type ;
2527use PHPStan \Type \TypeWithClassName ;
2628
@@ -47,6 +49,55 @@ public function assignVariable(string $variableName, Type $type): self
4749 return new self ($ expressionTypes );
4850 }
4951
52+ public function enterNamespace (string $ namespaceName ): self
53+ {
54+ // TODO: Implement enterNamespace() method.
55+ throw new ShouldNotHappenException ('Not implemented yet ' );
56+ }
57+
58+ public function enterClass (ClassReflection $ classReflection ): self
59+ {
60+ // TODO: Implement enterClass() method.
61+ throw new ShouldNotHappenException ('Not implemented yet ' );
62+ }
63+
64+ /**
65+ * @param Type[] $phpDocParameterTypes
66+ * @param Type[] $parameterOutTypes
67+ * @param array<string, bool> $immediatelyInvokedCallableParameters
68+ * @param array<string, Type> $phpDocClosureThisTypeParameters
69+ */
70+ public function enterClassMethod (
71+ Node \Stmt \ClassMethod $ classMethod ,
72+ TemplateTypeMap $ templateTypeMap ,
73+ array $ phpDocParameterTypes ,
74+ ?Type $ phpDocReturnType ,
75+ ?Type $ throwType ,
76+ ?string $ deprecatedDescription ,
77+ bool $ isDeprecated ,
78+ bool $ isInternal ,
79+ bool $ isFinal ,
80+ ?bool $ isPure = null ,
81+ bool $ acceptsNamedArguments = true ,
82+ ?Assertions $ asserts = null ,
83+ ?Type $ selfOutType = null ,
84+ ?string $ phpDocComment = null ,
85+ array $ parameterOutTypes = [],
86+ array $ immediatelyInvokedCallableParameters = [],
87+ array $ phpDocClosureThisTypeParameters = [],
88+ bool $ isConstructor = false ,
89+ ): self
90+ {
91+ // TODO: Implement enterClassMethod() method.
92+ throw new ShouldNotHappenException ('Not implemented yet ' );
93+ }
94+
95+ public function generalizeWith (self $ otherScope ): self
96+ {
97+ // TODO: Implement generalizeWith() method.
98+ throw new ShouldNotHappenException ('Not implemented yet ' );
99+ }
100+
50101 public function isInClass (): bool
51102 {
52103 // TODO: Implement isInClass() method.
@@ -98,13 +149,13 @@ public function getNamespace(): ?string
98149 public function getFile (): string
99150 {
100151 // TODO: Implement getFile() method.
101- throw new ShouldNotHappenException ( ' Not implemented yet ' ) ;
152+ return ' foo.php ' ;
102153 }
103154
104155 public function getFileDescription (): string
105156 {
106157 // TODO: Implement getFileDescription() method.
107- throw new ShouldNotHappenException ( ' Not implemented yet ' ) ;
158+ return ' foo.php ' ;
108159 }
109160
110161 public function isDeclareStrictTypes (): bool
@@ -116,7 +167,7 @@ public function isDeclareStrictTypes(): bool
116167 public function isInTrait (): bool
117168 {
118169 // TODO: Implement isInTrait() method.
119- throw new ShouldNotHappenException ( ' Not implemented yet ' ) ;
170+ return false ;
120171 }
121172
122173 public function getTraitReflection (): ?ClassReflection
@@ -200,7 +251,7 @@ public function getStaticPropertyReflection(Type $typeWithProperty, string $prop
200251 public function getMethodReflection (Type $ typeWithMethod , string $ methodName ): ?ExtendedMethodReflection
201252 {
202253 // TODO: Implement getMethodReflection() method.
203- throw new ShouldNotHappenException ( ' Not implemented yet ' ) ;
254+ return null ;
204255 }
205256
206257 public function getConstantReflection (Type $ typeWithConstant , string $ constantName ): ?ClassConstantReflection
0 commit comments