Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c9419d6
Fix CI compatibility with current dependencies
MrPunyapal Sep 29, 2026
8444c18
Fix lint configuration for current tool versions
MrPunyapal Sep 29, 2026
5c512c7
Fix lint configuration for current tool versions
MrPunyapal Sep 29, 2026
64138f7
Apply current formatter and Rector changes
MrPunyapal Sep 29, 2026
731438d
Apply current formatter and Rector changes
MrPunyapal Sep 29, 2026
9efffdd
Apply current formatter and Rector changes
MrPunyapal Sep 29, 2026
7062109
Apply current formatter and Rector changes
MrPunyapal Sep 29, 2026
fff609d
Make generated PHP pass current tooling
MrPunyapal Sep 29, 2026
a88e011
Make generated PHP pass current tooling
MrPunyapal Sep 29, 2026
f651449
Make generated PHP pass current tooling
MrPunyapal Sep 29, 2026
f892884
Restore template source after CI experiment
MrPunyapal Sep 29, 2026
cb50247
Restore template source after CI experiment
MrPunyapal Sep 29, 2026
8510bb7
Restore template source after CI experiment
MrPunyapal Sep 29, 2026
d13ec3e
Restore template source after CI experiment
MrPunyapal Sep 29, 2026
5a3d8b7
Restore template source after CI experiment
MrPunyapal Sep 29, 2026
60187f1
Restore template source after CI experiment
MrPunyapal Sep 29, 2026
0ea9e3b
Fix Pint check for generated template
MrPunyapal Sep 29, 2026
9cb0205
Format generated fixture before Rector
MrPunyapal Sep 29, 2026
51c09e7
Fix generated fixture CI
MrPunyapal Sep 29, 2026
ccca261
Fix generated fixture CI
MrPunyapal Sep 29, 2026
13fbeb6
Fix generated fixture CI
MrPunyapal Sep 29, 2026
71ab7ef
Stop mutating generated fixture in CI
MrPunyapal Sep 29, 2026
0e11968
Run CI once per change
MrPunyapal Sep 29, 2026
440d39e
Run CI once per change
MrPunyapal Sep 29, 2026
df8cfa1
Exclude template-only files from Pint
MrPunyapal Sep 29, 2026
5b9c30f
Align generated PHP requirements with supported versions
MrPunyapal Oct 26, 2026
fdf0190
Apply Rector-compatible generated class changes
MrPunyapal Oct 26, 2026
05e0561
Format generated PHP and accept safe Rector refactors
MrPunyapal Oct 26, 2026
b1bf2c0
ci: inspect remaining generated fixture formatting
MrPunyapal Oct 26, 2026
12151bf
ci: isolate formatter diff from template configuration
MrPunyapal Oct 26, 2026
8074068
Apply Pint formatting to generated classes and remove diagnostic
MrPunyapal Oct 26, 2026
97b0633
Finish remaining generated test fixture formatting
MrPunyapal Oct 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches:
- main
pull_request:
branches:
- main

jobs:
composer:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches:
- main
pull_request:
branches:
- main

jobs:
pest:
Expand All @@ -14,9 +16,9 @@ jobs:
fail-fast: false
matrix:
php:
- "8.2"
- "8.3"
- "8.4"
- "8.5"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
steps:
- name: Checkout
uses: actions/checkout@v7
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 4 additions & 2 deletions pint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
"android",
"ios",
"resources",
"stubs"
"stubs",
".github"
],
"notPath": [
"vendor"
"vendor",
"rector.php"
],
"rules": {
"declare_strict_types": true,
Expand Down
3 changes: 1 addition & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 0 additions & 1 deletion src/Contracts/{{ plugin }}Contract.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ interface {{ plugin }}Contract
* Invoke the template bridge function and return the normalized native response.
*
* @param array<string, mixed> $payload
*
* @return array<string, mixed>
*/
public function example(array $payload = []): array;
Expand Down
9 changes: 4 additions & 5 deletions src/Events/{{ plugin }}Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -16,8 +16,7 @@ final class {{ plugin }}Event
* @param array<string, mixed> $payload
*/
public function __construct(
public readonly string $name,
public readonly array $payload = [],
) {
}
public string $name,
public array $payload = [],
) {}
}
12 changes: 5 additions & 7 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 class Plugin implements {{ plugin }}Contract
final readonly class Plugin implements {{ plugin }}Contract
{
public function __construct(
private readonly Application $app,
) {
}
private Application $app,
) {}

public function example(array $payload = []): array
{
Expand All @@ -24,7 +23,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.');
Expand All @@ -49,7 +48,6 @@ public function isAvailable(): bool

/**
* @param array<string, mixed> $payload
*
* @return array<string, mixed>
*/
private function callBridge(string $function, array $payload): array
Expand Down
4 changes: 2 additions & 2 deletions src/Providers/{{ plugin }}ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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');
}
}
7 changes: 3 additions & 4 deletions src/Support/Manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@

use InvalidArgumentException;

final class Manifest
final readonly class Manifest
{
/**
* @param array<string, mixed> $manifest
*/
public function __construct(
private readonly array $manifest,
) {
}
private array $manifest,
) {}

public function namespace(): string
{
Expand Down
4 changes: 1 addition & 3 deletions src/Testing/BridgeFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ final class BridgeFake
/**
* @param array<string, array<string, mixed>|Closure> $responses
*/
public function __construct(private array $responses = [])
{
}
public function __construct(private array $responses = []) {}

/**
* @param array<string, mixed> $payload
Expand Down
8 changes: 4 additions & 4 deletions tests/ManifestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion tests/PluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
{
/**
* @param array<string, mixed> $payload
*
* @return array<string, mixed>
*/
public function call(string $function, array $payload): array
Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

namespace {{ namespace }}\Tests;

use Orchestra\Testbench\TestCase as Orchestra;
use {{ namespace }}\Providers\{{ plugin }}ServiceProvider;
use Illuminate\Foundation\Application;
use Orchestra\Testbench\TestCase as Orchestra;

abstract class TestCase extends Orchestra
{
/**
* @param \Illuminate\Foundation\Application $app
*
* @param Application $app
* @return list<class-string>
*/
protected function getPackageProviders($app): array
Expand Down
Loading