Author: Elliot Levin (elliotlevin@hotmail.com)
Inheritance: extends StaticClassExpression
Example #1
0
 public function walkClassConstant(O\ClassConstantExpression $expression)
 {
     $classExpression = $expression->getClass();
     if ($classExpression instanceof O\ValueExpression && strtolower($expression->getName()) === 'class') {
         $classConstantValue = $this->resolveMagicScopeClassConstant($classExpression->getValue());
         if ($classConstantValue === null) {
             return $expression;
         }
         return O\Expression::value($classConstantValue);
     }
     return parent::walkClassConstant($this->resolveMagicScopeExpression($expression));
 }
Example #2
0
 public function visitClassConstant(O\ClassConstantExpression $expression)
 {
     $this->validateStaticClassName($expression->getClass(), 'class constant');
     $this->verifyConstantDefined($expression->getClass()->getValue() . '::' . $expression->getName());
     $this->analysis[$expression] = $this->typeSystem->getTypeFromValue($expression->evaluate($this->analysisContext->getEvaluationContext()));
 }