Protobuf\Field::getTypeName PHP Method

getTypeName() public static method

public static getTypeName ( integer $type ) : string
$type integer
return string
    public static function getTypeName($type)
    {
        return isset(self::$names[$type]) ? self::$names[$type] : null;
    }

Usage Example

 /**
  * @param \google\protobuf\FieldDescriptorProto $field
  *
  * @return string
  */
 protected function getFieldTypeName(FieldDescriptorProto $field)
 {
     $type = $field->getType()->value();
     $name = Field::getTypeName($type);
     return $name ?: 'unknown';
 }
All Usage Examples Of Protobuf\Field::getTypeName