Zephir\ClassProperty::compile PHP Метод

compile() публичный Метод

Produce the code to register a property
public compile ( zephir\CompilationContext $compilationContext )
$compilationContext zephir\CompilationContext
    public function compile(CompilationContext $compilationContext)
    {
        switch ($this->defaultValue['type']) {
            case 'long':
            case 'int':
            case 'string':
            case 'double':
            case 'bool':
                $this->declareProperty($compilationContext, $this->defaultValue['type'], $this->defaultValue['value']);
                break;
            case 'array':
            case 'empty-array':
                $this->initializeArray($compilationContext);
                //continue
            //continue
            case 'null':
                $this->declareProperty($compilationContext, $this->defaultValue['type'], null);
                break;
            case 'static-constant-access':
                $expression = new Expression($this->defaultValue);
                $compiledExpression = $expression->compile($compilationContext);
                $this->declareProperty($compilationContext, $compiledExpression->getType(), $compiledExpression->getCode());
                break;
            default:
                throw new CompilerException('Unknown default type: ' . $this->defaultValue['type'], $this->original);
        }
    }