From 1e7c6ec70013f5d5e0e849566e6a102306774a20 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Mon, 11 Mar 2024 13:29:49 -0400 Subject: [PATCH] Upgrade dev tools; raise PHP requirement to 8.1. --- .github/workflows/ci.yaml | 6 +++--- CHANGELOG.md | 2 +- composer.json | 16 ++++++++-------- tests/ISBNTest.php | 6 +++--- tests/ISMNTest.php | 6 +++--- tests/phpunit.xml | 16 ++++++++++------ tests/vufind.php-cs-fixer.php | 6 +++--- 7 files changed, 31 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7382012..3bdb8f0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,13 +11,13 @@ jobs: VUFIND_LOCAL_DIR: $GITHUB_WORKSPACE/local strategy: matrix: - php-version: ['8.0', '8.1', '8.2'] + php-version: ['8.1', '8.2', '8.3'] include: - - php-version: 8.0 - phing_tasks: "phpunitfast" - php-version: 8.1 phing_tasks: "phpunitfast" - php-version: 8.2 + phing_tasks: "phpunitfast" + - php-version: 8.3 phing_tasks: "phpunitfast phpcs-console php-cs-fixer-dryrun phpstan-console" steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index fee669c..ebcd4a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file, in reverse ### Changed -- The minimum PHP version requirement has been raised to 8.0. +- The minimum PHP version requirement has been raised to 8.1. - The str_starts_with and str_ends_with functions have been used instead of substr where possible. ### Deprecated diff --git a/composer.json b/composer.json index 7670a61..7de43a5 100644 --- a/composer.json +++ b/composer.json @@ -19,19 +19,19 @@ }, "config": { "platform": { - "php": "8.0" + "php": "8.1" } }, "require": { - "php": ">=8.0" + "php": ">=8.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "3.26.1", - "pear/http_request2": "2.5.1", - "phpmd/phpmd": "2.13.0", - "phpstan/phpstan": "1.10.34", - "phpunit/phpunit": "9.6.12", + "friendsofphp/php-cs-fixer": "3.51.0", + "pear/http_request2": "2.6.0", + "phpmd/phpmd": "2.15.0", + "phpstan/phpstan": "1.10.59", + "phpunit/phpunit": "10.5.11", "phing/phing": "2.17.4", - "squizlabs/php_codesniffer": "3.7.2" + "squizlabs/php_codesniffer": "3.9.0" } } diff --git a/tests/ISBNTest.php b/tests/ISBNTest.php index dc04c07..f57e807 100644 --- a/tests/ISBNTest.php +++ b/tests/ISBNTest.php @@ -67,7 +67,7 @@ public function testValidISBN10($raw, $isbn10, $isbn13) * * @return array */ - public function validISBN10() + public static function validISBN10() { return [ 'ISBN-10 plain' => ['0123456789', '0123456789', '9780123456786'], @@ -123,7 +123,7 @@ public function testInvalidISBN($raw) * * @return array */ - public function invalidISBN() + public static function invalidISBN() { return [ 'empty' => [''], @@ -157,7 +157,7 @@ public function testNormalizeISBN($raw, $isbn) * * @return array */ - public function normalizeISBN() + public static function normalizeISBN() { return [ ['', ''], diff --git a/tests/ISMNTest.php b/tests/ISMNTest.php index 0cb92bf..871e804 100644 --- a/tests/ISMNTest.php +++ b/tests/ISMNTest.php @@ -67,7 +67,7 @@ public function testValidISMN10($raw, $ismn10, $ismn13) * * @return array */ - public function validISMN10() + public static function validISMN10() { return [ 'ISMN-10 plain' => ['M230671187', 'M230671187', '9790230671187'], @@ -122,7 +122,7 @@ public function testInvalidISMN($raw) * * @return array */ - public function invalidISMN() + public static function invalidISMN() { return [ 'empty' => [''], @@ -156,7 +156,7 @@ public function testNormalizeISMN($raw, $ismn) * * @return array */ - public function normalizeISMN() + public static function normalizeISMN() { return [ ['', ''], diff --git a/tests/phpunit.xml b/tests/phpunit.xml index 64ca59a..89a9e12 100644 --- a/tests/phpunit.xml +++ b/tests/phpunit.xml @@ -1,13 +1,17 @@ - - - - ../src/VuFindCode - - + . + + + ../src + + diff --git a/tests/vufind.php-cs-fixer.php b/tests/vufind.php-cs-fixer.php index 25898bc..2ba4c1d 100644 --- a/tests/vufind.php-cs-fixer.php +++ b/tests/vufind.php-cs-fixer.php @@ -5,8 +5,8 @@ ->in(__DIR__ . '/../src'); $rules = [ - '@PHP80Migration' => true, - '@PHPUnit84Migration:risky' => true, + '@PHP81Migration' => true, + '@PHPUnit100Migration:risky' => true, '@PSR12' => true, 'align_multiline_comment' => true, 'binary_operator_spaces' => [ @@ -44,8 +44,8 @@ 'no_php4_constructor' => true, 'no_singleline_whitespace_before_semicolons' => true, 'no_spaces_around_offset' => true, + 'no_unneeded_braces' => true, 'no_unneeded_control_parentheses' => true, - 'no_unneeded_curly_braces' => true, 'no_unneeded_final_method' => true, 'no_unreachable_default_argument_value' => true, 'no_unused_imports' => true,