Skip to content

Add 3 PHP 8.2 compatibility rules#6

Open
mladenovic-13 wants to merge 1 commit into
mainfrom
feat/php-compat-82-rules
Open

Add 3 PHP 8.2 compatibility rules#6
mladenovic-13 wants to merge 1 commit into
mainfrom
feat/php-compat-82-rules

Conversation

@mladenovic-13

Copy link
Copy Markdown
Collaborator

Add three PHP 8.2 compatibility rules gated behind minPhpVersion: '8.2'.

Summary

  • php-compat-utf8-encode — detects deprecated utf8_encode()/utf8_decode(), suggests mb_convert_encoding()
  • php-compat-dollar-brace — detects deprecated "${var}" interpolation syntax, suggests "{$var}"
  • php-compat-dynamic-properties — detects undeclared property assignments with class-level declaration tracking, respects #[AllowDynamicProperties] attribute
  • 14 new tests (4 + 4 + 6), including version-gating tests for PHP 8.1 (should not flag)
  • Vulnerable example module (deprecated_php82.php) for CLI demo
  • Updated RULES.md (32 → 35 rules, PHP section 17 → 20)

Type of Change

  • New rule
  • Documentation update

Checklist

  • npm run validate passes (lint + typecheck + tests + build)
  • New rules have positive and negative test cases
  • Documentation updated if needed
  • No any types introduced

Add php-compat-utf8-encode (detects deprecated utf8_encode/utf8_decode),
php-compat-dollar-brace (detects deprecated "${var}" interpolation), and
php-compat-dynamic-properties (detects undeclared property assignments
with class-level declaration tracking, respects #[AllowDynamicProperties]).
All gated behind minPhpVersion: '8.2'.
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.

1 participant