Skip to content

Fix invalid path#3345

Merged
TomasVotruba merged 4 commits intorectorphp:masterfrom
ddziaduch:patch-1
May 17, 2020
Merged

Fix invalid path#3345
TomasVotruba merged 4 commits intorectorphp:masterfrom
ddziaduch:patch-1

Conversation

@ddziaduch
Copy link
Copy Markdown
Contributor

Generator was not working

Generator was not working
{
$robotLoader = new RobotLoader();
$robotLoader->addDirectory(__DIR__ . '/../../../../vendor/nikic/php-parser/lib/PhpParser/Node');
$robotLoader->addDirectory(__DIR__ . '/../../../../../../nikic/php-parser/lib/PhpParser/Node');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is working in the main repository.
It's probably because it's installed as dependency. The best would be to support both locations.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it @TomasVotruba

Should I add condition here with file_exists() call?

Copy link
Copy Markdown
Member

@TomasVotruba TomasVotruba May 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add whatever works

@TomasVotruba
Copy link
Copy Markdown
Member

Btw, what do you need this for outside the main repository?

@ddziaduch
Copy link
Copy Markdown
Contributor Author

@TomasVotruba I wanted to create new Rector for my project :)

ddziaduch added 3 commits May 13, 2020 16:51
Current solution didn't work when I tried to generate rector when it was used as my project dependency.
This fix aims to support both solutions - as project dependency or as standalone project.
As per PR
@TomasVotruba TomasVotruba merged commit e1bf109 into rectorphp:master May 17, 2020
@TomasVotruba
Copy link
Copy Markdown
Member

Thanks 👍

@ddziaduch ddziaduch deleted the patch-1 branch May 17, 2020 18:54
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.

2 participants