diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 45aeef0..7382012 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: ['7.4', '8.0', '8.1'] + php-version: ['8.0', '8.1', '8.2'] include: - - php-version: 7.4 - phing_tasks: "phpunitfast" - php-version: 8.0 phing_tasks: "phpunitfast" - php-version: 8.1 + phing_tasks: "phpunitfast" + - php-version: 8.2 phing_tasks: "phpunitfast phpcs-console php-cs-fixer-dryrun phpstan-console" steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b2c504..55af199 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 7.4.1. +- The minimum PHP version requirement has been raised to 8.0. ### Deprecated diff --git a/build.xml b/build.xml index 7f38279..c36bfc4 100644 --- a/build.xml +++ b/build.xml @@ -33,10 +33,8 @@ - - @@ -45,21 +43,11 @@ - - - - - - - - - - diff --git a/composer.json b/composer.json index eefb6bb..7670a61 100644 --- a/composer.json +++ b/composer.json @@ -19,21 +19,19 @@ }, "config": { "platform": { - "php": "7.4.1" + "php": "8.0" } }, "require": { - "php": ">=7.4.1" + "php": ">=8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "3.14.4", + "friendsofphp/php-cs-fixer": "3.26.1", "pear/http_request2": "2.5.1", - "phploc/phploc": "7.0.2", "phpmd/phpmd": "2.13.0", - "phpstan/phpstan": "1.10.3", - "phpunit/phpunit": "9.6.4", + "phpstan/phpstan": "1.10.34", + "phpunit/phpunit": "9.6.12", "phing/phing": "2.17.4", - "sebastian/phpcpd": "6.0.3", "squizlabs/php_codesniffer": "3.7.2" } } diff --git a/src/VuFindCode/EAN.php b/src/VuFindCode/EAN.php index 823150b..c8f7821 100644 --- a/src/VuFindCode/EAN.php +++ b/src/VuFindCode/EAN.php @@ -29,6 +29,9 @@ namespace VuFindCode; +use function intval; +use function strlen; + /** * EAN Class * diff --git a/src/VuFindCode/ISBN.php b/src/VuFindCode/ISBN.php index beac643..ce85bec 100644 --- a/src/VuFindCode/ISBN.php +++ b/src/VuFindCode/ISBN.php @@ -29,6 +29,9 @@ namespace VuFindCode; +use function intval; +use function strlen; + /** * ISBN Class * diff --git a/src/VuFindCode/ISMN.php b/src/VuFindCode/ISMN.php index 2b6c262..83d219c 100644 --- a/src/VuFindCode/ISMN.php +++ b/src/VuFindCode/ISMN.php @@ -29,6 +29,8 @@ namespace VuFindCode; +use function strlen; + /** * ISMN Class * diff --git a/tests/vufind.php-cs-fixer.php b/tests/vufind.php-cs-fixer.php index ad9f3ff..25898bc 100644 --- a/tests/vufind.php-cs-fixer.php +++ b/tests/vufind.php-cs-fixer.php @@ -5,7 +5,7 @@ ->in(__DIR__ . '/../src'); $rules = [ - '@PHP74Migration' => true, + '@PHP80Migration' => true, '@PHPUnit84Migration:risky' => true, '@PSR12' => true, 'align_multiline_comment' => true, @@ -17,12 +17,22 @@ 'class_attributes_separation' => ['elements' => ['method' => 'one', 'property' => 'one']], 'concat_space' => ['spacing' => 'one'], 'ereg_to_preg' => true, - 'function_typehint_space' => true, + 'get_class_to_class_keyword' => true, + 'global_namespace_import' => [ + 'import_functions' => true, + 'import_classes' => null, + ], 'is_null' => true, 'linebreak_after_opening_tag' => true, 'lowercase_cast' => true, 'magic_constant_casing' => true, + 'modernize_strpos' => true, 'native_function_casing' => true, + 'native_function_invocation' => [ + 'strict' => true, + 'scope' => 'namespaced', + ], + 'no_alias_functions' => true, 'no_blank_lines_after_class_opening' => true, 'no_empty_comment' => true, 'no_empty_phpdoc' => true, @@ -31,21 +41,29 @@ 'no_leading_import_slash' => true, 'no_leading_namespace_whitespace' => true, 'no_mixed_echo_print' => true, + 'no_php4_constructor' => true, 'no_singleline_whitespace_before_semicolons' => true, 'no_spaces_around_offset' => 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, 'no_useless_return' => true, 'no_whitespace_in_blank_line' => true, 'non_printable_character' => true, - 'ordered_imports' => true, + 'ordered_imports' => [ + 'imports_order' => ['class', 'function', 'const'], + 'sort_algorithm' => 'alpha', + ], 'phpdoc_no_access' => true, 'php_unit_method_casing' => true, 'pow_to_exponentiation' => true, 'single_line_after_imports' => true, + 'single_quote' => true, 'standardize_not_equals' => true, 'ternary_operator_spaces' => true, + 'type_declaration_spaces' => true, ]; $cacheDir = __DIR__ . '/../.php_cs_cache';