Repository navigation
Fix dead scan options and iOS PDF sizing, add NativePHP v4 support - #5
Merged
Merged
Conversation
Three scan options were documented as working but had no effect at runtime, and iOS PDF output was distorted. Also aligns packaging with the NativePHP Mobile v3 plugin spec. Native fixes: - jpegQuality was a no-op on Android. Scanned pages were copied byte-for-byte from ML Kit's output URI, so the requested quality was never applied. Pages are now decoded and re-encoded at the requested quality, falling back to a raw copy if a page cannot be decoded. - maxPages was a no-op on iOS. VisionKit has no page-limit API, so the option was parsed and discarded. Enforced now by post-scan truncation (Epic 3), clamped by the max_pages_limit config the same way Android clamps it. - iOS PDF output forced every page to 612x792 US Letter and stretched the image to fit, so non-Letter documents came out distorted and low-res. Each page is now sized to its source image, matching Android. - pageCount in DocumentScanned reported 1 for PDF scans on iOS (the file count) while Android reported the page count. Both now report pages. Packaging: - Android min_version 21 -> 29 and iOS 13.0 -> 18.0 to match the v3 baseline documented in the plugin spec. This is a breaking change for consumers targeting older OS versions. - Declare illuminate/support explicitly rather than relying on transitive resolution through nativephp/mobile. - Drop the "ocr" keyword; the plugin performs no OCR.
testbench ^9.0 resolves only to laravel/framework ^11.x, and Composer now refuses to install any 11.x release because they all carry unresolved security advisories. Dependency installation therefore failed outright on both PHP 8.3 and 8.4. This is pre-existing breakage, not a regression from the platform fixes — CI last ran in April, before the advisories were published, so main is equally affected. testbench 10 targets Laravel 12 and testbench 11 targets Laravel 13; both accept the PHPUnit ^11.5 that Pest 3 requires, so the test suite and its Pest 3 syntax are unchanged.
Ikromjon1998
force-pushed
the
fix/v3-baseline-and-platform-parity
branch
from
August 27, 2026 22:56
6359c2a to
31e21eb
Compare
Rector's AddArrowFunctionReturnTypeRector and ClosureReturnTypeRector now infer string|false for the nativephp_call stub closures, which all return json_encode(). rector --dry-run failed on six test files as a result. Version drift rather than a regression: CI last ran in April against an older Rector, so main fails the same check. tests/Helpers.php is left alone because Rector does not flag its fn () => null stub.
Add a nativephp/mobile axis so both majors run on PHP 8.3 and 8.4; without it every job resolves v4 now that nativephp/mobile 4.5.0 supports PHP 8.3 again. Branch protection requires a check named "tests", but the matrix jobs report as "PHP 8.3" and so on, so the requirement could never be met. Add a final tests job that passes only when every other job did.
Widen the nativephp/mobile constraint to ^3.0|^4.0. The bridge, event and manifest contracts the plugin uses are unchanged in v4: both platforms compile in a v4 app, and imagesToPdf / pdfToImages run on the iOS simulator. Mark the changelog entry as 1.5.0-beta.1: the native fixes in this branch have not been run on a physical device yet.
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.
Three scan options were documented as working but had no effect at runtime, and iOS PDF output was distorted. Also aligns packaging with the NativePHP Mobile v3 plugin spec.
Native fixes:
Packaging:
Added on 3 Oct: NativePHP for Mobile v4 support
nativephp/mobileconstraint widened to^3.0|^4.0. Without it the package cannot be installed in a v4 app.nativephp/mobileaxis (^3.0,^4.0) on PHP 8.3 and 8.4. Sincenativephp/mobile4.5.0 restored PHP 8.3 support, every job would otherwise resolve v4 and leave v3 untested.testscheck. Branch protection requires a check with that name, but the matrix jobs report as "PHP 8.3" and so on, so the requirement could never be met.1.5.0-beta.1.What was verified
composer checkpasses againstnativephp/mobile3.3.9 and 4.6.0 (133 tests, Pint, Rector, PHPStan).nativephp/mobile4.6.0, this branch compiles for iOS (Xcode 27, simulator) and Android (assembleDebug, compile/target SDK 36).imagesToPdf()andpdfToImages()return results andPdfCreatedreaches both a Laravel listener and a Livewire#[OnNative]handler.What was not verified
Scanning itself. VisionKit and the ML Kit scanner need a physical camera, so the
jpegQualityre-encode, the iOSmaxPagestruncation and the iOS PDF page sizing in this PR have not been run on a device. That is why this ships as a pre-release first.