From e59fe602588d9ab4b92676a9358e8f7c308a6099 Mon Sep 17 00:00:00 2001 From: Claudio Dekker Date: Thu, 24 Oct 2024 21:00:09 +0200 Subject: [PATCH] PHP 8.3 Support (#6) * Laravel Pint Fixes * PHP 8.3 Support * WIP --- .github/workflows/tests.yml | 2 +- CHANGELOG.md | 6 ++++++ composer.json | 4 ++-- src/Card.php | 4 ++-- src/Cards.php | 4 ++-- src/Components/Container.php | 2 +- src/Components/CopyButton.php | 4 ++-- src/Components/Row.php | 4 ++-- 8 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cc4367a..f115c0f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: true matrix: - php: [ 8.1, 8.2 ] + php: [ 8.1, 8.2, 8.3 ] laravel: [ 9, 10, 11 ] stability: [ 'prefer-lowest', 'prefer-stable' ] include: diff --git a/CHANGELOG.md b/CHANGELOG.md index 8997bc1..d830bf7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## [v0.1.1](https://github.com/lmsqueezy/plain-ui-components/compare/v0.1.0...v0.1.1) - 2024-10-24 + +### Added +- Laravel 11 Support ([#4](https://github.com/lmsqueezy/plain-ui-components/pull/4)) +- PHP 8.3 Support ([#6](https://github.com/lmsqueezy/plain-ui-components/pull/6)) + ## [v0.1.0](https://github.com/lmsqueezy/plain-ui-components/releases/tag/v0.1.0) - 2023-05-11 ### Added diff --git a/composer.json b/composer.json index d9b9c39..5d744ae 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "source": "https://github.com/lmsqueezy/plain-ui-components" }, "require": { - "php": "~8.1.0|~8.2.0", + "php": "~8.1.0|~8.2.0|~8.3.0", "illuminate/http": "^9.33|^10.0|^11.0", "illuminate/support": "^9.33|^10.0|^11.0" }, @@ -36,4 +36,4 @@ }, "minimum-stability": "dev", "prefer-stable": true -} \ No newline at end of file +} diff --git a/src/Card.php b/src/Card.php index 2e5dcd9..fe5ab61 100644 --- a/src/Card.php +++ b/src/Card.php @@ -24,7 +24,7 @@ class Card /** * Create a new card instance. */ - protected function __construct(string $key, int $ttl = null) + protected function __construct(string $key, ?int $ttl = null) { $this->key = $key; $this->ttl = $ttl; @@ -33,7 +33,7 @@ protected function __construct(string $key, int $ttl = null) /** * Fluently create a new card instance. */ - public static function make(string $key, int $ttl = null): static + public static function make(string $key, ?int $ttl = null): static { return new static($key, $ttl); } diff --git a/src/Cards.php b/src/Cards.php index d6c0fb8..7fd55c8 100644 --- a/src/Cards.php +++ b/src/Cards.php @@ -33,7 +33,7 @@ protected function __construct() */ public static function make(): static { - return new static(); + return new static; } /** @@ -66,7 +66,7 @@ public function bind(string $key, callable $resolver): static /** * Resolve the requested cardKeys into an array. */ - public function toArray(Request $request = null): array + public function toArray(?Request $request = null): array { $keys = $request?->json('cardKeys'); diff --git a/src/Components/Container.php b/src/Components/Container.php index 0922d02..dd810d3 100644 --- a/src/Components/Container.php +++ b/src/Components/Container.php @@ -18,7 +18,7 @@ class Container implements Component */ public static function make(): static { - return new static(); + return new static; } /** diff --git a/src/Components/CopyButton.php b/src/Components/CopyButton.php index eba9605..b8e4b9d 100644 --- a/src/Components/CopyButton.php +++ b/src/Components/CopyButton.php @@ -20,7 +20,7 @@ class CopyButton implements ContainerComponent, RowComponent /** * Create a new copy button component instance. */ - protected function __construct(string $value, string $tooltip = null) + protected function __construct(string $value, ?string $tooltip = null) { $this->value = $value; $this->tooltip = $tooltip; @@ -29,7 +29,7 @@ protected function __construct(string $value, string $tooltip = null) /** * Fluently create a new copy button component instance. */ - public static function make(string $value, string $tooltip = null): static + public static function make(string $value, ?string $tooltip = null): static { return new static($value, $tooltip); } diff --git a/src/Components/Row.php b/src/Components/Row.php index bf323e0..2051939 100644 --- a/src/Components/Row.php +++ b/src/Components/Row.php @@ -21,7 +21,7 @@ class Row implements ContainerComponent /** * Create a new row component instance. */ - public function __construct(RowComponent $main = null, RowComponent $aside = null) + public function __construct(?RowComponent $main = null, ?RowComponent $aside = null) { if ($main) { $this->addMain($main); @@ -35,7 +35,7 @@ public function __construct(RowComponent $main = null, RowComponent $aside = nul /** * Fluently create a new row component instance. */ - public static function make(RowComponent $main = null, RowComponent $aside = null): static + public static function make(?RowComponent $main = null, ?RowComponent $aside = null): static { return new static($main, $aside); }