Skip to content
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

Stubs and generated arginfo: remove tentative returns from final methods #16213

Merged
merged 1 commit into from
Oct 4, 2024
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
3 changes: 3 additions & 0 deletions build/gen_stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -1291,6 +1291,9 @@ public function __construct(
$this->attributes = $attributes;
$this->framelessFunctionInfos = $framelessFunctionInfos;
$this->exposedDocComment = $exposedDocComment;
if ($return->tentativeReturnType && $this->isFinalMethod()) {
throw new Exception("Tentative return inapplicable for final method");
}
}

public function isMethod(): bool
Expand Down
6 changes: 0 additions & 6 deletions ext/reflection/php_reflection.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,22 +146,16 @@ final class ReflectionGenerator
{
public function __construct(Generator $generator) {}

/** @tentative-return-type */
public function getExecutingLine(): int {}

/** @tentative-return-type */
public function getExecutingFile(): string {}

/** @tentative-return-type */
public function getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT): array {}

/** @tentative-return-type */
public function getFunction(): ReflectionFunctionAbstract {}

/** @tentative-return-type */
public function getThis(): ?object {}

/** @tentative-return-type */
public function getExecutingGenerator(): Generator {}

public function isClosed(): bool {}
Expand Down
26 changes: 13 additions & 13 deletions ext/reflection/php_reflection_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions ext/spl/spl_directory.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ public function __toString(): string {}
/** @tentative-return-type */
public function __debugInfo(): array {}

/**
* @tentative-return-type
*/
#[\Deprecated(since: '8.2')]
final public function _bad_state_ex(): void {}
}
Expand Down
15 changes: 8 additions & 7 deletions ext/spl/spl_directory_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.