Closed
Description
Split off from #163
Acceptance criteria
- Missing @method annotations are picked up by CI (e.g. using phpstan or psalm)
- Extra @method annotations that don't relate to anything on the class are picked up by CI (e.g. using phpstan or psalm)
- Update PHP Codding standards to mentioned @method annotation.
- All supported modules run this new check in CI for their CMS 5 compatible versions (not CMS 4)
Notes
- This will need to handle
get_extra_config()
in extensions (see MNT Update @methods on class docblocks silverstripe-framework#11092 (comment)) - https://github.com/syntro-opensource/silverstripe-phpstan has some useful code to take inspiration from
- I've created https://github.com/silverstripe/silverstripe-standards for this to live in
- There's an error running phpstan against some classes in framework - see Internal error while analysing file (but no details about what the error actually IS) phpstan/phpstan#10509
PRs
Note: After merging the below, reassign to Guy so they can add this to packagist and roll it out to all the CMS 5 supported modules
- ENH Don't include installer if it's not needed gha-generate-matrix#76
- NEW Add method annotation checks silverstripe-standards#1
- MNT Add silverstripe-standards repo rhino#11
- MNT Add silverstripe-standards repo module-standardiser#31
- MNT Add silverstripe-standards repo github-issue-search-client#131
- DOC Document PHPDoc as a PHP coding standard developer-docs#448
- NEW Add script for setting phpstan config module-standardiser#33
- MNT Allow script for PHPstan extensions gha-ci#101
Module Standardiser PRs
Note: For any PR that had outstanding PHPLint issues, I've manually fixed whatever needed to be fixed as a separate commit.
Note that these had to be run against the 5
(or equivalent) branches because the @method
annotation rule doesn't work correctly against the codebase if the generic types aren't available - and those were merged into the 5
(or equivalent) branches.
- MNT Run module-standardiser silverstripe-framework#11121
- MNT Run module-standardiser bringyourownideas/silverstripe-maintenance#210
- MNT Run module-standardiser bringyourownideas/silverstripe-composer-update-checker#80
- MNT Run module-standardiser silverstripe-gridfield-bulk-editing-tools#265
- MNT Run module-standardiser cwp-agencyextensions#112
- MNT Run module-standardiser cwp-starter-theme#242
- MNT Run module-standardiser developer-docs#453
- MNT Run module-standardiser cwp-watea-theme#178
- MNT Run module-standardiser silverstripe-elemental#1141
- MNT Run module-standardiser dnadesign/silverstripe-elemental-userforms#87
- MNT Run module-standardiser silverstripe-admin#1669
- MNT Run module-standardiser silverstripe-asset-admin#1438
- MNT Run module-standardiser silverstripe-assets#589
- MNT Run module-standardiser silverstripe-auditor#69
- MNT Run module-standardiser silverstripe-blog#741
- MNT Run module-standardiser silverstripe-campaign-admin#293
- MNT Run module-standardiser silverstripe-cms#2919
- MNT Run module-standardiser silverstripe-config#109
- MNT Run module-standardiser silverstripe-contentreview#222
- MNT Run module-standardiser silverstripe-crontask#85
- MNT Run module-standardiser silverstripe-documentconverter#68
- MNT Run module-standardiser silverstripe-elemental-bannerblock#133
- MNT Run module-standardiser silverstripe-elemental-fileblock#49
- MNT Run module-standardiser silverstripe-environmentcheck#98
- MNT Run module-standardiser silverstripe-errorpage#97
- MNT Run module-standardiser silverstripe-externallinks#119
- MNT Run module-standardiser silverstripe-graphql#570
- MNT Run module-standardiser silverstripe-gridfieldqueuedexport#97
- MNT Run module-standardiser silverstripe-hybridsessions#98
- MNT Run module-standardiser silverstripe-iframe#79
- MNT Run module-standardiser silverstripe-installer#365
- MNT Run module-standardiser silverstripe-ldap#69
- MNT Run module-standardiser silverstripe-lumberjack#139
- MNT Run module-standardiser silverstripe-mimevalidator#71
- MNT Run module-standardiser silverstripe-realme#130
- MNT Run module-standardiser silverstripe-session-manager#180
- MNT Run module-standardiser recipe-authoring-tools#32
- MNT Run module-standardiser recipe-blog#48
- MNT Run module-standardiser recipe-cms#81
- MNT Run module-standardiser recipe-collaboration#28
- MNT Run module-standardiser recipe-content-blocks#37
- MNT Run module-standardiser recipe-core#91
- MNT Run module-standardiser recipe-form-building#31
- MNT Run module-standardiser recipe-plugin#38
- MNT Run module-standardiser recipe-reporting-tools#40
- MNT Run module-standardiser recipe-services#31
- MNT Run module-standardiser silverstripe-registry#92
- MNT Run module-standardiser silverstripe-reports#174
- MNT Run module-standardiser silverstripe-restfulserver#118
- MNT Run module-standardiser silverstripe-securityreport#74
- MNT Run module-standardiser silverstripe-segment-field#97
- MNT Run module-standardiser silverstripe-sharedraftcontent#224
- MNT Run module-standardiser silverstripe-siteconfig#154
- MNT Run module-standardiser silverstripe-sitewidecontent-report#80
- MNT Run module-standardiser silverstripe-spamprotection#110
- MNT Run module-standardiser silverstripe-staticpublishqueue#184
- MNT Run module-standardiser silverstripe-subsites#556
- MNT Run module-standardiser silverstripe-tagfield#279
- MNT Run module-standardiser silverstripe-taxonomy#104
- MNT Run module-standardiser silverstripe-textextraction#88
- MNT Run module-standardiser silverstripe-userforms#1264
- MNT Run module-standardiser vendor-plugin#73
- MNT Run module-standardiser silverstripe-versioned#433
- MNT Run module-standardiser silverstripe-versioned-admin#321
- MNT Run module-standardiser silverstripe-versionfeed#98
- MNT Run module-standardiser symbiote/silverstripe-advancedworkflow#518
- MNT Run module-standardiser symbiote/silverstripe-gridfieldextensions#380
- MNT Run module-standardiser symbiote/silverstripe-multivaluefield#102
- MNT Run module-standardiser symbiote/silverstripe-queuedjobs#418
- MNT Run module-standardiser tractorcow-farm/silverstripe-fluent#821
- MNT Run module-standardiser silverstripe-mfa#526
- MNT Run module-standardiser silverstripe-totp-authenticator#144
- MNT Run module-standardiser silverstripe-webauthn-authenticator#168
- MNT Run module-standardiser silverstripe-login-forms#164
- MNT Run module-standardiser silverstripe-dynamodb#59
- MNT Run module-standardiser gha-ci#103
- MNT Run module-standardiser markdown-php-codesniffer#7
- MNT Run module-standardiser silverstripe-standards#3