Skip to content

refactor(php82): use PHP 8.2 idioms - #304

Merged
TheWitness merged 2 commits into
Cacti:developfrom
somethingwithproof:chore/php82-floor
Dec 3, 2026
Merged

TheWitness merged 2 commits into
Cacti:developfrom
somethingwithproof:chore/php82-floor

Conversation

@somethingwithproof

Copy link
Copy Markdown
Member

Closes #303.

Uses ??=, arrow functions, first-class callables and str_starts_with. No behaviour change.

Commits:

  • refactor(php82): use ??=, str_contains, str_starts_with, arrow functions and first-class callables

Tests

The plugin test suite passes on PHP 8.2, 8.4 and 8.5, php -l is clean on all three, PHPStan reports the same messages as before, and every changed line is covered by tests. Any switch turned into match compares values that are already integers or strings at every caller, so the strict comparison changes nothing.

…ons and first-class callables

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@sonarqubecloud

sonarqubecloud Bot commented Dec 3, 2026

Copy link
Copy Markdown

@TheWitness TheWitness 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.

Reviewed: behavior-preserving PHP 8.2 idiom refactor, CI green. LGTM.

@TheWitness
TheWitness merged commit 9cc6955 into Cacti:develop Dec 3, 2026
9 checks passed
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.

Use PHP 8.2 idioms

2 participants