From b88bab29563586a94ad717eb85d6bb6ecfe9ec1e Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Wed, 28 Oct 2026 17:25:37 +0100 Subject: [PATCH 1/2] :bookmark: Version 3.4.0 --- CHANGELOG.md | 9 +++++++++ src/version.php | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85796f77..ebdf2433 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Mindee PHP API Library Changelog +## v3.4.0 - 2026-10-28 +### Changes +* :sparkles: swap out all PDF/Image handling features with Bernard L'Édit +* :coffin: drop pdfparser, FPDF/FPDI, ImageMagick, ghostscript +### Fixes +* :memo: fix changelog inconsistencies, and update to account for Bernard L'Édit +* :bug: fix faulty tests + + ## v3.3.1 - 2026-10-27 ### Fixes * :recycle: update deprecated syntaxes + add checks (addresses #225) diff --git a/src/version.php b/src/version.php index 95b2108e..6afd509c 100644 --- a/src/version.php +++ b/src/version.php @@ -4,4 +4,4 @@ namespace Mindee; -const VERSION = '3.3.1'; +const VERSION = '3.4.0'; From 035f3e71cc5e390cb0b01730b7489f0a7909afa9 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Wed, 28 Oct 2026 17:36:22 +0100 Subject: [PATCH 2/2] add bernard ledit version conflict test just in case --- src/Dependency/DependencyChecker.php | 40 ++++++++++--------- .../Dependencies/DependencyCheckerPdfTest.php | 9 +++++ 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/src/Dependency/DependencyChecker.php b/src/Dependency/DependencyChecker.php index 163b258e..947067bd 100644 --- a/src/Dependency/DependencyChecker.php +++ b/src/Dependency/DependencyChecker.php @@ -15,40 +15,44 @@ */ class DependencyChecker { - private const SUPPORTED_BERNARD_LEDIT = '0.1'; - /** - * Whether the bernard_ledit extension is loaded. + * The bernard_ledit version this SDK release is built and tested against. composer.json's "conflict" + * pins the same version; DependencyCheckerTest checks that both agree. */ - public static function isBernardLeditAvailable(): bool - { - return extension_loaded('bernard_ledit'); - } + public const BERNARD_LEDIT_VERSION = '0.1.0'; /** - * @throws MindeeUnhandledException Throws if the extension is missing or has an unsupported version. + * @throws MindeeUnhandledException Throws if bernard_ledit isn't loaded, or isn't the supported version. */ public static function requireBernardLedit(): void { - if (!self::isBernardLeditAvailable()) { + $install = sprintf('pie install mindee/bernard-ledit:%s', self::BERNARD_LEDIT_VERSION); + if (!extension_loaded('bernard_ledit')) { throw new MindeeUnhandledException( - "To enable PDF and image features, install the 'bernard_ledit' PHP extension: " - . "pie install mindee/bernard-ledit:^" . self::SUPPORTED_BERNARD_LEDIT - . " (see https://github.com/mindee/bernard-ledit#php-binding)", + "To enable PDF and image features, install the 'bernard_ledit' PHP extension: $install " + . '(see https://github.com/mindee/bernard-ledit#php-binding)', ErrorCode::USER_MISSING_DEPENDENCY ); } - $version = phpversion('bernard_ledit') ?: '0'; - if (!str_starts_with($version, self::SUPPORTED_BERNARD_LEDIT . '.')) { + $installed = phpversion('bernard_ledit'); + if ($installed !== self::BERNARD_LEDIT_VERSION) { throw new MindeeUnhandledException( sprintf( - "bernard_ledit %s is installed, but this SDK supports %s.x: pie install mindee/bernard-ledit:^%s", - $version, - self::SUPPORTED_BERNARD_LEDIT, - self::SUPPORTED_BERNARD_LEDIT + 'This version of the Mindee SDK needs bernard_ledit %s, but %s is installed: %s', + self::BERNARD_LEDIT_VERSION, + $installed, + $install ), ErrorCode::USER_MISSING_DEPENDENCY ); } } + + /** + * Whether the bernard_ledit extension is loaded. + */ + public static function isBernardLeditAvailable(): bool + { + return extension_loaded('bernard_ledit'); + } } diff --git a/tests/Dependencies/DependencyCheckerPdfTest.php b/tests/Dependencies/DependencyCheckerPdfTest.php index df788671..a8151c02 100644 --- a/tests/Dependencies/DependencyCheckerPdfTest.php +++ b/tests/Dependencies/DependencyCheckerPdfTest.php @@ -14,4 +14,13 @@ public function testBernardLeditDependency(): void $this->expectNotToPerformAssertions(); DependencyChecker::requireBernardLedit(); } + + public function testBernardLeditVersionMatchesComposerConflict(): void + { + $composer = json_decode(file_get_contents(__DIR__ . '/../../composer.json'), true); + self::assertSame( + '<' . DependencyChecker::BERNARD_LEDIT_VERSION, + $composer['conflict']['ext-bernard_ledit'] + ); + } }