Skip to content

Lint: Register ++/-- increment/decrement in UnsupportedRegistry (#300)#317

Merged
PurHur merged 1 commit into
masterfrom
issue-300-lint-increment-registry
May 19, 2026
Merged

Lint: Register ++/-- increment/decrement in UnsupportedRegistry (#300)#317
PurHur merged 1 commit into
masterfrom
issue-300-lint-increment-registry

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 19, 2026

Summary

  • Map Expr_PreInc, Expr_PostInc, Expr_PreDec, Expr_PostDec to tracking issue Language: Pre/post increment and decrement (++/--) #137 in UnsupportedRegistry.
  • Add IncrementDetector AST pass so phpc lint reports ++/-- even though php-cfg lowers them to assign+binary ops before compile.
  • Extend LintTest, UnsupportedRegistryTest, and docs/unsupported-syntax.md.

Test plan

  • vendor/bin/phpunit --filter 'UnsupportedRegistryTest|LintTest' (Docker php-compiler:22.04-dev)
  • ./phpc lint -r '++$i;' prints #137
  • php script/bootstrap-inventory.php --check

Closes #300

Made with Cursor

php-cfg lowers increment/decrement before compile, so add an AST pass in
IncrementDetector so phpc lint reports Expr_PreInc/PostInc/PreDec/PostDec
with tracking issue #137 until #137 implements pre/post semantics.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit 178ce1c into master May 19, 2026
1 check failed
@PurHur PurHur deleted the issue-300-lint-increment-registry branch May 19, 2026 18:12
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.

Lint: Register ++/-- increment/decrement in UnsupportedRegistry

1 participant