Skip to content

Commit 533a6bc

Browse files
authored
Get rid of private final methods (php#6892)
1 parent d24cf1a commit 533a6bc

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

Zend/zend_exceptions.stub.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Exception implements Throwable
3535
private array $trace = [];
3636
private ?Throwable $previous = null;
3737

38-
final private function __clone(): void {}
38+
private function __clone(): void {}
3939

4040
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null) {}
4141

@@ -93,7 +93,7 @@ class Error implements Throwable
9393
private ?Throwable $previous = null;
9494

9595
/** @implementation-alias Exception::__clone */
96-
final private function __clone(): void {}
96+
private function __clone(): void {}
9797

9898
/** @implementation-alias Exception::__construct */
9999
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null) {}

Zend/zend_exceptions_arginfo.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: f322ba2ed3e636b6e99400edfbff98102b7e3d06 */
2+
* Stub hash: ef8c275a543d67fd96a775b0b18098ccdb428285 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Throwable_getMessage, 0, 0, IS_STRING, 0)
55
ZEND_END_ARG_INFO()
@@ -109,7 +109,7 @@ static const zend_function_entry class_Throwable_methods[] = {
109109

110110

111111
static const zend_function_entry class_Exception_methods[] = {
112-
ZEND_ME(Exception, __clone, arginfo_class_Exception___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
112+
ZEND_ME(Exception, __clone, arginfo_class_Exception___clone, ZEND_ACC_PRIVATE)
113113
ZEND_ME(Exception, __construct, arginfo_class_Exception___construct, ZEND_ACC_PUBLIC)
114114
ZEND_ME(Exception, __wakeup, arginfo_class_Exception___wakeup, ZEND_ACC_PUBLIC)
115115
ZEND_ME(Exception, getMessage, arginfo_class_Exception_getMessage, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
@@ -132,7 +132,7 @@ static const zend_function_entry class_ErrorException_methods[] = {
132132

133133

134134
static const zend_function_entry class_Error_methods[] = {
135-
ZEND_MALIAS(Exception, __clone, __clone, arginfo_class_Error___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
135+
ZEND_MALIAS(Exception, __clone, __clone, arginfo_class_Error___clone, ZEND_ACC_PRIVATE)
136136
ZEND_MALIAS(Exception, __construct, __construct, arginfo_class_Error___construct, ZEND_ACC_PUBLIC)
137137
ZEND_MALIAS(Exception, __wakeup, __wakeup, arginfo_class_Error___wakeup, ZEND_ACC_PUBLIC)
138138
ZEND_MALIAS(Exception, getMessage, getMessage, arginfo_class_Error_getMessage, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)

ext/reflection/php_reflection.stub.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ abstract class ReflectionFunctionAbstract implements Reflector
2121
public string $name;
2222

2323
/** @implementation-alias ReflectionClass::__clone */
24-
final private function __clone(): void {}
24+
private function __clone(): void {}
2525

2626
/** @return bool */
2727
public function inNamespace() {}
@@ -205,7 +205,7 @@ class ReflectionClass implements Reflector
205205
{
206206
public string $name;
207207

208-
final private function __clone(): void {}
208+
private function __clone(): void {}
209209

210210
public function __construct(object|string $objectOrClass) {}
211211

@@ -381,7 +381,7 @@ class ReflectionProperty implements Reflector
381381
public string $class;
382382

383383
/** @implementation-alias ReflectionClass::__clone */
384-
final private function __clone(): void {}
384+
private function __clone(): void {}
385385

386386
public function __construct(object|string $class, string $property) {}
387387

@@ -449,7 +449,7 @@ class ReflectionClassConstant implements Reflector
449449
public string $class;
450450

451451
/** @implementation-alias ReflectionClass::__clone */
452-
final private function __clone(): void {}
452+
private function __clone(): void {}
453453

454454
public function __construct(object|string $class, string $constant) {}
455455

@@ -490,7 +490,7 @@ class ReflectionParameter implements Reflector
490490
public string $name;
491491

492492
/** @implementation-alias ReflectionClass::__clone */
493-
final private function __clone(): void {}
493+
private function __clone(): void {}
494494

495495
/** @param string|array|object $function */
496496
public function __construct($function, int|string $param) {}
@@ -569,7 +569,7 @@ public function getAttributes(?string $name = null, int $flags = 0): array {}
569569
abstract class ReflectionType implements Stringable
570570
{
571571
/** @implementation-alias ReflectionClass::__clone */
572-
final private function __clone(): void {}
572+
private function __clone(): void {}
573573

574574
/** @return bool */
575575
public function allowsNull() {}
@@ -596,7 +596,7 @@ class ReflectionExtension implements Reflector
596596
public string $name;
597597

598598
/** @implementation-alias ReflectionClass::__clone */
599-
final private function __clone(): void {}
599+
private function __clone(): void {}
600600

601601
public function __construct(string $name) {}
602602

@@ -641,7 +641,7 @@ class ReflectionZendExtension implements Reflector
641641
public string $name;
642642

643643
/** @implementation-alias ReflectionClass::__clone */
644-
final private function __clone(): void {}
644+
private function __clone(): void {}
645645

646646
public function __construct(string $name) {}
647647

ext/reflection/php_reflection_arginfo.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 3594ec0b0c3ed7266223be9c6b426aac56e3aabe */
2+
* Stub hash: 6f36123e16ed34e45a527094ab643b6b57669a5d */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Reflection_getModifierNames, 0, 0, 1)
55
ZEND_ARG_TYPE_INFO(0, modifiers, IS_LONG, 0)
@@ -755,7 +755,7 @@ static const zend_function_entry class_Reflector_methods[] = {
755755

756756

757757
static const zend_function_entry class_ReflectionFunctionAbstract_methods[] = {
758-
ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionFunctionAbstract___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
758+
ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionFunctionAbstract___clone, ZEND_ACC_PRIVATE)
759759
ZEND_ME(ReflectionFunctionAbstract, inNamespace, arginfo_class_ReflectionFunctionAbstract_inNamespace, ZEND_ACC_PUBLIC)
760760
ZEND_ME(ReflectionFunctionAbstract, isClosure, arginfo_class_ReflectionFunctionAbstract_isClosure, ZEND_ACC_PUBLIC)
761761
ZEND_ME(ReflectionFunctionAbstract, isDeprecated, arginfo_class_ReflectionFunctionAbstract_isDeprecated, ZEND_ACC_PUBLIC)
@@ -832,7 +832,7 @@ static const zend_function_entry class_ReflectionMethod_methods[] = {
832832

833833

834834
static const zend_function_entry class_ReflectionClass_methods[] = {
835-
ZEND_ME(ReflectionClass, __clone, arginfo_class_ReflectionClass___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
835+
ZEND_ME(ReflectionClass, __clone, arginfo_class_ReflectionClass___clone, ZEND_ACC_PRIVATE)
836836
ZEND_ME(ReflectionClass, __construct, arginfo_class_ReflectionClass___construct, ZEND_ACC_PUBLIC)
837837
ZEND_ME(ReflectionClass, __toString, arginfo_class_ReflectionClass___toString, ZEND_ACC_PUBLIC)
838838
ZEND_ME(ReflectionClass, getName, arginfo_class_ReflectionClass_getName, ZEND_ACC_PUBLIC)
@@ -898,7 +898,7 @@ static const zend_function_entry class_ReflectionObject_methods[] = {
898898

899899

900900
static const zend_function_entry class_ReflectionProperty_methods[] = {
901-
ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionProperty___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
901+
ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionProperty___clone, ZEND_ACC_PRIVATE)
902902
ZEND_ME(ReflectionProperty, __construct, arginfo_class_ReflectionProperty___construct, ZEND_ACC_PUBLIC)
903903
ZEND_ME(ReflectionProperty, __toString, arginfo_class_ReflectionProperty___toString, ZEND_ACC_PUBLIC)
904904
ZEND_ME(ReflectionProperty, getName, arginfo_class_ReflectionProperty_getName, ZEND_ACC_PUBLIC)
@@ -925,7 +925,7 @@ static const zend_function_entry class_ReflectionProperty_methods[] = {
925925

926926

927927
static const zend_function_entry class_ReflectionClassConstant_methods[] = {
928-
ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionClassConstant___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
928+
ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionClassConstant___clone, ZEND_ACC_PRIVATE)
929929
ZEND_ME(ReflectionClassConstant, __construct, arginfo_class_ReflectionClassConstant___construct, ZEND_ACC_PUBLIC)
930930
ZEND_ME(ReflectionClassConstant, __toString, arginfo_class_ReflectionClassConstant___toString, ZEND_ACC_PUBLIC)
931931
ZEND_ME(ReflectionClassConstant, getName, arginfo_class_ReflectionClassConstant_getName, ZEND_ACC_PUBLIC)
@@ -943,7 +943,7 @@ static const zend_function_entry class_ReflectionClassConstant_methods[] = {
943943

944944

945945
static const zend_function_entry class_ReflectionParameter_methods[] = {
946-
ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionParameter___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
946+
ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionParameter___clone, ZEND_ACC_PRIVATE)
947947
ZEND_ME(ReflectionParameter, __construct, arginfo_class_ReflectionParameter___construct, ZEND_ACC_PUBLIC)
948948
ZEND_ME(ReflectionParameter, __toString, arginfo_class_ReflectionParameter___toString, ZEND_ACC_PUBLIC)
949949
ZEND_ME(ReflectionParameter, getName, arginfo_class_ReflectionParameter_getName, ZEND_ACC_PUBLIC)
@@ -971,7 +971,7 @@ static const zend_function_entry class_ReflectionParameter_methods[] = {
971971

972972

973973
static const zend_function_entry class_ReflectionType_methods[] = {
974-
ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionType___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
974+
ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionType___clone, ZEND_ACC_PRIVATE)
975975
ZEND_ME(ReflectionType, allowsNull, arginfo_class_ReflectionType_allowsNull, ZEND_ACC_PUBLIC)
976976
ZEND_ME(ReflectionType, __toString, arginfo_class_ReflectionType___toString, ZEND_ACC_PUBLIC)
977977
ZEND_FE_END
@@ -992,7 +992,7 @@ static const zend_function_entry class_ReflectionUnionType_methods[] = {
992992

993993

994994
static const zend_function_entry class_ReflectionExtension_methods[] = {
995-
ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionExtension___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
995+
ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionExtension___clone, ZEND_ACC_PRIVATE)
996996
ZEND_ME(ReflectionExtension, __construct, arginfo_class_ReflectionExtension___construct, ZEND_ACC_PUBLIC)
997997
ZEND_ME(ReflectionExtension, __toString, arginfo_class_ReflectionExtension___toString, ZEND_ACC_PUBLIC)
998998
ZEND_ME(ReflectionExtension, getName, arginfo_class_ReflectionExtension_getName, ZEND_ACC_PUBLIC)
@@ -1011,7 +1011,7 @@ static const zend_function_entry class_ReflectionExtension_methods[] = {
10111011

10121012

10131013
static const zend_function_entry class_ReflectionZendExtension_methods[] = {
1014-
ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionZendExtension___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
1014+
ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionZendExtension___clone, ZEND_ACC_PRIVATE)
10151015
ZEND_ME(ReflectionZendExtension, __construct, arginfo_class_ReflectionZendExtension___construct, ZEND_ACC_PUBLIC)
10161016
ZEND_ME(ReflectionZendExtension, __toString, arginfo_class_ReflectionZendExtension___toString, ZEND_ACC_PUBLIC)
10171017
ZEND_ME(ReflectionZendExtension, getName, arginfo_class_ReflectionZendExtension_getName, ZEND_ACC_PUBLIC)

ext/reflection/tests/ReflectionClass_toString_001.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector, String
2828
}
2929

3030
- Methods [55] {
31-
Method [ <internal:Reflection> final private method __clone ] {
31+
Method [ <internal:Reflection> private method __clone ] {
3232

3333
- Parameters [0] {
3434
}

sapi/cli/tests/005.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ string(183) "Class [ <internal:Core> class stdClass ] {
3737
}
3838

3939
"
40-
string(2194) "Class [ <internal:Core> class Exception implements Throwable, Stringable ] {
40+
string(2188) "Class [ <internal:Core> class Exception implements Throwable, Stringable ] {
4141

4242
- Constants [0] {
4343
}
@@ -59,7 +59,7 @@ string(2194) "Class [ <internal:Core> class Exception implements Throwable, Stri
5959
}
6060

6161
- Methods [11] {
62-
Method [ <internal:Core> final private method __clone ] {
62+
Method [ <internal:Core> private method __clone ] {
6363

6464
- Parameters [0] {
6565
}

0 commit comments

Comments
 (0)