juanantoniodelgado / StopWords

PHP StopWords removal library with support for multiple languages.
https://packagist.org/packages/juanantoniodelgado/stopwords
Creative Commons Attribution 4.0 International
7 stars 8 forks source link

in_array type error: Second argument ( $haystack ) must be of type array, null given. #14

Closed adinan-cenci closed 1 month ago

adinan-cenci commented 1 month ago

Overview

Happening under PHP 8.1

TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in vendor/juanantoniodelgado/stopwords/src/Cache.php on line 64 

#0 vendor/juanantoniodelgado/stopwords/src/Cache.php(64): in_array('pt', NULL)
#1 vendor/juanantoniodelgado/stopwords/src/Cache.php(39): StopWords\Cache->inHandlers('pt')

A downcast to array should fix it, me thinks.

adinan-cenci commented 1 month ago

but the actual problem is in the Indonesian language file, it reads "handler" instead of "handlers"

adinan-cenci commented 1 month ago

wait ... this seems to have been fixed fixed 2 years ago... then why composer installed it with the problem still there ? I am using 1.3

image

juanantoniodelgado commented 1 month ago

My apologies, but it seems that we never released a new version with the fix on Packagist. This has been fixed now by releasing 1.4.