getLabelName() public static méthode

Obtain the label name (repeated, optional, required).
public static getLabelName ( string $label ) : string
$label string
Résultat string
 /**
  * Obtain the rule for the given field (repeated, optional, required).
  *
  * @param \google\protobuf\FieldDescriptorProto $field
  *
  * @return string
  */
 protected function getFieldLabelName(FieldDescriptorProto $field)
 {
     $label = $field->getLabel()->value();
     $name = Field::getLabelName($label);
     return $name ?: 'unknown';
 }
Exemple #2
0
 /**
  * @dataProvider labelNameProvider
  */
 public function testGetLabelName($type, $expected)
 {
     $this->assertEquals($expected, Field::getLabelName($type));
 }