fix few Evaluators code

This commit is contained in:
odain
2025-09-04 22:41:14 +02:00
parent 86fe9d6a2b
commit af790269f0
10 changed files with 102 additions and 122 deletions

View File

@@ -4,6 +4,7 @@ namespace Combodo\iTop\PhpParser\Evaluation;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\StaticPropertyFetch;
use PhpParser\Node\Identifier;
class StaticPropertyFetchEvaluator extends AbstractExprEvaluator {
public function GetHandledExpressionType(): ?string {
@@ -14,7 +15,11 @@ class StaticPropertyFetchEvaluator extends AbstractExprEvaluator {
/** @var StaticPropertyFetch $oExpr */
$sClassName = $oExpr->class->name;
$sProperty = $oExpr->name->name;
if ($oExpr->name instanceof Identifier){
$sProperty = $oExpr->name->name;
} else {
$sProperty = PhpExpressionEvaluator::GetInstance()->EvaluateExpression($oExpr->name);
}
if (class_exists($sClassName)){
$class = new \ReflectionClass($sClassName);