Skip to content

[PhpParser] Re-add back get value from __DIR__ and __FILE__ on ValueResolver#6756

Merged
samsonasik merged 3 commits intomainfrom
re-add-back-dir-file
Feb 24, 2025
Merged

[PhpParser] Re-add back get value from __DIR__ and __FILE__ on ValueResolver#6756
samsonasik merged 3 commits intomainfrom
re-add-back-dir-file

Conversation

@samsonasik
Copy link
Copy Markdown
Member

@samsonasik samsonasik commented Feb 24, 2025

@samsonasik
Copy link
Copy Markdown
Member Author

@TomasVotruba this is bring test on first commit for rectorphp/rector#9035, without the patch, the result test will failure:

There was 1 failure:

1) Rector\Tests\Issues\GetValueMagicDir\GetValueMagicDirTest::test with data set #0 ('/home/runner/work/rector-src/...hp.inc')
Failed on fixture file "fixture.php.inc"
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
 {
     public function run()
     {
-        'tests/Issues/GetValueMagicDir/Fixture';
-        'tests/Issues/GetValueMagicDir/Fixture/fixture.php';
+        '__DIR__';
+        '__FILE__';

see https://github.com/rectorphp/rector-src/actions/runs/13496093011/job/37703584689?pr=6756

@samsonasik
Copy link
Copy Markdown
Member Author

samsonasik commented Feb 24, 2025

Fixed /cc @jtojnar with add back CurrentFileProvider to it ;) 8ca2ffd

@samsonasik
Copy link
Copy Markdown
Member Author

Add more use case for array add more use case for inside array

@samsonasik
Copy link
Copy Markdown
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit c09dd52 into main Feb 24, 2025
44 checks passed
@samsonasik samsonasik deleted the re-add-back-dir-file branch February 24, 2025 11:04
@TomasVotruba
Copy link
Copy Markdown
Member

👍

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ValueResolver confused by __DIR__ constant

3 participants