getPhpType() 공개 정적인 메소드

public static getPhpType ( integer $type ) : string
$type integer
리턴 string
 /**
  * @param \google\protobuf\FieldDescriptorProto $field
  *
  * @return string
  */
 protected function getDoctype(FieldDescriptorProto $field)
 {
     $fieldType = $field->getType()->value();
     $phpType = Field::getPhpType($fieldType);
     $refTypes = [Type::TYPE_ENUM_VALUE => true, Type::TYPE_MESSAGE_VALUE => true];
     if (isset($refTypes[$fieldType])) {
         $typeName = $field->getTypeName();
         $refEntity = $this->getEntity($typeName);
         return $refEntity->getNamespacedName();
     }
     return $phpType ?: 'mixed';
 }
예제 #2
0
 /**
  * @dataProvider phpTypeProvider
  */
 public function testGetPhpType($type, $expected)
 {
     $this->assertEquals($expected, Field::getPhpType($type));
 }