Skip to content

Lint: constant-fold __DIR__ concatenation for include graph (#462)#467

Merged
PurHur merged 1 commit into
masterfrom
issue-462-dir-include-lint
May 21, 2026
Merged

Lint: constant-fold __DIR__ concatenation for include graph (#462)#467
PurHur merged 1 commit into
masterfrom
issue-462-dir-include-lint

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 21, 2026

Summary

  • Pass the including file path into ConstStringFolder::foldForInclude() so lint follows __DIR__ . '/…' include/require edges (MiniWebApp and compliance fixture).
  • Add ConstStringFolderTest and PhpcLintProjectTest::testLintMiniWebAppHasNoDynamicIncludeWarnings.
  • Document static vs dynamic include graph behavior in docs/unsupported-syntax.md and refresh examples/003-MiniWebApp/README.md.

Test plan

  • phpunit --filter 'ConstStringFolderTest|PhpcLintProjectTest::testLintMiniWebApp|MiniWebAppSkeletonTest|IncludeLiteralTest::testLint' (Docker php-compiler:22.04-dev)
  • php bin/lint.php --all examples/003-MiniWebApp — no dynamic include/require on stderr; class/method blockers remain (Language: Class methods and property access in JIT #58)

Closes #462

Made with Cursor

Pass the including file into ConstStringFolder so phpc lint --all recurses
through MiniWebApp __DIR__ requires/includes without dynamic-include warnings.
Add unit tests and document static vs dynamic include graph behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit e0cdd02 into master May 21, 2026
@PurHur PurHur deleted the issue-462-dir-include-lint branch May 21, 2026 17:23
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: Constant-fold __DIR__ concatenation for include/require graph in phpc lint --all

1 participant