File tree Expand file tree Collapse file tree 2 files changed +5
-20
lines changed Expand file tree Collapse file tree 2 files changed +5
-20
lines changed Original file line number Diff line number Diff line change @@ -252,7 +252,10 @@ public static function createEmpty(): self
252
252
*/
253
253
public function merge (array $ parents , array $ parentPhpDocBlocks ): self
254
254
{
255
- $ classReflection = $ this ->getClassReflection ();
255
+ $ className = $ this ->nameScope !== null ? $ this ->nameScope ->getClassName () : null ;
256
+ $ classReflection = $ className !== null && $ this ->reflectionProvider ->hasClass ($ className )
257
+ ? $ this ->reflectionProvider ->getClass ($ className )
258
+ : null ;
256
259
257
260
// new property also needs to be added to createEmpty()
258
261
$ result = new self ();
@@ -458,16 +461,6 @@ public function getNullableNameScope(): ?NameScope
458
461
return $ this ->nameScope ;
459
462
}
460
463
461
- private function getClassReflection (): ?ClassReflection
462
- {
463
- $ className = $ this ->nameScope ?->getClassName();
464
- if ($ className === null || !$ this ->reflectionProvider ->hasClass ($ className )) {
465
- return null ;
466
- }
467
-
468
- return $ this ->reflectionProvider ->getClass ($ className );
469
- }
470
-
471
464
/**
472
465
* @return array<(string|int), VarTag>
473
466
*/
@@ -834,14 +827,6 @@ public function isPure(): ?bool
834
827
return $ this ->isPure ;
835
828
}
836
829
837
- if ($ this ->nameScope !== null ) {
838
- $ classReflection = $ this ->getClassReflection ();
839
- if ($ classReflection !== null ) {
840
- $ this ->isPure = $ classReflection ->getDefaultMethodPurity ();
841
- return $ this ->isPure ;
842
- }
843
- }
844
-
845
830
$ this ->isPure = null ;
846
831
}
847
832
Original file line number Diff line number Diff line change @@ -892,7 +892,7 @@ public function createUserlandMethodReflection(ClassReflection $fileDeclaringCla
892
892
}
893
893
}
894
894
895
- $ isPure ??= $ resolvedPhpDoc ->isPure ();
895
+ $ isPure ??= $ resolvedPhpDoc ->isPure () ?? $ phpDocBlockClassReflection -> getDefaultMethodPurity () ;
896
896
$ asserts = Assertions::createFromResolvedPhpDocBlock ($ resolvedPhpDoc );
897
897
$ acceptsNamedArguments = $ resolvedPhpDoc ->acceptsNamedArguments ();
898
898
$ selfOutType = $ resolvedPhpDoc ->getSelfOutTag () !== null ? $ resolvedPhpDoc ->getSelfOutTag ()->getType () : null ;
You can’t perform that action at this time.
0 commit comments