Skip to content

Rule to check hardcoded rightnames#25

Merged
cedric-anne merged 20 commits into
mainfrom
rule-to-check-hardcoded-rightnames
Jun 24, 2026
Merged

Rule to check hardcoded rightnames#25
cedric-anne merged 20 commits into
mainfrom
rule-to-check-hardcoded-rightnames

Conversation

@SebSept

@SebSept SebSept commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

A big part was generated using a coding agent.
I reviewed the code.
Tested on a glpi (main branch).

Not tested on a 11/bugfixes branch (rule should not apply).

@SebSept SebSept self-assigned this Jun 16, 2026

@froozeify froozeify left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Using positional named parms for sprintf

Comment thread src/Rules/ForbidHardCodedRightNameRule.php Outdated
Comment thread src/Rules/ForbidHardCodedRightNameRule.php Outdated
Comment thread src/Rules/ForbidHardCodedRightNameRule.php Outdated
Comment thread src/Rules/ForbidHardCodedRightNameRule.php Outdated

@stonebuzz stonebuzz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@SebSept SebSept requested a review from froozeify June 17, 2026 09:49

@cedric-anne cedric-anne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add a test class to validate that no error is detected on earlier versions of GLPI. See https://github.com/glpi-project/phpstan-glpi/blob/main/tests/IgnoredGlpiVersion/Rules/ForbidDynamicInstantiationRuleTest.php for example.

Comment thread extension.neon Outdated
Comment thread src/Rules/ForbidHardCodedRightNameRule.php Outdated
Comment thread src/Rules/ForbidHardCodedRightNameRule.php Outdated
Comment thread src/Rules/ForbidHardCodedRightNameRule.php Outdated
Comment thread src/Rules/ForbidHardCodedRightNameRule.php Outdated
Comment thread tests/IgnoredGlpiVersion/Rules/ForbidHardCodedRightNameRuleTest.php
@SebSept SebSept requested a review from cedric-anne June 18, 2026 13:02
@SebSept SebSept force-pushed the rule-to-check-hardcoded-rightnames branch from 0ad9432 to 65abdf4 Compare June 24, 2026 09:24
Comment thread README.md Outdated
Co-authored-by: Cédric Anne <cedric.anne@gmail.com>
@SebSept

SebSept commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

sorry for the slop of readme.
fyi , running phpstan now generates 365 new errors .

@cedric-anne cedric-anne merged commit 18c21eb into main Jun 24, 2026
2 checks passed
@cedric-anne cedric-anne deleted the rule-to-check-hardcoded-rightnames branch June 24, 2026 12:15
@cedric-anne

Copy link
Copy Markdown
Member

fyi , running phpstan now generates 365 new errors .

A new release has been published. These new errors will have to be fixed in the next few weeks, before the GLPI 12.0.0 RC1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants