From 544a6a13b6fe55847e03479f3a9d4b603a50c09d Mon Sep 17 00:00:00 2001 From: ildyria Date: Tue, 23 Dec 2025 09:54:54 +0100 Subject: [PATCH 1/3] memoize the result to avoid recomputing the hash every time --- config/verify.php | 2 +- src/Verify.php | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/config/verify.php b/config/verify.php index 1b3048a..325be82 100644 --- a/config/verify.php +++ b/config/verify.php @@ -14,7 +14,7 @@ ValidateSupporter::class => 'ef1a42701af6dc36e052556a0ee1c762394f9428', ValidatePro::class => '482b48f1a026684b6c1754e45ca180ffc52483ff', ValidateSignature::class => '5a8a855d4b59c44c298daa66801c79f2aba20492', - Verify::class => 'f15a25c69847bf635c7b0cc730ea24a5aaf008b8', + Verify::class => '421e83a049b1df58c73b546adb132a082075fd2c', VerifySupporterStatus::class => '6358c45ed0414c1e2697e0881238659fa6221bed', VerifyProStatus::class => '212e6ada794587ee8e2b81cf76e243d134a7e823', VerifyServiceProvider::class => '923b63b15d25e69b95ed1d5ec1c82ba57f1a7d74', diff --git a/src/Verify.php b/src/Verify.php index b1892dd..81eb17f 100755 --- a/src/Verify.php +++ b/src/Verify.php @@ -21,6 +21,8 @@ class Verify implements VerifyInterface private ValidateSupporter $validateSupporter; private ValidatePro $validatePro; + private ?Status $status; + public function __construct( #[\SensitiveParameter] ?string $config_email = null, #[\SensitiveParameter] ?string $license_key = null, @@ -41,6 +43,16 @@ public function __construct( * @return Status */ public function get_status(): Status + { + return $this->status ??= $this->resolve_status(); + } + + /** + * Private resolver for status. + * + * @return Status + */ + private function resolve_status(): Status { $base = json_encode(['url' => config('app.url'), 'email' => $this->config_email]); @@ -59,6 +71,16 @@ public function get_status(): Status return Status::FREE_EDITION; } + /** + * Reset the cached status. + * + * @return void + */ + public function reset_status(): void + { + $this->status = null; + } + /** * Validate installation. * From 0cdce7e0445238570376d92b7a38a02253824b8c Mon Sep 17 00:00:00 2001 From: ildyria Date: Tue, 23 Dec 2025 09:56:59 +0100 Subject: [PATCH 2/3] update php requirement --- .github/workflows/phpstan.yml | 2 +- .github/workflows/run-tests.yml | 7 ++----- composer.json | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 4bb3695..2f0a795 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -19,7 +19,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: '8.4' coverage: none - name: Install composer dependencies diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 5840acb..eb69d0a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -17,13 +17,10 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, windows-latest] - php: [8.3, 8.4] - laravel: [11.*, 12.*] + php: [8.3, 8.4, 8.5] + laravel: [12.*] stability: [prefer-lowest, prefer-stable] include: - - laravel: 11.* - testbench: 9.* - carbon: ^2.63 - laravel: 12.* testbench: 10.* carbon: ^3.0 diff --git a/composer.json b/composer.json index 0f9bcee..53d862f 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "homepage": "https://github.com/LycheeOrg/verify", "license": "MIT", "require": { - "php": "^8.3", + "php": "^8.4", "illuminate/contracts": "^12.0||^11.0", "thecodingmachine/safe": "^3.3" }, @@ -47,7 +47,7 @@ }, "config": { "platform": { - "php": "8.3" + "php": "8.4" }, "sort-packages": true, "allow-plugins": { From fa1ae90f9b45f70edac960b6f429a21830a34f4d Mon Sep 17 00:00:00 2001 From: ildyria Date: Tue, 23 Dec 2025 09:57:54 +0100 Subject: [PATCH 3/3] do not run php8.3 --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index eb69d0a..6533b9e 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -17,7 +17,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, windows-latest] - php: [8.3, 8.4, 8.5] + php: [8.4, 8.5] laravel: [12.*] stability: [prefer-lowest, prefer-stable] include: