Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Feb 24, 2025

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Feb 24, 2025

@samsonasik
Copy link
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
Member Author

samsonasik commented Feb 24, 2025

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

@samsonasik
Copy link
Member Author

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

@samsonasik
Copy link
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
Member

👍

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.

ValueResolver confused by __DIR__ constant
3 participants