Library/ClassProperty.php
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);
                // no break
            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);
        }
    }
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);
                // no break
            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);
        }
    }
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 ) ; // no break 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 ) ; } }
Produce the code to register a property.

@param CompilationContext $compilationContext

@throws CompilerException
Produce the code to register a property .