This is right from Rector's own code 😆
-if (in_array($className, ['static', 'self', 'parent'], true)) {
- $resolvedClassType = $this->nodeTypeResolver->resolve($classConstFetch->class);
- $className = $this->matchClassTypeThatContainsConstant($resolvedClassType, $constantName);
- if ($className === null) {
- return;
- }
-} else {
- $resolvedClassType = $this->nodeTypeResolver->resolve($classConstFetch->class);
- $className = $this->matchClassTypeThatContainsConstant($resolvedClassType, $constantName);
- if ($className === null) {
- return;
- }
-}
+$resolvedClassType = $this->nodeTypeResolver->resolve($classConstFetch->class);
+$className = $this->matchClassTypeThatContainsConstant($resolvedClassType, $constantName);
+if ($className === null) {
+ return;
+}
This is right from Rector's own code 😆