🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@nicolas-grekas
Copy link
Contributor

By making these return types explicit in the annotation, we preemptively tell consumers that some next major of Predis or PHP 9 might add real return types here.

These annotations are leveraged by Symfony's DebugClassLoader to help one spot some missing return types in their app. That's how I spotted these. They relate only to PHP internal's base types / magic methods.

@tillkruss
Copy link
Member

LGTM

nicolas-grekas added a commit to symfony/symfony that referenced this pull request Feb 4, 2021
…r (nicolas-grekas)

This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] fix parsing return types in DebugClassLoader

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

In 5.3, we might want to make `SYMFONY_PATCH_TYPE_DECLARATIONS=deprecations=1` the default, so that ppl know when they're missing some return types when they inherit some classes from vendors. This would fix https://github.com/orgs/symfony/projects/1#card-30856423

On 4.4, we have to disable this mode of reporting until these PRs are merged:
- twigphp/Twig#3481
- doctrine/collections#269
- predis/predis#678

Commits
-------

58e32b3 [ErrorHandler] fix parsing return types in DebugClassLoader
symfony-splitter pushed a commit to symfony/error-handler that referenced this pull request Feb 4, 2021
…r (nicolas-grekas)

This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] fix parsing return types in DebugClassLoader

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

In 5.3, we might want to make `SYMFONY_PATCH_TYPE_DECLARATIONS=deprecations=1` the default, so that ppl know when they're missing some return types when they inherit some classes from vendors. This would fix https://github.com/orgs/symfony/projects/1#card-30856423

On 4.4, we have to disable this mode of reporting until these PRs are merged:
- twigphp/Twig#3481
- doctrine/collections#269
- predis/predis#678

Commits
-------

58e32b3c2a [ErrorHandler] fix parsing return types in DebugClassLoader
@tillkruss tillkruss merged commit 3a14a39 into predis:v1.1 Feb 9, 2021
@nicolas-grekas nicolas-grekas deleted the ret-type branch February 10, 2021 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants