v2.3.0
What's Changed
Refactoring
- Added
declare(strict_types=1)to all source files - Replaced
__call()magic delegation inGhostscript.phpwith explicit typed proxy methods for better IDE support and type safety - Replaced string-concatenation class resolution in
HandlerFactorywith an explicit handler map - Fixed nullable type hints in exception classes (
?BaseException $previous = null) - Fixed docblock typo in
ConfigTrait(@param int→@param stringfor$tmpPath)
Bug Fixes
- Fixed
SplitHandleroff-by-one bug: output files are now correctly namedpart_1.pdf–part_N.pdfto match Ghostscript's actual output - Fixed
MergeHandlerundefined variable in catch block; added guard for empty$filesarray - Fixed
GetTotalPagesHandlerundefined variable in catch block - Fixed
isPdf()inBaseHandlerto check file existence before callingmime_content_type(), preventing PHP warnings on non-existent paths - Added image type validation in
ToImageHandler(onlyjpegandpngare accepted)
Tests
- Added edge case tests across all handler test files: empty paths, non-existent files, invalid types, empty arrays, Chinese filenames
- Added
BaseHandlerTestcoveringisPdf,getTmpFile,clearTmpFiles, andvalidateBinPath - Extended
HandlerFactoryTestwith uppercase type and unknown type cases - Extended
PathHelperTestwith empty string, backslash, mixed separator, and space cases
CI / GitHub Actions
- Upgraded
actions/checkouttov5.0.1(node24 native) - Upgraded
codecov/codecov-actiontov6(resolves Node.js 20 deprecation warning) - Removed
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24workaround (no longer needed) - Coverage upload now only runs on PHP 8.4
- Added
fail-fast: falseto matrix strategy
Full Changelog: v2.2.4...v2.3.0