Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Be more detailed about coding standards for PHPdoc#17064

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
javiereguiluz merged 1 commit intosymfony:5.4fromwouterj:static-analysis
Jul 29, 2022

Conversation

@wouterj
Copy link
Member

@wouterjwouterj commentedJul 26, 2022
edited
Loading

A proposal for the rest of the core team to consider about our PHPdoc.

Copy link
Member

@fabpotfabpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I would also add a note that phpdocs are not part of our BC promise policy (maybe something to also add on our BC promise policy doc).

order to improve types for static analysis, the following annotations are
also allowed:

* `Generics`_, with the exception of ``@template-covariant``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Why do we make that exception?

Copy link
MemberAuthor

@wouterjwouterjJul 26, 2022
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

As far as I know, this is not (yet?) supported by PHPstan.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

phpstan supports it (otherwise, they would not havethis blog post explaining it)

@javiereguiluz
Copy link
Member

Thank you Wouter.

@javiereguiluzjaviereguiluz merged commit9b91b2a intosymfony:5.4Jul 29, 2022
@wouterjwouterj deleted the static-analysis branchJuly 29, 2022 15:58
nicolas-grekas added a commit to symfony/symfony that referenced this pull requestAug 2, 2022
…PHPstan and Psalm (mdeboer, wouterj)This PR was merged into the 6.2 branch.Discussion----------Improve some PHPdocs based on existing Symfony stubs in PHPstan and Psalm| Q             | A| ------------- | ---| Branch?       | 6.2| Bug fix?      | no| New feature?  | no| Deprecations? | no (strictly spoken yes, as I guess DebugClassLoader will trigger deprecations for some now?)| Tickets       | Replaces#40783| License       | MIT| Doc PR        |symfony/symfony-docs#17064Todo---* [x] Review the Psalm check of this PR* [x] Test the changes with DebugClassLoader in a real appDescription---This PR adds some more information to the PHPdoc of Symfony classes. By moving the information from the current stubs of static analyzers into Symfony itself: (1) we can improve the experience for all users, (2) reduce false-positives from our own Psalm check and (3) make sure they are in sync with changes done on these classes.<s>To avoid a PR that is too big to review and maintain, the scope of this PR is deliberately kept narrow:* Only PHPdoc from either [Psalm's Symfony stubs](https://github.com/psalm/psalm-plugin-symfony/tree/master/src/Stubs) or [PHPStan's Symfony stubs](https://github.com/phpstan/phpstan-symfony/tree/1.2.x/stubs) is added* The PHPdoc MUST NOT break PHPstorm* The PHPdoc MUST be supported by both PHPstan and Psalm (those are the only two static analyzers that currently ship an official Symfony plugin afaik)* The PHPdoc SHOULD NOT duplicate anything that can already be deduced from either PHP's type declarations or already existing PHPdoc.* The PHPdoc MUST document the contract and NOT be added to fit a 95% use-case or improve auto-completion.</s>EDIT: Replaced the guidelines bysymfony/symfony-docs#17064On top of this, to get this PR approved quicker, I've left out all stubs from the Form (based on the discussions in#40783) and most of [PHPStan's `Envelope` stub](https://github.com/psalm/psalm-plugin-symfony/blob/master/src/Stubs/common/Component/Messenger/Envelope.stubphp) (due to complexity of the PHPdoc).Commits-------f5a802a [DependencyInjection] Add nice exception when using non-scalar parameter as array keyfa7703b [ErrorHandler] Do not patch return types that are not a valid PHP type38ab6de Improve some PHPdocs based on existing Symfony stubs in PHPstan and Psalm
symfony-splitter pushed a commit to symfony/serializer that referenced this pull requestAug 2, 2022
…PHPstan and Psalm (mdeboer, wouterj)This PR was merged into the 6.2 branch.Discussion----------Improve some PHPdocs based on existing Symfony stubs in PHPstan and Psalm| Q             | A| ------------- | ---| Branch?       | 6.2| Bug fix?      | no| New feature?  | no| Deprecations? | no (strictly spoken yes, as I guess DebugClassLoader will trigger deprecations for some now?)| Tickets       | Replaces #40783| License       | MIT| Doc PR        |symfony/symfony-docs#17064Todo---* [x] Review the Psalm check of this PR* [x] Test the changes with DebugClassLoader in a real appDescription---This PR adds some more information to the PHPdoc of Symfony classes. By moving the information from the current stubs of static analyzers into Symfony itself: (1) we can improve the experience for all users, (2) reduce false-positives from our own Psalm check and (3) make sure they are in sync with changes done on these classes.<s>To avoid a PR that is too big to review and maintain, the scope of this PR is deliberately kept narrow:* Only PHPdoc from either [Psalm's Symfony stubs](https://github.com/psalm/psalm-plugin-symfony/tree/master/src/Stubs) or [PHPStan's Symfony stubs](https://github.com/phpstan/phpstan-symfony/tree/1.2.x/stubs) is added* The PHPdoc MUST NOT break PHPstorm* The PHPdoc MUST be supported by both PHPstan and Psalm (those are the only two static analyzers that currently ship an official Symfony plugin afaik)* The PHPdoc SHOULD NOT duplicate anything that can already be deduced from either PHP's type declarations or already existing PHPdoc.* The PHPdoc MUST document the contract and NOT be added to fit a 95% use-case or improve auto-completion.</s>EDIT: Replaced the guidelines bysymfony/symfony-docs#17064On top of this, to get this PR approved quicker, I've left out all stubs from the Form (based on the discussions in #40783) and most of [PHPStan's `Envelope` stub](https://github.com/psalm/psalm-plugin-symfony/blob/master/src/Stubs/common/Component/Messenger/Envelope.stubphp) (due to complexity of the PHPdoc).Commits-------f5a802ab85 [DependencyInjection] Add nice exception when using non-scalar parameter as array keyfa7703ba4a [ErrorHandler] Do not patch return types that are not a valid PHP type38ab6de900 Improve some PHPdocs based on existing Symfony stubs in PHPstan and Psalm
symfony-splitter pushed a commit to symfony/error-handler that referenced this pull requestAug 2, 2022
…PHPstan and Psalm (mdeboer, wouterj)This PR was merged into the 6.2 branch.Discussion----------Improve some PHPdocs based on existing Symfony stubs in PHPstan and Psalm| Q             | A| ------------- | ---| Branch?       | 6.2| Bug fix?      | no| New feature?  | no| Deprecations? | no (strictly spoken yes, as I guess DebugClassLoader will trigger deprecations for some now?)| Tickets       | Replaces #40783| License       | MIT| Doc PR        |symfony/symfony-docs#17064Todo---* [x] Review the Psalm check of this PR* [x] Test the changes with DebugClassLoader in a real appDescription---This PR adds some more information to the PHPdoc of Symfony classes. By moving the information from the current stubs of static analyzers into Symfony itself: (1) we can improve the experience for all users, (2) reduce false-positives from our own Psalm check and (3) make sure they are in sync with changes done on these classes.<s>To avoid a PR that is too big to review and maintain, the scope of this PR is deliberately kept narrow:* Only PHPdoc from either [Psalm's Symfony stubs](https://github.com/psalm/psalm-plugin-symfony/tree/master/src/Stubs) or [PHPStan's Symfony stubs](https://github.com/phpstan/phpstan-symfony/tree/1.2.x/stubs) is added* The PHPdoc MUST NOT break PHPstorm* The PHPdoc MUST be supported by both PHPstan and Psalm (those are the only two static analyzers that currently ship an official Symfony plugin afaik)* The PHPdoc SHOULD NOT duplicate anything that can already be deduced from either PHP's type declarations or already existing PHPdoc.* The PHPdoc MUST document the contract and NOT be added to fit a 95% use-case or improve auto-completion.</s>EDIT: Replaced the guidelines bysymfony/symfony-docs#17064On top of this, to get this PR approved quicker, I've left out all stubs from the Form (based on the discussions in #40783) and most of [PHPStan's `Envelope` stub](https://github.com/psalm/psalm-plugin-symfony/blob/master/src/Stubs/common/Component/Messenger/Envelope.stubphp) (due to complexity of the PHPdoc).Commits-------f5a802ab85 [DependencyInjection] Add nice exception when using non-scalar parameter as array keyfa7703ba4a [ErrorHandler] Do not patch return types that are not a valid PHP type38ab6de900 Improve some PHPdocs based on existing Symfony stubs in PHPstan and Psalm
symfony-splitter pushed a commit to symfony/messenger that referenced this pull requestAug 2, 2022
…PHPstan and Psalm (mdeboer, wouterj)This PR was merged into the 6.2 branch.Discussion----------Improve some PHPdocs based on existing Symfony stubs in PHPstan and Psalm| Q             | A| ------------- | ---| Branch?       | 6.2| Bug fix?      | no| New feature?  | no| Deprecations? | no (strictly spoken yes, as I guess DebugClassLoader will trigger deprecations for some now?)| Tickets       | Replaces #40783| License       | MIT| Doc PR        |symfony/symfony-docs#17064Todo---* [x] Review the Psalm check of this PR* [x] Test the changes with DebugClassLoader in a real appDescription---This PR adds some more information to the PHPdoc of Symfony classes. By moving the information from the current stubs of static analyzers into Symfony itself: (1) we can improve the experience for all users, (2) reduce false-positives from our own Psalm check and (3) make sure they are in sync with changes done on these classes.<s>To avoid a PR that is too big to review and maintain, the scope of this PR is deliberately kept narrow:* Only PHPdoc from either [Psalm's Symfony stubs](https://github.com/psalm/psalm-plugin-symfony/tree/master/src/Stubs) or [PHPStan's Symfony stubs](https://github.com/phpstan/phpstan-symfony/tree/1.2.x/stubs) is added* The PHPdoc MUST NOT break PHPstorm* The PHPdoc MUST be supported by both PHPstan and Psalm (those are the only two static analyzers that currently ship an official Symfony plugin afaik)* The PHPdoc SHOULD NOT duplicate anything that can already be deduced from either PHP's type declarations or already existing PHPdoc.* The PHPdoc MUST document the contract and NOT be added to fit a 95% use-case or improve auto-completion.</s>EDIT: Replaced the guidelines bysymfony/symfony-docs#17064On top of this, to get this PR approved quicker, I've left out all stubs from the Form (based on the discussions in #40783) and most of [PHPStan's `Envelope` stub](https://github.com/psalm/psalm-plugin-symfony/blob/master/src/Stubs/common/Component/Messenger/Envelope.stubphp) (due to complexity of the PHPdoc).Commits-------f5a802ab85 [DependencyInjection] Add nice exception when using non-scalar parameter as array keyfa7703ba4a [ErrorHandler] Do not patch return types that are not a valid PHP type38ab6de900 Improve some PHPdocs based on existing Symfony stubs in PHPstan and Psalm
symfony-splitter pushed a commit to symfony/security-http that referenced this pull requestAug 2, 2022
…PHPstan and Psalm (mdeboer, wouterj)This PR was merged into the 6.2 branch.Discussion----------Improve some PHPdocs based on existing Symfony stubs in PHPstan and Psalm| Q             | A| ------------- | ---| Branch?       | 6.2| Bug fix?      | no| New feature?  | no| Deprecations? | no (strictly spoken yes, as I guess DebugClassLoader will trigger deprecations for some now?)| Tickets       | Replaces #40783| License       | MIT| Doc PR        |symfony/symfony-docs#17064Todo---* [x] Review the Psalm check of this PR* [x] Test the changes with DebugClassLoader in a real appDescription---This PR adds some more information to the PHPdoc of Symfony classes. By moving the information from the current stubs of static analyzers into Symfony itself: (1) we can improve the experience for all users, (2) reduce false-positives from our own Psalm check and (3) make sure they are in sync with changes done on these classes.<s>To avoid a PR that is too big to review and maintain, the scope of this PR is deliberately kept narrow:* Only PHPdoc from either [Psalm's Symfony stubs](https://github.com/psalm/psalm-plugin-symfony/tree/master/src/Stubs) or [PHPStan's Symfony stubs](https://github.com/phpstan/phpstan-symfony/tree/1.2.x/stubs) is added* The PHPdoc MUST NOT break PHPstorm* The PHPdoc MUST be supported by both PHPstan and Psalm (those are the only two static analyzers that currently ship an official Symfony plugin afaik)* The PHPdoc SHOULD NOT duplicate anything that can already be deduced from either PHP's type declarations or already existing PHPdoc.* The PHPdoc MUST document the contract and NOT be added to fit a 95% use-case or improve auto-completion.</s>EDIT: Replaced the guidelines bysymfony/symfony-docs#17064On top of this, to get this PR approved quicker, I've left out all stubs from the Form (based on the discussions in #40783) and most of [PHPStan's `Envelope` stub](https://github.com/psalm/psalm-plugin-symfony/blob/master/src/Stubs/common/Component/Messenger/Envelope.stubphp) (due to complexity of the PHPdoc).Commits-------f5a802ab85 [DependencyInjection] Add nice exception when using non-scalar parameter as array keyfa7703ba4a [ErrorHandler] Do not patch return types that are not a valid PHP type38ab6de900 Improve some PHPdocs based on existing Symfony stubs in PHPstan and Psalm
symfony-splitter pushed a commit to symfony/console that referenced this pull requestAug 2, 2022
…PHPstan and Psalm (mdeboer, wouterj)This PR was merged into the 6.2 branch.Discussion----------Improve some PHPdocs based on existing Symfony stubs in PHPstan and Psalm| Q             | A| ------------- | ---| Branch?       | 6.2| Bug fix?      | no| New feature?  | no| Deprecations? | no (strictly spoken yes, as I guess DebugClassLoader will trigger deprecations for some now?)| Tickets       | Replaces #40783| License       | MIT| Doc PR        |symfony/symfony-docs#17064Todo---* [x] Review the Psalm check of this PR* [x] Test the changes with DebugClassLoader in a real appDescription---This PR adds some more information to the PHPdoc of Symfony classes. By moving the information from the current stubs of static analyzers into Symfony itself: (1) we can improve the experience for all users, (2) reduce false-positives from our own Psalm check and (3) make sure they are in sync with changes done on these classes.<s>To avoid a PR that is too big to review and maintain, the scope of this PR is deliberately kept narrow:* Only PHPdoc from either [Psalm's Symfony stubs](https://github.com/psalm/psalm-plugin-symfony/tree/master/src/Stubs) or [PHPStan's Symfony stubs](https://github.com/phpstan/phpstan-symfony/tree/1.2.x/stubs) is added* The PHPdoc MUST NOT break PHPstorm* The PHPdoc MUST be supported by both PHPstan and Psalm (those are the only two static analyzers that currently ship an official Symfony plugin afaik)* The PHPdoc SHOULD NOT duplicate anything that can already be deduced from either PHP's type declarations or already existing PHPdoc.* The PHPdoc MUST document the contract and NOT be added to fit a 95% use-case or improve auto-completion.</s>EDIT: Replaced the guidelines bysymfony/symfony-docs#17064On top of this, to get this PR approved quicker, I've left out all stubs from the Form (based on the discussions in #40783) and most of [PHPStan's `Envelope` stub](https://github.com/psalm/psalm-plugin-symfony/blob/master/src/Stubs/common/Component/Messenger/Envelope.stubphp) (due to complexity of the PHPdoc).Commits-------f5a802ab85 [DependencyInjection] Add nice exception when using non-scalar parameter as array keyfa7703ba4a [ErrorHandler] Do not patch return types that are not a valid PHP type38ab6de900 Improve some PHPdocs based on existing Symfony stubs in PHPstan and Psalm
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@OskarStarkOskarStarkOskarStark left review comments

@fabpotfabpotfabpot approved these changes

+2 more reviewers

@stofstofstof left review comments

@derrabusderrabusderrabus left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

8 participants

@wouterj@javiereguiluz@fabpot@nicolas-grekas@stof@OskarStark@derrabus@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp