Closed williamdes closed 2 months ago
Same with this pattern
return $this->to('admin@xxxx.xx')
->subject('Title here:' . $this->ressourceId)
->view('email.payinFailed')
->with([
'payinId' => $this->ressourceId,
]);
41 Variable $payinId might not be defined.
rendered in: email/payinFailed.blade.php:13
@TomasVotruba I am willing to do a one time sponsoring of $50 to get this issue fixed as I really need to have phpstan working for my blade templates (incoming refactoring) Is that okay for you ?
Same with this pattern
return $this->to('admin@xxxx.xx') ->subject('Title here:' . $this->ressourceId) ->view('email.payinFailed') ->with([ 'payinId' => $this->ressourceId, ]);
This one might be simple to solve since it's supported on the global view()
function: https://github.com/TomasVotruba/bladestan/blob/53e514cd891ed059a7f8259edd6f5165fe4a23f6/tests/Rules/Fixture/laravel-view-function.php#L22
@williamdes Thanks :+1: Make sure you sponsor @AJenbo, he's the main contributor last couple of years :muscle:
I'm not really setup to take sponsor ships and I maintain it though my employer so not sure how that would work. If any one else is interested in implementing the feature and receiving the sponsor ship then I'm at least happy to do review and support of it.
I'm not really setup to take sponsor ships and I maintain it though my employer so not sure how that would work. If any one else is interested in implementing the feature and receiving the sponsor ship then I'm at least happy to do review and support of it.
Definitely check if you can setup GH sponsors or send me a PayPal link for a donation 👍👍💪
Sorry this conflicts with my employment.
Sorry this conflicts with my employment.
That's okay, I totally understand
What's your horizon on needing this ?
What's your horizon on needing this ?
I would say this week of the next one I did not find a phpdoc hack to workaround this bug :/ Definitely feeling terrible for putting deadlines on an open source project..
If no one picks up the bounty I might take a stab at it in the next 2-3 weeks.
Met @AJenbo at a conference as he is my old coworker, someone talked about PHPParsing, this was mentioned and i gave it a try with this PR. There was some new challenges compared to some of the other analyzers they made, so we probably need some changes to make it more "non hacky".
But there is hope out there and the testcase i made passed, similar to the first example you had, if we get that PR moving i would gladly take a look at the other example you presented.
Awesome @mrhn Let me know when you want that I test the PR, even in draft state I made a separate baseline file so it's easy to spot un handled cases
Same with this pattern
return $this->to('admin@xxxx.xx') ->subject('Title here:' . $this->ressourceId) ->view('email.payinFailed') ->with([ 'payinId' => $this->ressourceId, ]);
41 Variable $payinId might not be defined. rendered in: email/payinFailed.blade.php:13
With out knowing what class type this code appears in we won't really know what the issue might be here or how to solve it. I'm guessing it's a Illuminate\Mail\Mailable
? Have you tried changing the code to this:
$this->to('admin@xxxx.xx') ->subject('Title here:' . $this->ressourceId); return $this->view('email.payinFailed') ->with([ 'payinId' => $this->ressourceId, ]);
If that works then it's more likely that the return value of to()
or subject()
are not properly hinted in Laravel/Larastan and so the call to view()
looks like it's not a known blade function.
Fixed by https://github.com/TomasVotruba/bladestan/pull/108
(support for Illuminate\Mail\Mailable::view()->with()
will be tracked separately)
It says
But if I use:
There is no more error