Skip to content

v2.3.0

Choose a tag to compare

@ordinary9843 ordinary9843 released this 17 Apr 21:05
· 14 commits to master since this release

What's Changed

Refactoring

  • Added declare(strict_types=1) to all source files
  • Replaced __call() magic delegation in Ghostscript.php with explicit typed proxy methods for better IDE support and type safety
  • Replaced string-concatenation class resolution in HandlerFactory with an explicit handler map
  • Fixed nullable type hints in exception classes (?BaseException $previous = null)
  • Fixed docblock typo in ConfigTrait (@param int → @param string for $tmpPath)

Bug Fixes

  • Fixed SplitHandler off-by-one bug: output files are now correctly named part_1.pdf–part_N.pdf to match Ghostscript's actual output
  • Fixed MergeHandler undefined variable in catch block; added guard for empty $files array
  • Fixed GetTotalPagesHandler undefined variable in catch block
  • Fixed isPdf() in BaseHandler to check file existence before calling mime_content_type(), preventing PHP warnings on non-existent paths
  • Added image type validation in ToImageHandler (only jpeg and png are accepted)

Tests

  • Added edge case tests across all handler test files: empty paths, non-existent files, invalid types, empty arrays, Chinese filenames
  • Added BaseHandlerTest covering isPdf, getTmpFile, clearTmpFiles, and validateBinPath
  • Extended HandlerFactoryTest with uppercase type and unknown type cases
  • Extended PathHelperTest with empty string, backslash, mixed separator, and space cases

CI / GitHub Actions

  • Upgraded actions/checkout to v5.0.1 (node24 native)
  • Upgraded codecov/codecov-action to v6 (resolves Node.js 20 deprecation warning)
  • Removed FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 workaround (no longer needed)
  • Coverage upload now only runs on PHP 8.4
  • Added fail-fast: false to matrix strategy

Full Changelog: v2.2.4...v2.3.0