lukas-frey / filament-icon-picker

An icon picker field for Filament
MIT License
106 stars 20 forks source link

Bug: Upgrading to Filament v3.2.74 breaks the package #36

Closed thecrazybob closed 4 months ago

thecrazybob commented 4 months ago

Downgrading filament/filament to v3.2.73 from v3.2.74 fixes the issue

> @php artisan package:discover --ansi

   Symfony\Component\ErrorHandler\Error\FatalError

  Declaration of Guava\FilamentIconPicker\Forms\IconPicker::createOptionUsing(Closure $callback): static must be compatible with Filament\Forms\Components\Select::createOptionUsing(?Closure $callback): static

  at vendor/guava/filament-icon-picker/src/Forms/IconPicker.php:195
    191▕     {
    192▕         throw new \BadMethodCallException('Method not allowed.');
    193▕     }
    194▕
  ➜ 195▕     public function createOptionUsing(Closure $callback): static
    196▕     {
    197▕         throw new \BadMethodCallException('Method not allowed.');
    198▕     }
    199▕

   Whoops\Exception\ErrorException

  Declaration of Guava\FilamentIconPicker\Forms\IconPicker::createOptionUsing(Closure $callback): static must be compatible with Filament\Forms\Components\Select::createOptionUsing(?Closure $callback): static

  at vendor/guava/filament-icon-picker/src/Forms/IconPicker.php:195
    191▕     {
    192▕         throw new \BadMethodCallException('Method not allowed.');
    193▕     }
    194▕
  ➜ 195▕     public function createOptionUsing(Closure $callback): static
    196▕     {
    197▕         throw new \BadMethodCallException('Method not allowed.');
    198▕     }
    199▕

      +1 vendor frames

  2   [internal]:0
      Whoops\Run::handleShutdown()

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255
LucasVieira2902 commented 4 months ago

same here

curder commented 4 months ago

Modify the parameters of the createOptionUsing method in the IconPicker class, like this:

public function createOptionUsing(?Closure $callback): static
{
    throw new BadMethodCallException('Method not allowed.');
}
lukas-frey commented 4 months ago

thanks, fixed in 2.2.1