PHP 8.3: New sniff to detect dynamic class constant fetch by afilina · Pull Request #1974 · PHPCompatibility/PHPCompatibility

added 2 commits

October 30, 2025 10:37

@jrfnl jrfnl changed the title Dynamic class constant fetch PHP 8.3 | New sniff to detect dynamic class constant fetch

Oct 30, 2025

@afilina

@afilina

@afilina

The three groups of tests are:
- Explicitly targeted by the sniff and found on unsupported version
- Same above, but not found on supported versions
- Cases that are not the sniff's target, but using similar tokens or syntax that might throw false positives

Added a parse error test case, since PHPCS can be used as a plugin, and so will run on code still being typed (live coding).

@jrfnl jrfnl mentioned this pull request

Oct 31, 2025

35 tasks

@afilina

@afilina afilina changed the title PHP 8.3 | New sniff to detect dynamic class constant fetch PHP 8.3: New sniff to detect dynamic class constant fetch

Nov 14, 2025
Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com>
Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com>
Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com>
Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com>
Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com>
Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com>
Co-authored-by: Juliette <663378+jrfnl@users.noreply.github.com>

@afilina

@afilina

@afilina

@afilina

jrfnl

@afilina

@afilina

jrfnl

@afilina

@jrfnl jrfnl mentioned this pull request

Nov 19, 2025

@jrfnl

@jrfnl

…sts to their own test files
…move test down

... to comply with expected order of the test methods.
* Add missing line numbers to data provider
* Add one extra test case
* Fix tag order in test docblocks.
* Use proper punctuation in inline comments in sniff.
* Use FQN class refs in docblocks.

@afilina afilina deleted the dynamic-class-constant-fetch branch

November 25, 2025 20:27