Closed AJenbo closed 1 year ago
Hi, this is not supported and I'm not sure it should. The view must have defined type and passed variables:
return view('components.my-component', [
'test' => $this->test
]);
E.g. the $test
in your example would throw fatal error, as is nullable and not defined since constuctor.
That's fair (and also the solution i went with). Another issue I found with components is that if i change view()
for $this->view()
it doesn't analyze the blade at all and just says there are no issues in the component.
Test fixture pull-request would the most helpful :)
Once I have grouped the various issues I will start creating a mvp project that can trigger these issues and submit it :)
Thanks :+1:
Instead of project, I mean a test fixture in here, e.g. https://github.com/TomasVotruba/bladestan/blob/b1e4a45d9180b743e74b439bf6ddb6e063986f9c/tests/Rules/LaravelViewFunctionRuleTest.php#L54, so we have it covered and see the errors :)
Well, one step at a time :)
I guess my question was answered, just maybe not the one i stated in the title :)
canvural/phpstan-blade-rule has a not in the readme:
Has this been reolved since it does not appear?
I noticed that the following will produce an error:
Variable $test might not be defined.