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

Conversation

@nicolas-grekas
Copy link
Contributor

These return types preemptively tell consumers that Twig 4 / PHP 9 might add real return types here.

For Profile, we can add the return types right away because the class is @final.

Spotted by DebugClassLoader comparing return types of internal PHP base types / magic methods.

@fabpot
Copy link
Contributor

fabpot commented Feb 2, 2021

Thank you @nicolas-grekas.

@fabpot fabpot merged commit ad02eb9 into twigphp:1.x Feb 2, 2021
@nicolas-grekas nicolas-grekas deleted the ret-type branch February 2, 2021 15:29
@nicolas-grekas nicolas-grekas changed the title Fix length filter doc Add some return types Add some return types Feb 2, 2021
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
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