Skip to content

[CakePHPToSymfony] Add h function templates#2718

Merged
TomasVotruba merged 3 commits intomasterfrom
cakephp-templates
Jan 20, 2020
Merged

[CakePHPToSymfony] Add h function templates#2718
TomasVotruba merged 3 commits intomasterfrom
cakephp-templates

Conversation

@TomasVotruba
Copy link
Copy Markdown
Member

Ref #2705

@TomasVotruba TomasVotruba merged commit 8f8d44b into master Jan 20, 2020
@TomasVotruba TomasVotruba deleted the cakephp-templates branch January 20, 2020 05:16
@afilina
Copy link
Copy Markdown
Contributor

afilina commented Mar 2, 2020

@TomasVotruba This rector doesn't actually work. $this->doTestFileWithoutAutoload($file); is a trick that makes the test pass, but there's no way to skip the require_once in a real run.

All templates are causing fatal errors. I tried to run CakePHPTemplateHToTwigRector on the exact same file as in the test:

<li>
    <?php echo $this->Html->link(__('List Rights'), ['action' => 'index']); ?>
</li>

and got this:

Fatal error: Uncaught Error: Call to a member function link() on null in ...

Demo: https://getrector.org/demo/31b1dd02-917e-4ac2-a8c5-0a60d41cb1f8#result

@TomasVotruba
Copy link
Copy Markdown
Member Author

TomasVotruba commented Mar 2, 2020

but there's no way to skip the require_once in a real run.

Apperantly it can work in tests... What would you suggest to make this work in Rector run itself?

@afilina
Copy link
Copy Markdown
Contributor

afilina commented Mar 2, 2020

I have no idea how it works deep down. I don't have any design documents and there's too much code to randomly go digging. We need the ability for a file to be the target of a rector without being force to require_once it.

@TomasVotruba
Copy link
Copy Markdown
Member Author

TomasVotruba commented Mar 2, 2020

Could add minimal failing test case to Github Actions?
I'll try to dig it out and make it work

TomasVotruba added a commit that referenced this pull request Jul 28, 2022
rectorphp/rector-src@ec9c15a Apply ParametersAcceptorSelectorVariantsWrapper::select() take 2 (#2718)
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