mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
21 lines
428 B
PHP
21 lines
428 B
PHP
<?php
|
|
|
|
namespace Combodo\iTop\PhpParser\Evaluation;
|
|
|
|
use PhpParser\Node\Expr;
|
|
use PhpParser\Node\Expr\ConstFetch;
|
|
|
|
class ConstFetchEvaluator extends AbstractExprEvaluator {
|
|
public function GetHandledExpressionType(): ?string {
|
|
return ConstFetch::class;
|
|
}
|
|
|
|
public function Evaluate(Expr $oExpr): mixed {
|
|
/** @var ConstFetch $oExpr */
|
|
if (defined($oExpr->name)){
|
|
return constant($oExpr->name);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
} |