From 141921c32f33f86af97f383d900231feab82e451 Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sun, 16 Feb 2025 20:03:56 +0900 Subject: [PATCH 1/2] build: drop PHP 8.0 support and add support for PHP 8.4 As per https://www.php.net/supported-versions.php, PHP 8.0 is EOL. Signed-off-by: Sacha Telgenhof --- .github/workflows/coding-standard.yml | 2 +- .github/workflows/static-analysis.yml | 2 +- .github/workflows/testing.yml | 2 +- .phan/config.php | 22 ++++++++++++++-------- composer.json | 2 +- rector.php | 2 +- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/coding-standard.yml b/.github/workflows/coding-standard.yml index 19a1a5cb1..c21c77a13 100644 --- a/.github/workflows/coding-standard.yml +++ b/.github/workflows/coding-standard.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest, windows-latest] - php-versions: ["8.0", "8.1", "8.2", "8.3"] + php-versions: ["8.1", "8.2", "8.3", "8.4"] steps: - name: Set git to use LF diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 481611107..280977796 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest, windows-latest] - php-versions: ["8.0", "8.1", "8.2", "8.3"] + php-versions: ["8.1", "8.2", "8.3", "8.4"] steps: - name: Set git to use LF diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 7e8d04270..c13d19714 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest, windows-latest] - php-versions: ["8.0", "8.1", "8.2", "8.3"] + php-versions: ["8.1", "8.2", "8.3", "8.4"] steps: - name: Set git to use LF diff --git a/.phan/config.php b/.phan/config.php index 665b102f6..3f0142836 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -4,8 +4,8 @@ use Phan\Issue; -/* - * This configuration file was automatically generated by 'phan --init --init-level=1' +/** + * This configuration file was automatically generated by 'phan --init --init-level=3' * * TODOs (added by 'phan --init'): * @@ -37,21 +37,22 @@ * '-d' flag. */ return [ + // The PHP version that the codebase will be checked for compatibility against. // For best results, the PHP binary used to run Phan should have the same PHP version. // (Phan relies on Reflection for some types, param counts, // and checks for undefined classes/methods/functions) // // Supported values: `'5.6'`, `'7.0'`, `'7.1'`, `'7.2'`, `'7.3'`, `'7.4'`, - // `'8.0'`, `'8.1'`, `null`. + // `'8.0'`, `'8.1'`, `'8.2'`, `'8.3'`, `null`. // If this is set to `null`, // then Phan assumes the PHP version which is closest to the minor version // of the php executable used to execute Phan. // // Note that the **only** effect of choosing `'5.6'` is to infer that functions removed in php 7.0 exist. // (See `backward_compatibility_checks` for additional options) - // Automatically inferred from composer.json requirement for "php" of "^7.4 || ^8.0" - 'target_php_version' => '8.0', + // Automatically inferred from composer.json requirement for "php" of ">=8.1" + 'target_php_version' => '8.1', // If enabled, missing properties will be created when // they are first seen. If false, we'll report an @@ -162,7 +163,7 @@ // If true, check to make sure the return type declared // in the doc-block (if any) matches the return type // declared in the method signature. - 'check_docblock_signature_return_type_match' => true, + 'check_docblock_signature_return_type_match' => false, // This setting maps case-insensitive strings to union types. // @@ -350,8 +351,13 @@ // Thus, both first-party and third-party code being used by // your application should be included in this list. 'directory_list' => [ - 'src', - 'examples' + 'src/Yasumi', + 'vendor/azuyalabs/php-cs-fixer-config/src', + 'vendor/mikey179/vfsstream/src/main/php', + 'vendor/phan/phan/src/Phan', + 'vendor/phpstan/phpstan-deprecation-rules/src', + 'vendor/phpunit/phpunit/src', + 'vendor/vimeo/psalm/src/Psalm', ], // A list of individual files to include in analysis diff --git a/composer.json b/composer.json index 39c377374..9d1f4b777 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ } ], "require": { - "php": ">=8.0", + "php": ">=8.1", "ext-json": "*" }, "require-dev": { diff --git a/rector.php b/rector.php index 427060761..634334c88 100644 --- a/rector.php +++ b/rector.php @@ -33,7 +33,7 @@ SetList::CODE_QUALITY, SetList::DEAD_CODE, SetList::EARLY_RETURN, - SetList::PHP_80, + SetList::PHP_81, SetList::TYPE_DECLARATION, ]); }; From 2bf10b554dbe64d98526ac33ddfd3a14941c60cf Mon Sep 17 00:00:00 2001 From: Sacha Telgenhof Date: Sun, 16 Feb 2025 21:03:28 +0900 Subject: [PATCH 2/2] build: report unused classes, etc by Psalm as informational Temporarily added Psalm issue handlers regarding unused classes, methods, etc. Most of these reported are actually used as part of the public API. However not sure the best approach to address these as adding an annotation (as suggested) is not my preferred option. Removed issue handlers that seem not being reported any longer. Signed-off-by: Sacha Telgenhof --- psalm.xml.dist | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/psalm.xml.dist b/psalm.xml.dist index de8c600a6..78205c464 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -21,9 +21,10 @@ - - - + + + +