Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting type error using the Rating field in Nova #18

Open
axelitus opened this issue Feb 14, 2021 · 5 comments · May be fixed by #19
Open

Getting type error using the Rating field in Nova #18

axelitus opened this issue Feb 14, 2021 · 5 comments · May be fixed by #19

Comments

@axelitus
Copy link

axelitus commented Feb 14, 2021

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 ?.

@ImJustToNy
Copy link

Having same problem.

@axelitus axelitus linked a pull request Feb 21, 2021 that will close this issue
@nicolaeum
Copy link

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

Thanks

@axelitus
Copy link
Author

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)

@infostreams
Copy link

@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.

@airdev-web
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants