Skip to content

Commit 4208121

Browse files
Breaking Change: Remove deprecated PHP APIs FieldDescriptor getLabel, use IsRepeated or isRequired instead.
https://protobuf.dev/news/2025-09-19/#php-remove-apis PiperOrigin-RevId: 845456074
1 parent 5333351 commit 4208121

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

php/ext/google/protobuf/def.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -387,20 +387,6 @@ PHP_METHOD(FieldDescriptor, getNumber) {
387387
RETURN_LONG(upb_FieldDef_Number(intern->fielddef));
388388
}
389389

390-
/*
391-
* FieldDescriptor::getLabel()
392-
*
393-
* DEPRECATED: Use isRequired() or isRepeated() instead.
394-
*
395-
* Returns the label of this field as an integer.
396-
*/
397-
PHP_METHOD(FieldDescriptor, getLabel) {
398-
zend_error(E_USER_DEPRECATED,
399-
"getLabel is deprecated. Use isRequired or isRepeated instead.\n");
400-
FieldDescriptor* intern = (FieldDescriptor*)Z_OBJ_P(getThis());
401-
RETURN_LONG(upb_FieldDef_Label(intern->fielddef));
402-
}
403-
404390
/*
405391
* FieldDescriptor::isRequired()
406392
*
@@ -541,7 +527,6 @@ PHP_METHOD(FieldDescriptor, getMessageType) {
541527
static zend_function_entry FieldDescriptor_methods[] = {
542528
PHP_ME(FieldDescriptor, getName, arginfo_void, ZEND_ACC_PUBLIC)
543529
PHP_ME(FieldDescriptor, getNumber, arginfo_void, ZEND_ACC_PUBLIC)
544-
PHP_ME(FieldDescriptor, getLabel, arginfo_void, ZEND_ACC_PUBLIC)
545530
PHP_ME(FieldDescriptor, isRequired, arginfo_void, ZEND_ACC_PUBLIC)
546531
PHP_ME(FieldDescriptor, isRepeated, arginfo_void, ZEND_ACC_PUBLIC)
547532
PHP_ME(FieldDescriptor, getType, arginfo_void, ZEND_ACC_PUBLIC)

php/tests/DescriptorsTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ class DescriptorsTest extends TestBase
1616
{
1717

1818
// Redefine these here for compatibility with c extension
19-
const GPBLABEL_OPTIONAL = 1;
20-
const GPBLABEL_REQUIRED = 2;
21-
const GPBLABEL_REPEATED = 3;
22-
2319
const GPBTYPE_DOUBLE = 1;
2420
const GPBTYPE_FLOAT = 2;
2521
const GPBTYPE_INT64 = 3;

0 commit comments

Comments
 (0)