mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-28 04:58:46 +02:00
move PhpParser/Evaluation classes in a specific namespave + composer dumpautoload
This commit is contained in:
32
sources/PhpParser/Evaluation/VariableEvaluator.php
Normal file
32
sources/PhpParser/Evaluation/VariableEvaluator.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\PhpParser\Evaluation;;
|
||||
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Expr\ClassConstFetch;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
|
||||
class VariableEvaluator implements iExprEvaluator {
|
||||
public function GetHandledExpressionType(): string {
|
||||
return Variable::class;
|
||||
}
|
||||
|
||||
public function Evaluate(Expr $oExpr): mixed {
|
||||
/** @var Variable $oExpr */
|
||||
if (is_null($oExpr->name)){
|
||||
return null;
|
||||
}
|
||||
|
||||
if (! isset($oExpr->name)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$sVarname=$oExpr->name;
|
||||
|
||||
$bResult = null;
|
||||
@eval('$bResult = $'.$sVarname.';');
|
||||
|
||||
return $bResult;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user