Declaration must be compatible with Stemmer

Created on 16 October 2023, about 1 year ago
Updated 18 October 2023, about 1 year ago

Problem/Motivation

There are two fatals right now:

PHP Fatal error:  Declaration of Drupal\snowball_stemmer\Plugin\search_api\processor\SnowballStemmer::getLanguageManager() must be compatible with Drupal\search_api\Plugin\search_api\processor\Stemmer::getLanguageManager(): Drupal\Core\Language\LanguageManagerInterface in /var/www/html/web/modules/contrib/snowball_stemmer/src/Plugin/search_api/processor/SnowballStemmer.php on line 102
PHP Fatal error:  Declaration of Drupal\snowball_stemmer\Plugin\search_api\processor\SnowballStemmer::setLanguageManager(Drupal\Core\Language\LanguageManagerInterface $language_manager) must be compatible with Drupal\search_api\Plugin\search_api\processor\Stemmer::setLanguageManager(Drupal\Core\Language\LanguageManagerInterface $language_manager): Drupal\search_api\Plugin\search_api\processor\Stemmer in /var/www/html/web/modules/contrib/snowball_stemmer/src/Plugin/search_api/processor/SnowballStemmer.php on line 114

This happens on Search API 1.30 (https://git.drupalcode.org/project/search_api/-/commit/1205ca43095d6512a...)

Steps to reproduce

Update Search API and clear the cache.

Proposed resolution

Remove these methods, because they are exactly the same. But we have to bump dependency to that version, otherwise it will break on installations with Search API < 1.30.

The other solution is to update these methods to be compatible with the Search API one.

🐛 Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

🇷🇺Russia niklan Russia, Perm

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024