-
-
Notifications
You must be signed in to change notification settings - Fork 190
[Latte PHPStan compiler] Added support for another filters - function calls and custom filters #3699
[Latte PHPStan compiler] Added support for another filters - function calls and custom filters #3699
Conversation
… calls and custom filters
@@ -1,3 +1,9 @@ | |||
parameters: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure where to store parameters and parametersSchema if the service using them is here
...es/latte-phpstan-compiler/src/PhpParser/NodeVisitor/MagicFilterToExplicitCallNodeVisitor.php
Outdated
Show resolved
Hide resolved
packages/latte-phpstan-compiler/tests/LatteToPhpCompiler/Fixture/custom_filters.latte
Outdated
Show resolved
Hide resolved
I'll see. Could you add a separate PR so it's clear what is related code and test? |
I've changed approach - all non static filter can have its own variable registered. It works like a charm! |
@TomasVotruba PR is ready for review, do you need some more info? |
packages/latte-phpstan-compiler/tests/LatteToPhpCompiler/latte_to_php_compiler_test.neon
Outdated
Show resolved
Hide resolved
@TomasVotruba all done, please check again |
latteFilters: | ||
customFilter: [Symplify\LattePHPStanCompiler\Tests\LatteToPhpCompiler\Source\StaticFilter, process] | ||
translate: [Nette\Localization\Translator, translate] | ||
asdf: qwerty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😆 👏
Thank you, I think is good to go 👍 |
I have to merge this one first #3711, so the "Update branch" is build on clean "main". There are couple bugs in Rector/PHPStan 1.0 fixed |
Thanks for the feature I've noticed after merge the docs update is missing. Could you add couple of lines to README.md to let people now how to use it? Thanks |
Sure, I wanted to do so but there is just big todo in latte-phpstan-compiler and also phpstan-latte-rules :) I would place it to phpstan-latte-rules. Do you agree? |
Yes, that's the best place IMO 👍 |
done #3737 |
function calls from Latte\Runtime\Defaults like
were ignored. Now they are implemented
custom filters (or also nette filter translate) were ignored too. This PR adds support for them by config %latteTemplateFilters% where can be definded static, non-static and also function call filters
For non-static calls I'm trying to add php doc over call, but no success
Do you have any idea how to achieve this?