PHPSA\Compiler\Types::getTypeName PHP Method

getTypeName() public static method

Get name for the $type
public static getTypeName ( integer $type ) : string
$type integer
return string
    public static function getTypeName($type)
    {
        switch ($type) {
            case CompiledExpression::INTEGER:
                return 'integer';
            case CompiledExpression::DOUBLE:
                return 'double';
            case CompiledExpression::STRING:
                return 'string';
            case CompiledExpression::NUMBER:
                return 'number';
            case CompiledExpression::ARR:
                return 'array';
            case CompiledExpression::OBJECT:
                return 'object';
            case CompiledExpression::RESOURCE:
                return 'resource';
            case CompiledExpression::CALLABLE_TYPE:
                return 'callable';
            case CompiledExpression::BOOLEAN:
                return 'boolean';
            case CompiledExpression::NULL:
                return 'null';
            default:
                return 'unknown';
        }
    }

Usage Example

Example #1
0
 /**
  * @return string
  */
 public function getTypeName()
 {
     return Types::getTypeName($this->type);
 }
All Usage Examples Of PHPSA\Compiler\Types::getTypeName