[php-src] master: Get rid of private final methods (#6892)
| From: | Máté Kocsis via GitHub | Date: | Wed, 21 Apr 2021 08:08:17 +0000 |
| Subject: | [php-src] master: Get rid of private final methods (#6892) | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-115722@lists.php.net to get a copy of this message | ||
Author: Máté Kocsis (kocsismate)
Committer: GitHub (web-flow)
Pusher: kocsismate
Date: 2021-04-21T10:08:25+02:00
Commit: https://github.com/php/php-src/commit/533a6bcb29775b6b254bb799dcd1de3215089025
Raw diff: https://github.com/php/php-src/commit/533a6bcb29775b6b254bb799dcd1de3215089025.diff
Get rid of private final methods (#6892)
Changed paths:
M Zend/zend_exceptions.stub.php
M Zend/zend_exceptions_arginfo.h
M ext/reflection/php_reflection.stub.php
M ext/reflection/php_reflection_arginfo.h
M ext/reflection/tests/ReflectionClass_toString_001.phpt
M sapi/cli/tests/005.phpt
Diff:
diff --git a/Zend/zend_exceptions.stub.php b/Zend/zend_exceptions.stub.php
index 5f6a3a53e4e95..ece019bbb9c7e 100644
--- a/Zend/zend_exceptions.stub.php
+++ b/Zend/zend_exceptions.stub.php
@@ -35,7 +35,7 @@ class Exception implements Throwable
private array $trace = [];
private ?Throwable $previous = null;
- final private function __clone(): void {}
+ private function __clone(): void {}
public function __construct(string $message = "", int $code = 0, ?Throwable $previous
= null) {}
@@ -93,7 +93,7 @@ class Error implements Throwable
private ?Throwable $previous = null;
/** @implementation-alias Exception::__clone */
- final private function __clone(): void {}
+ private function __clone(): void {}
/** @implementation-alias Exception::__construct */
public function __construct(string $message = "", int $code = 0, ?Throwable $previous
= null) {}
diff --git a/Zend/zend_exceptions_arginfo.h b/Zend/zend_exceptions_arginfo.h
index b1e4844717763..fd92ff0635535 100644
--- a/Zend/zend_exceptions_arginfo.h
+++ b/Zend/zend_exceptions_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: f322ba2ed3e636b6e99400edfbff98102b7e3d06 */
+ * Stub hash: ef8c275a543d67fd96a775b0b18098ccdb428285 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Throwable_getMessage, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
@@ -109,7 +109,7 @@ static const zend_function_entry class_Throwable_methods[] = {
static const zend_function_entry class_Exception_methods[] = {
- ZEND_ME(Exception, __clone, arginfo_class_Exception___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
+ ZEND_ME(Exception, __clone, arginfo_class_Exception___clone, ZEND_ACC_PRIVATE)
ZEND_ME(Exception, __construct, arginfo_class_Exception___construct, ZEND_ACC_PUBLIC)
ZEND_ME(Exception, __wakeup, arginfo_class_Exception___wakeup, ZEND_ACC_PUBLIC)
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[] = {
static const zend_function_entry class_Error_methods[] = {
- ZEND_MALIAS(Exception, __clone, __clone, arginfo_class_Error___clone,
ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
+ ZEND_MALIAS(Exception, __clone, __clone, arginfo_class_Error___clone, ZEND_ACC_PRIVATE)
ZEND_MALIAS(Exception, __construct, __construct, arginfo_class_Error___construct, ZEND_ACC_PUBLIC)
ZEND_MALIAS(Exception, __wakeup, __wakeup, arginfo_class_Error___wakeup, ZEND_ACC_PUBLIC)
ZEND_MALIAS(Exception, getMessage, getMessage, arginfo_class_Error_getMessage,
ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
diff --git a/ext/reflection/php_reflection.stub.php b/ext/reflection/php_reflection.stub.php
index e9815558d61b9..d8486a2804b15 100644
--- a/ext/reflection/php_reflection.stub.php
+++ b/ext/reflection/php_reflection.stub.php
@@ -21,7 +21,7 @@ abstract class ReflectionFunctionAbstract implements Reflector
public string $name;
/** @implementation-alias ReflectionClass::__clone */
- final private function __clone(): void {}
+ private function __clone(): void {}
/** @return bool */
public function inNamespace() {}
@@ -205,7 +205,7 @@ class ReflectionClass implements Reflector
{
public string $name;
- final private function __clone(): void {}
+ private function __clone(): void {}
public function __construct(object|string $objectOrClass) {}
@@ -381,7 +381,7 @@ class ReflectionProperty implements Reflector
public string $class;
/** @implementation-alias ReflectionClass::__clone */
- final private function __clone(): void {}
+ private function __clone(): void {}
public function __construct(object|string $class, string $property) {}
@@ -449,7 +449,7 @@ class ReflectionClassConstant implements Reflector
public string $class;
/** @implementation-alias ReflectionClass::__clone */
- final private function __clone(): void {}
+ private function __clone(): void {}
public function __construct(object|string $class, string $constant) {}
@@ -490,7 +490,7 @@ class ReflectionParameter implements Reflector
public string $name;
/** @implementation-alias ReflectionClass::__clone */
- final private function __clone(): void {}
+ private function __clone(): void {}
/** @param string|array|object $function */
public function __construct($function, int|string $param) {}
@@ -569,7 +569,7 @@ public function getAttributes(?string $name = null, int $flags = 0): array {}
abstract class ReflectionType implements Stringable
{
/** @implementation-alias ReflectionClass::__clone */
- final private function __clone(): void {}
+ private function __clone(): void {}
/** @return bool */
public function allowsNull() {}
@@ -596,7 +596,7 @@ class ReflectionExtension implements Reflector
public string $name;
/** @implementation-alias ReflectionClass::__clone */
- final private function __clone(): void {}
+ private function __clone(): void {}
public function __construct(string $name) {}
@@ -641,7 +641,7 @@ class ReflectionZendExtension implements Reflector
public string $name;
/** @implementation-alias ReflectionClass::__clone */
- final private function __clone(): void {}
+ private function __clone(): void {}
public function __construct(string $name) {}
diff --git a/ext/reflection/php_reflection_arginfo.h b/ext/reflection/php_reflection_arginfo.h
index 36e6dc3cec004..85a59378ade75 100644
--- a/ext/reflection/php_reflection_arginfo.h
+++ b/ext/reflection/php_reflection_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 3594ec0b0c3ed7266223be9c6b426aac56e3aabe */
+ * Stub hash: 6f36123e16ed34e45a527094ab643b6b57669a5d */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Reflection_getModifierNames, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, modifiers, IS_LONG, 0)
@@ -755,7 +755,7 @@ static const zend_function_entry class_Reflector_methods[] = {
static const zend_function_entry class_ReflectionFunctionAbstract_methods[] = {
- ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionFunctionAbstract___clone,
ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
+ ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionFunctionAbstract___clone,
ZEND_ACC_PRIVATE)
ZEND_ME(ReflectionFunctionAbstract, inNamespace,
arginfo_class_ReflectionFunctionAbstract_inNamespace, ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionFunctionAbstract, isClosure, arginfo_class_ReflectionFunctionAbstract_isClosure,
ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionFunctionAbstract, isDeprecated,
arginfo_class_ReflectionFunctionAbstract_isDeprecated, ZEND_ACC_PUBLIC)
@@ -832,7 +832,7 @@ static const zend_function_entry class_ReflectionMethod_methods[] = {
static const zend_function_entry class_ReflectionClass_methods[] = {
- ZEND_ME(ReflectionClass, __clone, arginfo_class_ReflectionClass___clone,
ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
+ ZEND_ME(ReflectionClass, __clone, arginfo_class_ReflectionClass___clone, ZEND_ACC_PRIVATE)
ZEND_ME(ReflectionClass, __construct, arginfo_class_ReflectionClass___construct, ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionClass, __toString, arginfo_class_ReflectionClass___toString, ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionClass, getName, arginfo_class_ReflectionClass_getName, ZEND_ACC_PUBLIC)
@@ -898,7 +898,7 @@ static const zend_function_entry class_ReflectionObject_methods[] = {
static const zend_function_entry class_ReflectionProperty_methods[] = {
- ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionProperty___clone,
ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
+ ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionProperty___clone,
ZEND_ACC_PRIVATE)
ZEND_ME(ReflectionProperty, __construct, arginfo_class_ReflectionProperty___construct,
ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionProperty, __toString, arginfo_class_ReflectionProperty___toString,
ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionProperty, getName, arginfo_class_ReflectionProperty_getName, ZEND_ACC_PUBLIC)
@@ -925,7 +925,7 @@ static const zend_function_entry class_ReflectionProperty_methods[] = {
static const zend_function_entry class_ReflectionClassConstant_methods[] = {
- ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionClassConstant___clone,
ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
+ ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionClassConstant___clone,
ZEND_ACC_PRIVATE)
ZEND_ME(ReflectionClassConstant, __construct, arginfo_class_ReflectionClassConstant___construct,
ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionClassConstant, __toString, arginfo_class_ReflectionClassConstant___toString,
ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionClassConstant, getName, arginfo_class_ReflectionClassConstant_getName,
ZEND_ACC_PUBLIC)
@@ -943,7 +943,7 @@ static const zend_function_entry class_ReflectionClassConstant_methods[] = {
static const zend_function_entry class_ReflectionParameter_methods[] = {
- ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionParameter___clone,
ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
+ ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionParameter___clone,
ZEND_ACC_PRIVATE)
ZEND_ME(ReflectionParameter, __construct, arginfo_class_ReflectionParameter___construct,
ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionParameter, __toString, arginfo_class_ReflectionParameter___toString,
ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionParameter, getName, arginfo_class_ReflectionParameter_getName, ZEND_ACC_PUBLIC)
@@ -971,7 +971,7 @@ static const zend_function_entry class_ReflectionParameter_methods[] = {
static const zend_function_entry class_ReflectionType_methods[] = {
- ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionType___clone,
ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
+ ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionType___clone,
ZEND_ACC_PRIVATE)
ZEND_ME(ReflectionType, allowsNull, arginfo_class_ReflectionType_allowsNull, ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionType, __toString, arginfo_class_ReflectionType___toString, ZEND_ACC_PUBLIC)
ZEND_FE_END
@@ -992,7 +992,7 @@ static const zend_function_entry class_ReflectionUnionType_methods[] = {
static const zend_function_entry class_ReflectionExtension_methods[] = {
- ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionExtension___clone,
ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
+ ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionExtension___clone,
ZEND_ACC_PRIVATE)
ZEND_ME(ReflectionExtension, __construct, arginfo_class_ReflectionExtension___construct,
ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionExtension, __toString, arginfo_class_ReflectionExtension___toString,
ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionExtension, getName, arginfo_class_ReflectionExtension_getName, ZEND_ACC_PUBLIC)
@@ -1011,7 +1011,7 @@ static const zend_function_entry class_ReflectionExtension_methods[] = {
static const zend_function_entry class_ReflectionZendExtension_methods[] = {
- ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionZendExtension___clone,
ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
+ ZEND_MALIAS(ReflectionClass, __clone, __clone, arginfo_class_ReflectionZendExtension___clone,
ZEND_ACC_PRIVATE)
ZEND_ME(ReflectionZendExtension, __construct, arginfo_class_ReflectionZendExtension___construct,
ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionZendExtension, __toString, arginfo_class_ReflectionZendExtension___toString,
ZEND_ACC_PUBLIC)
ZEND_ME(ReflectionZendExtension, getName, arginfo_class_ReflectionZendExtension_getName,
ZEND_ACC_PUBLIC)
diff --git a/ext/reflection/tests/ReflectionClass_toString_001.phpt
b/ext/reflection/tests/ReflectionClass_toString_001.phpt
index e8baf726891ef..6cdda44bde3be 100644
--- a/ext/reflection/tests/ReflectionClass_toString_001.phpt
+++ b/ext/reflection/tests/ReflectionClass_toString_001.phpt
@@ -28,7 +28,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector,
String
}
- Methods [55] {
- Method [ <internal:Reflection> final private method __clone ] {
+ Method [ <internal:Reflection> private method __clone ] {
- Parameters [0] {
}
diff --git a/sapi/cli/tests/005.phpt b/sapi/cli/tests/005.phpt
index 990ea01327a7c..de2ca28a1fec0 100644
--- a/sapi/cli/tests/005.phpt
+++ b/sapi/cli/tests/005.phpt
@@ -37,7 +37,7 @@ string(183) "Class [ <internal:Core> class stdClass ] {
}
"
-string(2194) "Class [ <internal:Core> class Exception implements Throwable, Stringable ]
{
+string(2188) "Class [ <internal:Core> class Exception implements Throwable, Stringable ]
{
- Constants [0] {
}
@@ -59,7 +59,7 @@ string(2194) "Class [ <internal:Core> class Exception implements
Throwable, Stri
}
- Methods [11] {
- Method [ <internal:Core> final private method __clone ] {
+ Method [ <internal:Core> private method __clone ] {
- Parameters [0] {
}