refactor(preprocessor): change method visibility for constant type resolution

- Changed resolveReferencedConstantType method from private to protected access
- Maintains same functionality for resolving referenced constant types
- Enables potential inheritance or extension of the preprocessor class
pull/34/head
韩天峰 2 months ago
parent 871bf3a950
commit 9009a0b5fa
  1. 2
      src/Preprocessor.php

@ -831,7 +831,7 @@ class Preprocessor extends CompilerBase
* the reference cannot be resolved yet (for instance when the referenced * the reference cannot be resolved yet (for instance when the referenced
* class has not been prepared). `::class` always resolves to a string. * class has not been prepared). `::class` always resolves to a string.
*/ */
private function resolveReferencedConstantType(Node\Expr\ClassConstFetch $fetch, string $currentClass): ?string protected function resolveReferencedConstantType(Node\Expr\ClassConstFetch $fetch, string $currentClass): ?string
{ {
$constName = $fetch->name->toString(); $constName = $fetch->name->toString();
if (strcasecmp($constName, 'class') === 0) { if (strcasecmp($constName, 'class') === 0) {

Loading…
Cancel
Save