public function __construct(Expression $ObjectOrNewExpression) { $IsObjectExpression = $ObjectOrNewExpression instanceof ObjectExpression; if (!$IsObjectExpression && !$ObjectOrNewExpression instanceof NewExpression) { throw new \Storm\Core\Object\ObjectException('The supplied expression must be of the type %s or %s: %s given', ObjectExpression::GetType(), NewExpression::GetType(), get_class($ObjectOrNewExpression)); } $this->ObjectOrNewExpression = $ObjectOrNewExpression; $this->IsStatic = $IsObjectExpression ? !$ObjectOrNewExpression->HasInstance() : false; $this->ClassType = $IsObjectExpression ? $ObjectOrNewExpression->GetClassType() : $ObjectOrNewExpression->GetClassType(); }
public function walkNew(NewExpression $expression) { return $expression->update($this->walk($expression->getClass()), $this->walkAll($expression->getArguments())); }