Skip to content

Get rid of private final methods #6892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Zend/zend_exceptions.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}

Expand Down Expand Up @@ -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) {}
Expand Down
6 changes: 3 additions & 3 deletions Zend/zend_exceptions_arginfo.h
Original file line number Diff line number Diff line change
@@ -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()
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
16 changes: 8 additions & 8 deletions ext/reflection/php_reflection.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Expand Down Expand Up @@ -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) {}

Expand Down Expand Up @@ -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) {}

Expand Down Expand Up @@ -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) {}

Expand Down Expand Up @@ -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) {}
Expand Down Expand Up @@ -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() {}
Expand All @@ -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) {}

Expand Down Expand Up @@ -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) {}

Expand Down
18 changes: 9 additions & 9 deletions ext/reflection/php_reflection_arginfo.h
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion ext/reflection/tests/ReflectionClass_toString_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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] {
}
Expand Down
4 changes: 2 additions & 2 deletions sapi/cli/tests/005.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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] {
}
Expand All @@ -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] {
}
Expand Down