emilianotisato / nova-tinymce

Laravel Nova TinyMCE editor (with images upload capabilities!)
MIT License
116 stars 38 forks source link

Mixed types cannot be nullable, 'null' is already part of the mixed type #81

Closed stan-the-man closed 1 year ago

stan-the-man commented 2 years ago

in line 19 of NovaTinyMCE.php the constructor enforces a type of mixed see below:

    public function __construct(string $name, ?string $attribute = null, ?mixed $resolveCallback = null)
    {
        parent::__construct($name, $attribute, $resolveCallback);

using laravel 9, nova 3.32, and php 8.1 we see a linting error of Mixed types cannot be nullable, 'null' is already part of the mixed type which will throw an error any time an instance of NovaTinyMCE is used in our Nova pages.

to fix this, you can simply remove the null check in front of mixed like so:

    public function __construct(string $name, ?string $attribute = null, mixed $resolveCallback = null)
    {
        parent::__construct($name, $attribute, $resolveCallback);