ConsoleTVs / Profanity

PHP library to block bad words in a string
MIT License
104 stars 45 forks source link

PHP 8.1 exception with illuminate/support 5.4.36 #23

Open ossigeno opened 2 years ago

ossigeno commented 2 years ago

The badWords() function throws an exception in PHP 8.1

public function badWords()
    {
       // exception thrown here:
       return collect($this->dictionary)->filter(function ($value) {

        })->toArray();
    }

ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

I tried to update illuminate/contracts and illuminate/support to v 8.78 but get this issue:

Problem 1