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

Report when a template cannot be found #56

Open
AJenbo opened this issue May 4, 2023 · 0 comments
Open

Report when a template cannot be found #56

AJenbo opened this issue May 4, 2023 · 0 comments

Comments

@AJenbo
Copy link
Contributor

AJenbo commented May 4, 2023

Currently the package simply ignores when a template cannot be found and just assumes it's an empty file.

} catch (Throwable) {

If we instead throw a PHPStan\AnalysedCodeException we could report issues like these back to the user.

I gave it a quick go and it looked to work well, the only issue was that I couldn't figure out how to make this test happy since it tries to include a non existing file and I can't figure out what path it is looking in so couldn't add a file for it either.

https://github.com/TomasVotruba/bladestan/blob/main/tests/Compiler/BladeToPHPCompiler/Fixture/basic_include.blade.php#L1

But maybe it would also be better to not stop processing but simply report the issue and continue as we du currently. But I don't know how to do so 😅

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

1 participant