/** * Parses the value of a node into the model * * @param ValueInterface $obj * @param Node $node * @return void */ private function parseValue(ValueInterface $obj, Node $node) { $value = $node instanceof Const_ ? $node->value : $node->default; if ($value !== null) { if ($this->isPrimitive($value)) { $obj->setValue($this->getPrimitiveValue($value)); } else { $obj->setExpression($this->getExpression($value)); } } }
private function writeValue(ValueInterface $model) { if ($model->isExpression()) { $this->writer->write($model->getExpression()); } else { $value = $model->getValue(); if ($value instanceof PhpConstant) { $this->writer->write($value->getName()); } else { $this->writer->write($this->exportVar($value)); } } }
protected function isValueNull(ValueInterface $obj) { $this->assertNull($obj->getValue()); }