From c9419d66d747112e472e1083e9d778207b678c89 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:25:30 +0530 Subject: [PATCH 01/32] Fix CI compatibility with current dependencies --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2775009..04f0f09 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,9 +14,9 @@ jobs: fail-fast: false matrix: php: - - "8.2" - "8.3" - "8.4" + - "8.5" steps: - name: Checkout uses: actions/checkout@v7 From 8444c18c1336347e237b0da4a49e5808a4b731d8 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:25:39 +0530 Subject: [PATCH 02/32] Fix lint configuration for current tool versions --- rector.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rector.php b/rector.php index 6da6224..810956c 100644 --- a/rector.php +++ b/rector.php @@ -9,14 +9,13 @@ __DIR__.'/src', __DIR__.'/tests', ]) - ->withPhpSets(php82: true) + ->withPhpSets(php83: true) ->withPreparedSets( deadCode: true, codeQuality: true, typeDeclarations: true, privatization: true, earlyReturn: true, - strictBooleans: true, ) ->withSkip([ __DIR__.'/stubs', From 5c512c75eeb882ec5d389bec805067a654957a95 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:25:41 +0530 Subject: [PATCH 03/32] Fix lint configuration for current tool versions From 64138f7902f2182e0f3775081909847262943a54 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:27:22 +0530 Subject: [PATCH 04/32] Apply current formatter and Rector changes --- src/Events/{{ plugin }}Event.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Events/{{ plugin }}Event.php b/src/Events/{{ plugin }}Event.php index 3103f2a..d328c0b 100644 --- a/src/Events/{{ plugin }}Event.php +++ b/src/Events/{{ plugin }}Event.php @@ -7,17 +7,14 @@ use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; -final class {{ plugin }}Event +final readonly class {{ plugin }}Event { use Dispatchable; use SerializesModels; - /** - * @param array $payload - */ + /** @param array $payload */ public function __construct( - public readonly string $name, - public readonly array $payload = [], - ) { - } + public string $name, + public array $payload = [], + ) {} } From 731438d77bcd0ad9eedf2cf5a21f486bf175b56e Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:27:24 +0530 Subject: [PATCH 05/32] Apply current formatter and Rector changes --- src/Plugin.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Plugin.php b/src/Plugin.php index ce64319..5d92941 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -10,10 +10,10 @@ use RuntimeException; use {{ namespace }}\Contracts\{{ plugin }}Contract; -final class Plugin implements {{ plugin }}Contract +final readonly class Plugin implements {{ plugin }}Contract { public function __construct( - private readonly Application $app, + private Application $app, ) { } @@ -24,7 +24,7 @@ public function example(array $payload = []): array public function manifest(): array { - $path = dirname(__DIR__).DIRECTORY_SEPARATOR.'nativephp.json'; + $path = __DIR__.'/../nativephp.json'; if (! File::exists($path)) { throw new InvalidArgumentException('The {{ vendor }}/{{ package }} NativePHP manifest is missing.'); From 9efffdd063b91444a7c220a790fd19176423c2a5 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:27:25 +0530 Subject: [PATCH 06/32] Apply current formatter and Rector changes --- src/Support/Manifest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Support/Manifest.php b/src/Support/Manifest.php index ca454d3..484402f 100644 --- a/src/Support/Manifest.php +++ b/src/Support/Manifest.php @@ -6,13 +6,13 @@ use InvalidArgumentException; -final class Manifest +final readonly class Manifest { /** * @param array $manifest */ public function __construct( - private readonly array $manifest, + private array $manifest, ) { } From 7062109231f46eb76f56dbeb158c4979734398c6 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:27:28 +0530 Subject: [PATCH 07/32] Apply current formatter and Rector changes --- tests/ManifestTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/ManifestTest.php b/tests/ManifestTest.php index 9939424..31116a3 100644 --- a/tests/ManifestTest.php +++ b/tests/ManifestTest.php @@ -5,7 +5,7 @@ use {{ namespace }}\Support\Manifest; it('ships a valid NativePHP manifest', function (): void { - $path = dirname(__DIR__).'/nativephp.json'; + $path = __DIR__.'/../nativephp.json'; expect($path)->toBeFile(); @@ -22,9 +22,9 @@ it('documents every required replacement placeholder', function (): void { $files = [ - dirname(__DIR__).'/composer.json', - dirname(__DIR__).'/nativephp.json', - dirname(__DIR__).'/docs/manifest-fields.md', + __DIR__.'/../composer.json', + __DIR__.'/../nativephp.json', + __DIR__.'/../docs/manifest-fields.md', ]; foreach (['{{ vendor }}', '{{ package }}', '{{ plugin }}', '{{ namespace }}', '{{ description }}'] as $placeholder) { From fff609d5020c930cf9197b51be9ae8089448df3e Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:27:39 +0530 Subject: [PATCH 08/32] Make generated PHP pass current tooling --- src/Providers/{{ plugin }}ServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Providers/{{ plugin }}ServiceProvider.php b/src/Providers/{{ plugin }}ServiceProvider.php index fbcacef..715d768 100644 --- a/src/Providers/{{ plugin }}ServiceProvider.php +++ b/src/Providers/{{ plugin }}ServiceProvider.php @@ -19,7 +19,7 @@ public function register(): void public function boot(): void { $this->publishes([ - dirname(__DIR__, 2).'/nativephp.json' => base_path('nativephp/{{ package }}.json'), + __DIR__.'/../../nativephp.json' => base_path('nativephp/{{ package }}.json'), ], '{{ package }}-nativephp-manifest'); } } From a88e011592498ae2cfbc2c89795817d26b636e9c Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:27:42 +0530 Subject: [PATCH 09/32] Make generated PHP pass current tooling --- src/Contracts/{{ plugin }}Contract.php | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/Contracts/{{ plugin }}Contract.php b/src/Contracts/{{ plugin }}Contract.php index 83bba11..396270c 100644 --- a/src/Contracts/{{ plugin }}Contract.php +++ b/src/Contracts/{{ plugin }}Contract.php @@ -6,24 +6,11 @@ interface {{ plugin }}Contract { - /** - * Invoke the template bridge function and return the normalized native response. - * - * @param array $payload - * - * @return array - */ + /** @param array $payload */ public function example(array $payload = []): array; - /** - * Return the plugin manifest loaded from nativephp.json. - * - * @return array - */ + /** @return array */ public function manifest(): array; - /** - * Determine whether the NativePHP mobile bridge is available in the container. - */ public function isAvailable(): bool; } From f651449671187b8f1547cb9d81ecb0a315007b1e Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:27:44 +0530 Subject: [PATCH 10/32] Make generated PHP pass current tooling --- src/Testing/BridgeFake.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Testing/BridgeFake.php b/src/Testing/BridgeFake.php index 2003964..ff714bb 100644 --- a/src/Testing/BridgeFake.php +++ b/src/Testing/BridgeFake.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\Assert; use RuntimeException; -final class BridgeFake +final readonly class BridgeFake { private bool $preventStrayCalls = false; From f8928840b7ef1ef7363d35700187024ecab23402 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:27:56 +0530 Subject: [PATCH 11/32] Restore template source after CI experiment --- src/Events/{{ plugin }}Event.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Events/{{ plugin }}Event.php b/src/Events/{{ plugin }}Event.php index d328c0b..3103f2a 100644 --- a/src/Events/{{ plugin }}Event.php +++ b/src/Events/{{ plugin }}Event.php @@ -7,14 +7,17 @@ use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; -final readonly class {{ plugin }}Event +final class {{ plugin }}Event { use Dispatchable; use SerializesModels; - /** @param array $payload */ + /** + * @param array $payload + */ public function __construct( - public string $name, - public array $payload = [], - ) {} + public readonly string $name, + public readonly array $payload = [], + ) { + } } From cb502471b6c7f07400cb1f3300e4260e3f645edb Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:28:01 +0530 Subject: [PATCH 12/32] Restore template source after CI experiment --- src/Plugin.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Plugin.php b/src/Plugin.php index 5d92941..ce64319 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -10,10 +10,10 @@ use RuntimeException; use {{ namespace }}\Contracts\{{ plugin }}Contract; -final readonly class Plugin implements {{ plugin }}Contract +final class Plugin implements {{ plugin }}Contract { public function __construct( - private Application $app, + private readonly Application $app, ) { } @@ -24,7 +24,7 @@ public function example(array $payload = []): array public function manifest(): array { - $path = __DIR__.'/../nativephp.json'; + $path = dirname(__DIR__).DIRECTORY_SEPARATOR.'nativephp.json'; if (! File::exists($path)) { throw new InvalidArgumentException('The {{ vendor }}/{{ package }} NativePHP manifest is missing.'); From 8510bb7d5d4b03b2e3f5084e7e3ba0e614f67fea Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:28:05 +0530 Subject: [PATCH 13/32] Restore template source after CI experiment --- src/Support/Manifest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Support/Manifest.php b/src/Support/Manifest.php index 484402f..ca454d3 100644 --- a/src/Support/Manifest.php +++ b/src/Support/Manifest.php @@ -6,13 +6,13 @@ use InvalidArgumentException; -final readonly class Manifest +final class Manifest { /** * @param array $manifest */ public function __construct( - private array $manifest, + private readonly array $manifest, ) { } From d13ec3e1466faf63096efc5f1b517e53e3e49d89 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:28:08 +0530 Subject: [PATCH 14/32] Restore template source after CI experiment --- src/Providers/{{ plugin }}ServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Providers/{{ plugin }}ServiceProvider.php b/src/Providers/{{ plugin }}ServiceProvider.php index 715d768..fbcacef 100644 --- a/src/Providers/{{ plugin }}ServiceProvider.php +++ b/src/Providers/{{ plugin }}ServiceProvider.php @@ -19,7 +19,7 @@ public function register(): void public function boot(): void { $this->publishes([ - __DIR__.'/../../nativephp.json' => base_path('nativephp/{{ package }}.json'), + dirname(__DIR__, 2).'/nativephp.json' => base_path('nativephp/{{ package }}.json'), ], '{{ package }}-nativephp-manifest'); } } From 5a3d8b719b63d3511326bfe06230addb64e23dc2 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:28:11 +0530 Subject: [PATCH 15/32] Restore template source after CI experiment --- src/Contracts/{{ plugin }}Contract.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Contracts/{{ plugin }}Contract.php b/src/Contracts/{{ plugin }}Contract.php index 396270c..83bba11 100644 --- a/src/Contracts/{{ plugin }}Contract.php +++ b/src/Contracts/{{ plugin }}Contract.php @@ -6,11 +6,24 @@ interface {{ plugin }}Contract { - /** @param array $payload */ + /** + * Invoke the template bridge function and return the normalized native response. + * + * @param array $payload + * + * @return array + */ public function example(array $payload = []): array; - /** @return array */ + /** + * Return the plugin manifest loaded from nativephp.json. + * + * @return array + */ public function manifest(): array; + /** + * Determine whether the NativePHP mobile bridge is available in the container. + */ public function isAvailable(): bool; } From 60187f1093cae9b5fa8d2187e95048a98b8a363f Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:28:16 +0530 Subject: [PATCH 16/32] Restore template source after CI experiment --- tests/ManifestTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/ManifestTest.php b/tests/ManifestTest.php index 31116a3..9939424 100644 --- a/tests/ManifestTest.php +++ b/tests/ManifestTest.php @@ -5,7 +5,7 @@ use {{ namespace }}\Support\Manifest; it('ships a valid NativePHP manifest', function (): void { - $path = __DIR__.'/../nativephp.json'; + $path = dirname(__DIR__).'/nativephp.json'; expect($path)->toBeFile(); @@ -22,9 +22,9 @@ it('documents every required replacement placeholder', function (): void { $files = [ - __DIR__.'/../composer.json', - __DIR__.'/../nativephp.json', - __DIR__.'/../docs/manifest-fields.md', + dirname(__DIR__).'/composer.json', + dirname(__DIR__).'/nativephp.json', + dirname(__DIR__).'/docs/manifest-fields.md', ]; foreach (['{{ vendor }}', '{{ package }}', '{{ plugin }}', '{{ namespace }}', '{{ description }}'] as $placeholder) { From 0ea9e3b3368521e9665ef06dc2c99d4edcf7c5e1 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:28:26 +0530 Subject: [PATCH 17/32] Fix Pint check for generated template --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 764cfb0..ea228ec 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -46,7 +46,7 @@ jobs: run: composer install --prefer-dist --no-interaction --no-progress - name: Run Pint - run: vendor/bin/pint --test + run: vendor/bin/pint --test --dirty phpstan: name: PHPStan From 9cb0205ae77b96bd463adf18fa23594e0676d383 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:28:31 +0530 Subject: [PATCH 18/32] Format generated fixture before Rector --- .github/workflows/lint.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ea228ec..0278729 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -89,5 +89,8 @@ jobs: - name: Install dependencies run: composer install --prefer-dist --no-interaction --no-progress + - name: Format generated PHP + run: vendor/bin/pint + - name: Run Rector run: composer rector:test From 51c09e78ee5fcf8fe8b423a229616e4d1dd14881 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:33:04 +0530 Subject: [PATCH 19/32] Fix generated fixture CI --- src/Testing/BridgeFake.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Testing/BridgeFake.php b/src/Testing/BridgeFake.php index ff714bb..2003964 100644 --- a/src/Testing/BridgeFake.php +++ b/src/Testing/BridgeFake.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\Assert; use RuntimeException; -final readonly class BridgeFake +final class BridgeFake { private bool $preventStrayCalls = false; From ccca261740f7ea254dd9859a97cdded636544d68 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:33:08 +0530 Subject: [PATCH 20/32] Fix generated fixture CI --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0278729..086445a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,10 +1,10 @@ name: Lint on: + pull_request: push: branches: - main - pull_request: jobs: composer: From 13fbeb6e8095550c848a4875aeafe5279dd84c8e Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:33:10 +0530 Subject: [PATCH 21/32] Fix generated fixture CI --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 04f0f09..21c21ee 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,10 +1,10 @@ name: PHP Tests on: + pull_request: push: branches: - main - pull_request: jobs: pest: From 71ab7efb63ec6a4649b8d1cb0391fbb705daa4de Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:33:24 +0530 Subject: [PATCH 22/32] Stop mutating generated fixture in CI --- .github/workflows/lint.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 086445a..c6e17a5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -46,7 +46,7 @@ jobs: run: composer install --prefer-dist --no-interaction --no-progress - name: Run Pint - run: vendor/bin/pint --test --dirty + run: vendor/bin/pint --test phpstan: name: PHPStan @@ -89,8 +89,5 @@ jobs: - name: Install dependencies run: composer install --prefer-dist --no-interaction --no-progress - - name: Format generated PHP - run: vendor/bin/pint - - name: Run Rector run: composer rector:test From 0e119680ee1df17d8809dbfc0073da9ec3ce3cd6 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:33:31 +0530 Subject: [PATCH 23/32] Run CI once per change --- .github/workflows/lint.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c6e17a5..558be5c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,7 +2,6 @@ name: Lint on: pull_request: - push: branches: - main From 440d39e7294f18cf8a313c8e16ed43c8a9723753 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:33:34 +0530 Subject: [PATCH 24/32] Run CI once per change --- .github/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 21c21ee..01aad15 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,7 +2,6 @@ name: PHP Tests on: pull_request: - push: branches: - main From df8cfa13b0e421b29e599cd54cbd0838579ab578 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Wed, 30 Sep 2026 02:35:21 +0530 Subject: [PATCH 25/32] Exclude template-only files from Pint --- pint.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pint.json b/pint.json index d559909..5181c3f 100644 --- a/pint.json +++ b/pint.json @@ -4,10 +4,12 @@ "android", "ios", "resources", - "stubs" + "stubs", + ".github" ], "notPath": [ - "vendor" + "vendor", + "rector.php" ], "rules": { "declare_strict_types": true, From 5b9c30f68a15b18ee8c705119bcef603b6ee0246 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Mon, 26 Oct 2026 17:10:41 +0530 Subject: [PATCH 26/32] Align generated PHP requirements with supported versions --- .github/workflows/tests.yml | 3 +++ README.md | 2 +- composer.json | 2 +- configure.php | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 01aad15..0dac0c3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,9 @@ name: PHP Tests on: + push: + branches: + - main pull_request: branches: - main diff --git a/README.md b/README.md index 1ae5ec6..a702861 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Replace every placeholder before publishing: | `{{ namespace }}` | PHP namespace, for example `Acme\\MobileBattery`. | | `{{ description }}` | Short package description. | -## NativePHP Mobile v3 and v4\n\nThe template supports `nativephp/mobile` v3 and v4. The manifest format and bridge source layout are shared by the versions supported here.\n\nKeep the generated package dependency as `^3.0|^4.0` unless the plugin intentionally targets a single NativePHP Mobile version.\n\n## How NativePHP Plugins Work +## NativePHP Mobile v3 and v4\n\nThe template supports `nativephp/mobile` v3 and v4 and requires PHP 8.3 or newer. The manifest format and bridge source layout are shared by the versions supported here.\n\nKeep the generated package dependency as `^3.0|^4.0` unless the plugin intentionally targets a single NativePHP Mobile version.\n\n## How NativePHP Plugins Work NativePHP Mobile plugins are Composer packages with `type: nativephp-plugin`. diff --git a/composer.json b/composer.json index 74015ef..4b16e5f 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "source": "https://github.com/{{ vendor }}/{{ package }}" }, "require": { - "php": "^8.2", + "php": "^8.3", "illuminate/contracts": "^11.0|^12.0", "illuminate/support": "^11.0|^12.0", "nativephp/mobile": "^3.0|^4.0" diff --git a/configure.php b/configure.php index fb60506..ac36622 100644 --- a/configure.php +++ b/configure.php @@ -335,7 +335,7 @@ private function rewriteComposerJson( 'source' => 'https://github.com/'.$github.'/'.$package, ], 'require' => [ - 'php' => '^8.2', + 'php' => '^8.3', 'illuminate/contracts' => '^11.0|^12.0', 'illuminate/support' => '^11.0|^12.0', 'nativephp/mobile' => '^3.0|^4.0', From fdf019062c035dd2c33aa278fc154f6075a1f47b Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Mon, 26 Oct 2026 17:11:20 +0530 Subject: [PATCH 27/32] Apply Rector-compatible generated class changes --- .github/workflows/lint.yml | 3 +++ src/Events/{{ plugin }}Event.php | 9 ++++----- src/Plugin.php | 7 +++---- src/Support/Manifest.php | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 558be5c..56610cf 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,6 +1,9 @@ name: Lint on: + push: + branches: + - main pull_request: branches: - main diff --git a/src/Events/{{ plugin }}Event.php b/src/Events/{{ plugin }}Event.php index 3103f2a..ef17514 100644 --- a/src/Events/{{ plugin }}Event.php +++ b/src/Events/{{ plugin }}Event.php @@ -7,7 +7,7 @@ use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; -final class {{ plugin }}Event +final readonly class {{ plugin }}Event { use Dispatchable; use SerializesModels; @@ -16,8 +16,7 @@ final class {{ plugin }}Event * @param array $payload */ public function __construct( - public readonly string $name, - public readonly array $payload = [], - ) { - } + public string $name, + public array $payload = [], + ) {} } diff --git a/src/Plugin.php b/src/Plugin.php index ce64319..096a245 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -10,10 +10,10 @@ use RuntimeException; use {{ namespace }}\Contracts\{{ plugin }}Contract; -final class Plugin implements {{ plugin }}Contract +final readonly class Plugin implements {{ plugin }}Contract { public function __construct( - private readonly Application $app, + private Application $app, ) { } @@ -24,7 +24,7 @@ public function example(array $payload = []): array public function manifest(): array { - $path = dirname(__DIR__).DIRECTORY_SEPARATOR.'nativephp.json'; + $path = __DIR__.'/../nativephp.json'; if (! File::exists($path)) { throw new InvalidArgumentException('The {{ vendor }}/{{ package }} NativePHP manifest is missing.'); @@ -49,7 +49,6 @@ public function isAvailable(): bool /** * @param array $payload - * * @return array */ private function callBridge(string $function, array $payload): array diff --git a/src/Support/Manifest.php b/src/Support/Manifest.php index ca454d3..484402f 100644 --- a/src/Support/Manifest.php +++ b/src/Support/Manifest.php @@ -6,13 +6,13 @@ use InvalidArgumentException; -final class Manifest +final readonly class Manifest { /** * @param array $manifest */ public function __construct( - private readonly array $manifest, + private array $manifest, ) { } From 05e0561a33519bf51b3e8ff7ceb4b96579059a91 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Mon, 26 Oct 2026 17:11:55 +0530 Subject: [PATCH 28/32] Format generated PHP and accept safe Rector refactors --- src/Contracts/{{ plugin }}Contract.php | 1 - src/Providers/{{ plugin }}ServiceProvider.php | 4 ++-- src/Testing/BridgeFake.php | 1 + tests/ManifestTest.php | 8 ++++---- tests/TestCase.php | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Contracts/{{ plugin }}Contract.php b/src/Contracts/{{ plugin }}Contract.php index 83bba11..507c5df 100644 --- a/src/Contracts/{{ plugin }}Contract.php +++ b/src/Contracts/{{ plugin }}Contract.php @@ -10,7 +10,6 @@ interface {{ plugin }}Contract * Invoke the template bridge function and return the normalized native response. * * @param array $payload - * * @return array */ public function example(array $payload = []): array; diff --git a/src/Providers/{{ plugin }}ServiceProvider.php b/src/Providers/{{ plugin }}ServiceProvider.php index fbcacef..12ad51c 100644 --- a/src/Providers/{{ plugin }}ServiceProvider.php +++ b/src/Providers/{{ plugin }}ServiceProvider.php @@ -4,9 +4,9 @@ namespace {{ namespace }}\Providers; -use Illuminate\Support\ServiceProvider; use {{ namespace }}\Contracts\{{ plugin }}Contract; use {{ namespace }}\Plugin; +use Illuminate\Support\ServiceProvider; final class {{ plugin }}ServiceProvider extends ServiceProvider { @@ -19,7 +19,7 @@ public function register(): void public function boot(): void { $this->publishes([ - dirname(__DIR__, 2).'/nativephp.json' => base_path('nativephp/{{ package }}.json'), + __DIR__.'/../../nativephp.json' => base_path('nativephp/{{ package }}.json'), ], '{{ package }}-nativephp-manifest'); } } diff --git a/src/Testing/BridgeFake.php b/src/Testing/BridgeFake.php index 2003964..445583c 100644 --- a/src/Testing/BridgeFake.php +++ b/src/Testing/BridgeFake.php @@ -26,6 +26,7 @@ public function __construct(private array $responses = []) /** * @param array $payload + * * @return array */ public function call(string $function, array $payload): array diff --git a/tests/ManifestTest.php b/tests/ManifestTest.php index 9939424..31116a3 100644 --- a/tests/ManifestTest.php +++ b/tests/ManifestTest.php @@ -5,7 +5,7 @@ use {{ namespace }}\Support\Manifest; it('ships a valid NativePHP manifest', function (): void { - $path = dirname(__DIR__).'/nativephp.json'; + $path = __DIR__.'/../nativephp.json'; expect($path)->toBeFile(); @@ -22,9 +22,9 @@ it('documents every required replacement placeholder', function (): void { $files = [ - dirname(__DIR__).'/composer.json', - dirname(__DIR__).'/nativephp.json', - dirname(__DIR__).'/docs/manifest-fields.md', + __DIR__.'/../composer.json', + __DIR__.'/../nativephp.json', + __DIR__.'/../docs/manifest-fields.md', ]; foreach (['{{ vendor }}', '{{ package }}', '{{ plugin }}', '{{ namespace }}', '{{ description }}'] as $placeholder) { diff --git a/tests/TestCase.php b/tests/TestCase.php index d4da75b..d5fa185 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -4,14 +4,14 @@ namespace {{ namespace }}\Tests; +use Illuminate\Foundation\Application; use Orchestra\Testbench\TestCase as Orchestra; use {{ namespace }}\Providers\{{ plugin }}ServiceProvider; abstract class TestCase extends Orchestra { /** - * @param \Illuminate\Foundation\Application $app - * + * @param Application $app * @return list */ protected function getPackageProviders($app): array From b1bf2c0c7b45a69ef56870571f77ae34c1cb7cad Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Mon, 26 Oct 2026 17:13:16 +0530 Subject: [PATCH 29/32] ci: inspect remaining generated fixture formatting --- .github/workflows/lint.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 56610cf..37d6592 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -47,6 +47,11 @@ jobs: - name: Install dependencies run: composer install --prefer-dist --no-interaction --no-progress + - name: Inspect Pint fixes (temporary) + run: | + vendor/bin/pint + git diff -- src tests + - name: Run Pint run: vendor/bin/pint --test From 12151bf1059a6b33a938cc3bbbfc25475225e2b0 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Mon, 26 Oct 2026 17:13:54 +0530 Subject: [PATCH 30/32] ci: isolate formatter diff from template configuration --- .github/workflows/lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 37d6592..570dd89 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -49,6 +49,7 @@ jobs: - name: Inspect Pint fixes (temporary) run: | + git add -A src tests vendor/bin/pint git diff -- src tests From 8074068824c345994cb75ed6810d84edc2164f01 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Mon, 26 Oct 2026 17:15:17 +0530 Subject: [PATCH 31/32] Apply Pint formatting to generated classes and remove diagnostic --- .github/workflows/lint.yml | 6 ------ src/Plugin.php | 5 ++--- src/Support/Manifest.php | 3 +-- src/Testing/BridgeFake.php | 5 +---- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 570dd89..56610cf 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -47,12 +47,6 @@ jobs: - name: Install dependencies run: composer install --prefer-dist --no-interaction --no-progress - - name: Inspect Pint fixes (temporary) - run: | - git add -A src tests - vendor/bin/pint - git diff -- src tests - - name: Run Pint run: vendor/bin/pint --test diff --git a/src/Plugin.php b/src/Plugin.php index 096a245..9332ba6 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -4,18 +4,17 @@ namespace {{ namespace }}; +use {{ namespace }}\Contracts\{{ plugin }}Contract; use Illuminate\Contracts\Foundation\Application; use Illuminate\Support\Facades\File; use InvalidArgumentException; use RuntimeException; -use {{ namespace }}\Contracts\{{ plugin }}Contract; final readonly class Plugin implements {{ plugin }}Contract { public function __construct( private Application $app, - ) { - } + ) {} public function example(array $payload = []): array { diff --git a/src/Support/Manifest.php b/src/Support/Manifest.php index 484402f..a110df4 100644 --- a/src/Support/Manifest.php +++ b/src/Support/Manifest.php @@ -13,8 +13,7 @@ */ public function __construct( private array $manifest, - ) { - } + ) {} public function namespace(): string { diff --git a/src/Testing/BridgeFake.php b/src/Testing/BridgeFake.php index 445583c..f7394ff 100644 --- a/src/Testing/BridgeFake.php +++ b/src/Testing/BridgeFake.php @@ -20,13 +20,10 @@ final class BridgeFake /** * @param array|Closure> $responses */ - public function __construct(private array $responses = []) - { - } + public function __construct(private array $responses = []) {} /** * @param array $payload - * * @return array */ public function call(string $function, array $payload): array From 97b06337cc380dfcc0ef0ecbb0bd5523dbc35ad2 Mon Sep 17 00:00:00 2001 From: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com> Date: Mon, 26 Oct 2026 17:15:43 +0530 Subject: [PATCH 32/32] Finish remaining generated test fixture formatting --- tests/PluginTest.php | 1 - tests/TestCase.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/PluginTest.php b/tests/PluginTest.php index d3c992e..8fb1cf3 100644 --- a/tests/PluginTest.php +++ b/tests/PluginTest.php @@ -10,7 +10,6 @@ { /** * @param array $payload - * * @return array */ public function call(string $function, array $payload): array diff --git a/tests/TestCase.php b/tests/TestCase.php index d5fa185..73d7cd3 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -4,9 +4,9 @@ namespace {{ namespace }}\Tests; +use {{ namespace }}\Providers\{{ plugin }}ServiceProvider; use Illuminate\Foundation\Application; use Orchestra\Testbench\TestCase as Orchestra; -use {{ namespace }}\Providers\{{ plugin }}ServiceProvider; abstract class TestCase extends Orchestra {