bootstrap-form icon indicating copy to clipboard operation
bootstrap-form copied to clipboard

Fixing the HtmlString labels in latest versions of PHP

Open nocodelab opened this issue 2 years ago • 4 comments

With this pull request the package is now compatible with the latest versions of PHP 8.*. The HTML labels were not rendered due to non-compatible type declarations in label-related methods. Enjoy!

nocodelab avatar Mar 24 '22 15:03 nocodelab

Isn't this new typehinting syntax only supported in PHP 8.1? I would need to bump up the supported versions if so.

dwightwatson avatar Mar 24 '22 22:03 dwightwatson

Ciao @dwightwatson, yes you are right. Supported PHP version needs to be updated as well.

nocodelab avatar Mar 25 '22 17:03 nocodelab

Ciao @dwightwatson, I have updated the composer.json with the PHP 8.1 version bump. Can you please merge it?

Thanks!

nocodelab avatar Mar 31 '22 17:03 nocodelab

Thanks for that. I'm still debating whether this is a change I want to make as it's quite dramatic.

I think we'd need 4 things in order to merge this:

  • Drop support for Laravel 8.x - if it's going to target PHP 8.1 we may as well forward-focus this,
  • Instead of HtmlString we should probably use the Htmlable interface instead,
  • The Htmlable interface needs to be imported into the file (HtmlString is not, so it wouldn't work as-is), and
  • It needs to test coverage for all affected methods to ensure they work with the new argument type.

dwightwatson avatar Apr 01 '22 00:04 dwightwatson