public function setType(int $type)
    {
    	if (!in_array($type, [
            self::TYPE_STRING, 
            self::TYPE_NUMBER, 
            self::TYPE_BOOL_TRUE, 
            self::TYPE_BOOL_FALSE,
            self::TYPE_NULL,
        ]))
        {
            throw new LogicalNodeException('Invalid value type assigned.');
        }

    	$this->type = $type;
    }
public function setType(int $type)
    {
    	if (!in_array($type, [
            self::TYPE_STRING, 
            self::TYPE_NUMBER, 
            self::TYPE_BOOL_TRUE, 
            self::TYPE_BOOL_FALSE,
            self::TYPE_NULL,
        ]))
        {
            throw new LogicalNodeException('Invalid value type assigned.');
        }

    	$this->type = $type;
    }
public function setType ( int $ type ) { if ( ! in_array ( $ type , [ self :: TYPE_STRING , self :: TYPE_NUMBER , self :: TYPE_BOOL_TRUE , self :: TYPE_BOOL_FALSE , self :: TYPE_NULL , ] ) ) { throw new LogicalNodeException ( 'Invalid value type assigned.' ) ; } $ this -> type = $ type ; }
Validate if the given type and assing it

@param int 				$type
@return void
Validate if the given type and assing it