nikaia / nova-rating-field

A Star rating field to use in your Laravel Nova apps.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting type error using the Rating field in Nova

axelitus opened this issue · comments

I am getting the following error in PHP 8:
Type mixed cannot be marked as nullable since mixed already includes null at ./vendor/nikaia/nova-rating-field/src/Rating.php:43

I checked your file and the constructor signatures is public function __construct(string $name, $attribute = null, ?mixed $resolveCallback = null) and the offending part is ?mixed as mixed already contains null, so no need to add the ?.

Having same problem.

Hi guys! any news? How did you fix it until the pull request get approved?

Thanks

I'm not using an alternative right now, I'm waiting and focusing on other parts of my development.

The solutions that I see right now are:

  1. Use the code here and add a nova field "manually" to your codebase and do the changes there.
  2. Fork this repo, do the changes and publish your own nova-rating-field from your own repo. (that's what @Abdukhaligov ended up doing here: https://github.com/Abdukhaligov/nova-rating-field)

@nikaia You should really accept this pull request, because your package is BROKEN on PHP8 because of a single ?.

In the mean time, until @nikaia accepts this pull request, you can use something like vendor-patches to patch this bug yourselves.

Please can you update this bug ?
Some time lost for only one commit...