PHP Deprecation Warnings on null's used in @includeIf #512
Unanswered
spekkie2002
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Guys,
I'm quite new to
livewire-powergrid
. First of all: good job guys!As it is not really a bug, i don't know if i should open an issue for it, and besides that, because i'm new to powergrid, i don't feel confident enough to open a PR myself.
The problem
When you don't supply a
Footer
in thesetUp()
array, PHP throws out a few exceptions to the deprectations log.First of all, the
deprecations
channel is not set up by default, so the normal logs get quite a few extra's in it :-)Some details
php-deprecation-warnings.log shows two lines when the footer is removed from setUp():
[2022-07-18 00:00:00] local.WARNING: trim(): Passing null to parameter #1 ($string) of type string is deprecated in <path>/vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php on line 75
When digging in to it, i found it's because, for example, in footer.blade.php the
@includeIf
is supplied with a null because it is not set inSugested fix
Use
@includeWhen()
instead of@includeIf()
(docs)Let me know if i should do something :-)
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions