formers / former

A powerful form builder, for Laravel and other frameworks (stand-alone too)
https://formers.github.io/former/
1.34k stars 204 forks source link

Fixed null value deprecation #613

Closed pincombe closed 7 months ago

pincombe commented 7 months ago

Minor change to fix depreciation warning on a null string

stayallive commented 7 months ago

Wouldn't it make more sense to check for $value === null and return an empty string directly? I'm sure htmlentities is smart about it but calling it with an empty string seems a bit odd. WDYT?

pincombe commented 7 months ago

I'm more than happy switch it over to an if statement instead however the use of ?? '' seems to be the standard way that other projects within laravel are dealing with the PHP change.

I've included a link below to a search within the laravel framework for ?? '' https://github.com/search?q=org%3Alaravel+%3F%3F+%27%27&type=code

pincombe commented 7 months ago

Just to let you know i've updated to function to match your requested changes.