laravel-caffeine icon indicating copy to clipboard operation
laravel-caffeine copied to clipboard

Deprecation warning using with PHP 8.1

Open liepumartins opened this issue 3 years ago • 3 comments

Expected Behavior

No warnings

Actual Behavior

Deprecation warning

Environment

  • PHP Version: 8.1
  • Laravel Version: 9.3.1
  • LaravelCaffeine Version: 9.0.2

Stack Trace

LOG.warning: trim(): Passing null to parameter #1 ($string) of type string is deprecated in 
/home/vagrant/laravel9/vendor/genealabs/laravel-caffeine/src/Dripper.php on line 41

liepumartins avatar Mar 07 '22 12:03 liepumartins

Hi @liepumartins, thanks for reporting this. This warning seems to indicate that the config values are not being loaded. Could it be your project isn't set up correctly? Would you mind providing a public repo that replicates the issue?

Thanks!

mikebronner avatar Mar 07 '22 13:03 mikebronner

Config file defines the key domain as null by default. https://github.com/GeneaLabs/laravel-caffeine/blob/4df612b77e08cd7d93eee79ed74bbf2f7ca1ff4a/config/genealabs-laravel-caffeine.php#L32 Passing this null to trim() causes this warning in php8.1

I have not customized this setting.

liepumartins avatar Mar 07 '22 13:03 liepumartins

Ah, yes, thanks!

mikebronner avatar Mar 07 '22 13:03 mikebronner