From 29b877947e75a09339b54a943df3909a7423ccf5 Mon Sep 17 00:00:00 2001 From: WINBIGFOX Date: Mon, 31 Mar 2025 10:59:10 +0200 Subject: [PATCH 1/8] fix: initialize properties in Alert class and update new method signature (#529) --- src/Alert.php | 14 +++++++------- src/Facades/Alert.php | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Alert.php b/src/Alert.php index d00e7eff..1303721c 100644 --- a/src/Alert.php +++ b/src/Alert.php @@ -6,21 +6,21 @@ class Alert { - protected ?string $type; + protected ?string $type = null; - protected ?string $title; + protected ?string $title = null; - protected ?string $detail; + protected ?string $detail = null; - protected ?array $buttons; + protected ?array $buttons = null; - protected ?int $defaultId; + protected ?int $defaultId = null; - protected ?int $cancelId; + protected ?int $cancelId = null; final public function __construct(protected Client $client) {} - public static function new() + public static function new(): self { return new static(new Client); } diff --git a/src/Facades/Alert.php b/src/Facades/Alert.php index a4b151fa..2d5e1f2b 100644 --- a/src/Facades/Alert.php +++ b/src/Facades/Alert.php @@ -5,6 +5,7 @@ use Illuminate\Support\Facades\Facade; /** + * @method static static new() * @method static static type(string $type) * @method static static title(string $title) * @method static static detail(string $detail) From afe7316242a51789e5e943ebac749dddc7b78240 Mon Sep 17 00:00:00 2001 From: WINBIGFOX Date: Mon, 31 Mar 2025 11:01:42 +0200 Subject: [PATCH 2/8] feat: add theme method to System class and create SystemThemesEnum (#530) --- src/Enums/SystemThemesEnum.php | 10 ++++++++++ src/Facades/System.php | 2 ++ src/System.php | 14 ++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 src/Enums/SystemThemesEnum.php diff --git a/src/Enums/SystemThemesEnum.php b/src/Enums/SystemThemesEnum.php new file mode 100644 index 00000000..e290dbca --- /dev/null +++ b/src/Enums/SystemThemesEnum.php @@ -0,0 +1,10 @@ +client->post('system/theme', [ + 'theme' => $theme, + ])->json('result'); + } else { + $result = $this->client->get('system/theme')->json('result'); + } + + return SystemThemesEnum::from($result); + } } From 15b6d75b98d4ea9bf69b0fb8aab9001061fa571d Mon Sep 17 00:00:00 2001 From: Peter Bishop <9081809+PeteBishwhip@users.noreply.github.com> Date: Mon, 31 Mar 2025 15:47:23 +0100 Subject: [PATCH 3/8] PHP Support Sync (#532) * Set PHP support to min 8.3 * Drop PHP 8.1 and 8.2 support from workflows --- .github/workflows/run-tests.yml | 8 +------- composer.json | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index a1909f62..18fb032d 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,16 +13,10 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - php: [8.4, 8.3, 8.2, 8.1] + php: [8.4, 8.3] laravel: [12.*, 11.*, 10.*] stability: [prefer-lowest, prefer-stable] - exclude: - - laravel: 11.* - php: 8.1 - - laravel: 12.* - php: 8.1 - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} steps: diff --git a/composer.json b/composer.json index 71336edd..73e68c51 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ } ], "require": { - "php": "^8.1", + "php": "^8.3", "illuminate/contracts": "^10.0|^11.0|^12.0", "spatie/laravel-package-tools": "^1.16.4", "symfony/finder": "^6.2|^7.0" From c1f334dc268103b5772d46f455de93a846c0c042 Mon Sep 17 00:00:00 2001 From: WINBIGFOX Date: Mon, 31 Mar 2025 17:20:40 +0200 Subject: [PATCH 4/8] feat: add copyright notice configuration to nativephp.php (#534) --- config/nativephp.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/nativephp.php b/config/nativephp.php index 1ecd30aa..817bc12b 100644 --- a/config/nativephp.php +++ b/config/nativephp.php @@ -31,6 +31,11 @@ */ 'author' => env('NATIVEPHP_APP_AUTHOR'), + /** + * The copyright notice for your application. + */ + 'copyright' => env('NATIVEPHP_APP_COPYRIGHT'), + /** * The default service provider for your application. This provider * takes care of bootstrapping your application and configuring From 5ca07c4450233a397d4258abf7764a61ba6da129 Mon Sep 17 00:00:00 2001 From: Eser DENIZ Date: Tue, 1 Apr 2025 14:57:07 +0200 Subject: [PATCH 5/8] fix: $iniSettings on ChildProcess.php (#535) * fix: $iniSettings on ChildProcess.php * fix: ensure properties are set only if they exist * fix: throw exception for non-existent properties in ChildProcess --- src/ChildProcess.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ChildProcess.php b/src/ChildProcess.php index 19a94201..6ba99721 100644 --- a/src/ChildProcess.php +++ b/src/ChildProcess.php @@ -19,6 +19,8 @@ class ChildProcess implements ChildProcessContract public readonly bool $persistent; + public readonly ?array $iniSettings; + final public function __construct(protected Client $client) {} public function get(?string $alias = null): ?self @@ -147,6 +149,10 @@ protected function fromRuntimeProcess($process) } foreach ($process['settings'] as $key => $value) { + if (! property_exists($this, $key)) { + throw new \RuntimeException("Property {$key} does not exist on ".__CLASS__); + } + $this->{$key} = $value; } From 1e525896b0af75dec8cd1e6cd74035a0983d99f7 Mon Sep 17 00:00:00 2001 From: Eser DENIZ Date: Wed, 2 Apr 2025 14:52:13 +0200 Subject: [PATCH 6/8] fix: menu facade + better default for quit (#536) --- src/Facades/Menu.php | 37 +++++++++++++++++++------------------ src/Menu/MenuBuilder.php | 4 ++++ 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/Facades/Menu.php b/src/Facades/Menu.php index 332de247..d197305e 100644 --- a/src/Facades/Menu.php +++ b/src/Facades/Menu.php @@ -19,25 +19,26 @@ * @method static Link route(string $url, string $label = null, ?string $hotkey = null) * @method static Radio radio(string $label, bool $checked = false, ?string $hotkey = null) * @method static Role app() - * @method static Role file() - * @method static Role edit() - * @method static Role view() - * @method static Role window() - * @method static Role help() - * @method static Role fullscreen() + * @method static Role about(?string $label = null) + * @method static Role file(?string $label = null) + * @method static Role edit(?string $label = null) + * @method static Role view(?string $label = null) + * @method static Role window(?string $label = null) + * @method static Role help(?string $label = null) + * @method static Role fullscreen(?string $label = null) * @method static Role separator() - * @method static Role devTools() - * @method static Role undo() - * @method static Role redo() - * @method static Role cut() - * @method static Role copy() - * @method static Role paste() - * @method static Role pasteAndMatchStyle() - * @method static Role reload() - * @method static Role minimize() - * @method static Role close() - * @method static Role quit() - * @method static Role hide() + * @method static Role devTools(?string $label = null) + * @method static Role undo(?string $label = null) + * @method static Role redo(?string $label = null) + * @method static Role cut(?string $label = null) + * @method static Role copy(?string $label = null) + * @method static Role paste(?string $label = null) + * @method static Role pasteAndMatchStyle(?string $label = null) + * @method static Role reload(?string $label = null) + * @method static Role minimize(?string $label = null) + * @method static Role close(?string $label = null) + * @method static Role quit(?string $label = null) + * @method static Role hide(?string $label = null) * @method static void create(MenuItem ...$items) * @method static void default() */ diff --git a/src/Menu/MenuBuilder.php b/src/Menu/MenuBuilder.php index f0627f78..f2ef764a 100644 --- a/src/Menu/MenuBuilder.php +++ b/src/Menu/MenuBuilder.php @@ -150,6 +150,10 @@ public function close(?string $label = null): Items\Role public function quit(?string $label = null): Items\Role { + if (is_null($label)) { + $label = __('Quit').' '.config('app.name'); + } + return new Items\Role(RolesEnum::QUIT, $label); } From 91f487cb40fdea5ce737fc7128f4f17dc2a2e92f Mon Sep 17 00:00:00 2001 From: Eser DENIZ Date: Thu, 3 Apr 2025 14:37:25 +0200 Subject: [PATCH 7/8] fix: failed jobs on the nativephp database (#538) * fix: failed jobs on the nativephp database * fix: add batching database configuration for nativephp queue * fix: add database connection configuration for nativephp queue --- src/NativeServiceProvider.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/NativeServiceProvider.php b/src/NativeServiceProvider.php index 7e000a70..a1910a4b 100644 --- a/src/NativeServiceProvider.php +++ b/src/NativeServiceProvider.php @@ -172,6 +172,9 @@ public function rewriteDatabase() ]); config(['database.default' => 'nativephp']); + config(['queue.failed.database' => 'nativephp']); + config(['queue.batching.database' => 'nativephp']); + config(['queue.connections.database.connection' => 'nativephp']); if (file_exists($databasePath)) { DB::statement('PRAGMA journal_mode=WAL;'); From 9e9166d698e55e1877ba1726ba7d25999c85065f Mon Sep 17 00:00:00 2001 From: Peter Bishop <9081809+PeteBishwhip@users.noreply.github.com> Date: Mon, 7 Apr 2025 15:52:57 +0100 Subject: [PATCH 8/8] Remove L10 from test matrix (#541) * Remove L10 from test matrix * Remove PHPStan ignore line... --- .github/workflows/run-tests.yml | 2 +- src/NativeServiceProvider.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 18fb032d..68e6ca9b 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,7 +14,7 @@ jobs: matrix: os: [ubuntu-latest, windows-latest] php: [8.4, 8.3] - laravel: [12.*, 11.*, 10.*] + laravel: [12.*, 11.*] stability: [prefer-lowest, prefer-stable] name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} diff --git a/src/NativeServiceProvider.php b/src/NativeServiceProvider.php index a1910a4b..ad222f9b 100644 --- a/src/NativeServiceProvider.php +++ b/src/NativeServiceProvider.php @@ -51,7 +51,6 @@ public function packageRegistered() $this->mergeConfigFrom($this->package->basePath('/../config/nativephp-internal.php'), 'nativephp-internal'); $this->app->singleton(FreshCommand::class, function ($app) { - /* @phpstan-ignore-next-line (beacause we support Laravel 10 & 11) */ return new FreshCommand($app['migrator']); });