-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Add PHP types to private methods and functions #49348
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
nicolas-grekas
merged 1 commit into
symfony:6.3
from
wouterj:issue-47551/return-types-php
Feb 13, 2023
Merged
Add PHP types to private methods and functions #49348
nicolas-grekas
merged 1 commit into
symfony:6.3
from
wouterj:issue-47551/return-types-php
Feb 13, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Feb 12, 2023
src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Configuration.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Form/Console/Descriptor/JsonDescriptor.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Form/Console/Descriptor/JsonDescriptor.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Serializer/Mapping/ClassDiscriminatorFromClassMetadata.php
Outdated
Show resolved
Hide resolved
nicolas-grekas
added a commit
that referenced
this pull request
Feb 13, 2023
This PR was merged into the 6.3 branch. Discussion ---------- Add many missing PHPdoc return types | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no | Deprecations? | yes | Tickets | Ref #47551, continues #49342 | License | MIT | Doc PR | - This PR adds lots of ``@return`` PHPdoc that we missed in the 5.4 branch. These will produce new deprecation warnings, if applications override one of these methods. It will not break backwards compatibility. Adding these PHPdoc in 6.3 already allow the community to test all these annotations for 6 months in stable version, before committing to adding them as PHP types in 7.0. This way, I hope we patch out any wrong type. This PR is done using a slightly modified Psalter script, based on Psalm's type inference. See #49348 for the counter PR adding real PHP types to private, final or internal methods. Commits ------- e23d8be Add missing PHPdoc return types
02325f2
to
384c9a6
Compare
Thank you @wouterj. |
nicolas-grekas
added a commit
that referenced
this pull request
Mar 2, 2023
…(fancyweb) This PR was merged into the 6.3 branch. Discussion ---------- [TwigBridge] Fix TwigDataCollector::getTime() return type | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Ref #49348 It generates implicit incompatible float to int conversion deprecations. Commits ------- 29e2e13 [TwigBridge] Fix TwigDataCollector::getTime() return type
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds real PHP types to private, internal or final (excluding
@final
) methods based on Psalm's type inference. Many more return types are missing still, but let's do them in other contributions.This change can result in BC breaks in multiple ways, so we should carefully review the changes:
@final
, but not yet realfinal
), we should instead add a PHPdoc return type (see Add many missing PHPdoc return types #49349)