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

Only rendered blade files are checked #2

Closed
szepeviktor opened this issue Mar 4, 2023 · 9 comments
Closed

Only rendered blade files are checked #2

szepeviktor opened this issue Mar 4, 2023 · 9 comments

Comments

@szepeviktor
Copy link
Contributor

szepeviktor commented Mar 4, 2023

From TomasVotruba/tomasvotruba.com#1384 (comment)

I'm not sure.

parameters:
    paths:
        - app/View/
    level: 0
    templatePaths:
        - resources/views/

with this configuration blade files are not checked.

parameters:
    paths:
        - resources/views/
    level: 0
    # phpstan for blade
    templatePaths:
        - resources/views/

this works.

@TomasVotruba
Copy link
Owner

TomasVotruba commented Mar 4, 2023

I have no idea how the package works now. I'll need a reproducer test case with failing CI.

@szepeviktor
Copy link
Contributor Author

May I contribute my default CI workflows?
They are very long but 3 years of maintenance is included.

@TomasVotruba
Copy link
Owner

TomasVotruba commented Mar 4, 2023

Give me a day or two to make CI pass first. I'm still rebooting package I've dperecated a year ago :)

https://packagist.org/packages/symplify/template-phpstan-compiler

If you come on Monday, that would be more useful for me 👍

@szepeviktor
Copy link
Contributor Author

Got it! When used with nunomaduro/larastan Blade files are ignored.
Larastan makes Bladestan ignore them.

@TomasVotruba
Copy link
Owner

That's not it.

The testing PR uses both larastan and bladestan: TomasVotruba/tomasvotruba.com#1387

@szepeviktor
Copy link
Contributor Author

szepeviktor commented Mar 7, 2023

That PR does not set templatePaths, so only blade files in view() calls are checked.

...no, we have a default path.

I need to implement e2e testing. That will show this problem.

@AJenbo
Copy link
Collaborator

AJenbo commented Mar 18, 2023

It might be good to look at how Larastan find view-strings and use a similar way to determin if it's a template that should be analyzed. From what I can see it looks like email templates are also not analyzed since they do not use view(), the same is true when a component uses $this->view() instead of view().

@TomasVotruba
Copy link
Owner

Closing as this is now mixing many various issues and getting messy :)

To re-open, please provide reproducer first, even if Github repository 👍

@szepeviktor
Copy link
Contributor Author

this is now mixing many various issues and getting messy :)

Yes!

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

No branches or pull requests

3 participants