[refactor] type safety and edge case tests#4
Merged
ordinary9843 merged 13 commits intomasterfrom Apr 17, 2026
Merged
Conversation
…methods, HandlerFactory map
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
declare(strict_types=1)to allsrc/files__calldelegation with explicit typed proxy methods inGhostscript.phpHandlerFactorywith explicit map arrayBaseException $previous→?BaseException $previous)ConfigTrait(@param int $tmpPath→@param string $tmpPath)Bug fixes
SplitHandler:range(0, N-1)returnedpart_0.pdf…part_{N-1}.pdfbut GS outputspart_1.pdf…part_N.pdfMergeHandler/GetTotalPagesHandler:$fileundefined in catch block if exception thrown before assignmentMergeHandler/SplitHandler/ToImageHandler: missingparent::__construct()callBaseHandler::isPdf(): callingmime_content_type()on non-existent file emittedE_WARNINGMergeHandler: empty$filesafter filtering caused GS to hang; now throwsHandlerExceptionToImageHandler: invalid image type silently passed to GS; now validated against allowed typesNew edge case tests (+34 tests, 123 total)
BaseHandlerEdgeCaseTest— empty string / non-existent path / directory path, tmp file ops, options formatConvertHandlerEdgeCaseTest— empty file pathGuessHandlerEdgeCaseTest— no version header, empty pathMergeHandlerEdgeCaseTest— empty array, all-invalid files, single valid fileSplitHandlerEdgeCaseTest— verifies output starts atpart_1.pdf, files actually existToImageHandlerEdgeCaseTest— invalid image type (bmp) throws exceptionGetTotalPagesHandlerEdgeCaseTest— empty path, non-existent fileHandlerFactoryEdgeCaseTest—getTotalPageshandler, case-sensitive type checkPathHelperEdgeCaseTest— empty string, backslashes, mixed separators, spaces in pathWorkflow
pull_requesttrigger tobuild.ymlso CI runs on PRs across PHP 7.1–8.4