From 9b6695b654d192ad3fac0e6ffaf2890d0bcfda20 Mon Sep 17 00:00:00 2001 From: Bob Mulder Date: Thu, 18 Dec 2025 22:26:30 +0100 Subject: [PATCH 1/3] ci: update workflows to test PHP 8.1 and upgrade actions to v4 --- .github/workflows/psalm.yml | 12 ++++++++---- .github/workflows/run-tests.yml | 10 ++++++---- .gitignore | 1 + .php-cs-fixer.cache | 2 +- composer.json | 2 +- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index ec1935b..d51c32e 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -10,21 +10,25 @@ jobs: psalm: name: psalm runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + php: [7.4, 8.0, 8.1] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '7.4' + php-version: ${{ matrix.php }} extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick coverage: none - name: Cache composer dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: vendor - key: composer-${{ hashFiles('composer.lock') }} + key: composer-${{ hashFiles('composer.lock') }}-php-${{ matrix.php }} - name: Run composer install run: composer install -n --prefer-dist diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index fcf4f45..66f5668 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,20 +9,22 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, windows-latest] - php: [8.0, 7.4] + php: [7.4, 8.0, 8.1] dependency-version: [prefer-lowest, prefer-stable] name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.composer/cache/files - key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}-${{ hashFiles('composer.lock') }} + restore-keys: | + dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}- - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.gitignore b/.gitignore index 0296b57..a24eeab 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ docs phpunit.xml psalm.xml vendor +.aider* diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache index 8b97232..a03ac54 100644 --- a/.php-cs-fixer.cache +++ b/.php-cs-fixer.cache @@ -1 +1 @@ -{"php":"8.1.11","version":"3.12.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":true,"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":{"elements":["method","property"]},"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"ordered_imports":{"sort_algorithm":"alpha"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true},"hashes":{"src\/Exception\/DecimalExponentError.php":1736274169,"src\/Exception\/InvalidRoundingModeException.php":3542940972,"src\/Exception\/DivisionByZeroError.php":2664138164,"src\/Exception\/InvalidNumberInputTypeException.php":3223917936,"src\/Number.php":4121703225,"src\/Formatter\/Formatter.php":727554344,"src\/AbstractNumber.php":2623074418,"tests\/TestClasses\/Money.php":2635391771,"tests\/AbstractNumberImplementationTest.php":1574989408,"tests\/NumberTest.php":1428717048}} \ No newline at end of file +{"php":"8.2.28","version":"3.92.3:v3.92.3#2ba8f5a60f6f42fb65758cfb3768434fa2d1c7e8","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces_position":true,"class_definition":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":{"closure_fn_spacing":"one"},"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"modifier_keywords":{"elements":["method","property"]},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"single_space_around_construct":{"constructs_followed_by_a_single_space":["abstract","as","case","catch","class","do","else","elseif","final","for","foreach","function","if","interface","namespace","private","protected","public","static","switch","trait","try","use_lambda","while"],"constructs_preceded_by_a_single_space":["as","else","elseif","use_lambda"]},"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"ordered_imports":{"sort_algorithm":"alpha"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true},"ruleCustomisationPolicyVersion":"null-policy","hashes":{"src\/Number.php":"24aa9f086b4d1f1dca036b52579161aa","src\/Formatter\/Formatter.php":"9964fe6d64137d383a5e82f8ea2da3f8","src\/AbstractNumber.php":"9b14b307a149c8265dcbb1c3c9cee006","src\/Exception\/InvalidRoundingModeException.php":"d71e665e4e240b22fdb9db64069e763d","src\/Exception\/DecimalExponentError.php":"ac4b9e400f191ce060ba161da6fb05fc","src\/Exception\/DivisionByZeroError.php":"3fde70a49d1d654451d3416b120f0589","src\/Exception\/InvalidNumberInputTypeException.php":"5a4835631a06a4c2b21662b11272d2af","tests\/AbstractNumberImplementationTest.php":"4acfadd14746301afbba928ca3c5ac48","tests\/NumberTest.php":"63f06c0b0bb535cd8e759891d05fb270","tests\/TestClasses\/Money.php":"d0cfe302a13cebba31984b8349c2ee41"}} \ No newline at end of file diff --git a/composer.json b/composer.json index 60f7279..668182e 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": "^7.4|^8.0", + "php": "^7.4|^8.0|^8.1", "ext-bcmath": "*", "ext-json": "*" }, From fb5bb1ec68f4f5bf64254122105e4d7cdddca694 Mon Sep 17 00:00:00 2001 From: Bob Mulder Date: Thu, 18 Dec 2025 22:27:48 +0100 Subject: [PATCH 2/3] ci: add PHP 8.2 support to test matrix and composer requirements --- .github/workflows/psalm.yml | 2 +- .github/workflows/run-tests.yml | 2 +- composer.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index d51c32e..cb8846b 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: true matrix: - php: [7.4, 8.0, 8.1] + php: [7.4, 8.0, 8.1, 8.2] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 66f5668..f9bba46 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,7 +9,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, windows-latest] - php: [7.4, 8.0, 8.1] + php: [7.4, 8.0, 8.1, 8.2] dependency-version: [prefer-lowest, prefer-stable] name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} diff --git a/composer.json b/composer.json index 668182e..81ff2de 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": "^7.4|^8.0|^8.1", + "php": "^7.4|^8.0|^8.1|^8.2", "ext-bcmath": "*", "ext-json": "*" }, From 8d7b87d596b3b8be35257caed2dc9c498f851651 Mon Sep 17 00:00:00 2001 From: bobmulder Date: Thu, 18 Dec 2025 21:30:30 +0000 Subject: [PATCH 3/3] Fix styling --- .php-cs-fixer.cache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache index a03ac54..b8bc7c4 100644 --- a/.php-cs-fixer.cache +++ b/.php-cs-fixer.cache @@ -1 +1 @@ -{"php":"8.2.28","version":"3.92.3:v3.92.3#2ba8f5a60f6f42fb65758cfb3768434fa2d1c7e8","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces_position":true,"class_definition":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":{"closure_fn_spacing":"one"},"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"modifier_keywords":{"elements":["method","property"]},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"single_space_around_construct":{"constructs_followed_by_a_single_space":["abstract","as","case","catch","class","do","else","elseif","final","for","foreach","function","if","interface","namespace","private","protected","public","static","switch","trait","try","use_lambda","while"],"constructs_preceded_by_a_single_space":["as","else","elseif","use_lambda"]},"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"ordered_imports":{"sort_algorithm":"alpha"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true},"ruleCustomisationPolicyVersion":"null-policy","hashes":{"src\/Number.php":"24aa9f086b4d1f1dca036b52579161aa","src\/Formatter\/Formatter.php":"9964fe6d64137d383a5e82f8ea2da3f8","src\/AbstractNumber.php":"9b14b307a149c8265dcbb1c3c9cee006","src\/Exception\/InvalidRoundingModeException.php":"d71e665e4e240b22fdb9db64069e763d","src\/Exception\/DecimalExponentError.php":"ac4b9e400f191ce060ba161da6fb05fc","src\/Exception\/DivisionByZeroError.php":"3fde70a49d1d654451d3416b120f0589","src\/Exception\/InvalidNumberInputTypeException.php":"5a4835631a06a4c2b21662b11272d2af","tests\/AbstractNumberImplementationTest.php":"4acfadd14746301afbba928ca3c5ac48","tests\/NumberTest.php":"63f06c0b0bb535cd8e759891d05fb270","tests\/TestClasses\/Money.php":"d0cfe302a13cebba31984b8349c2ee41"}} \ No newline at end of file +{"php":"8.5.0","version":"3.92.2","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces_position":true,"class_definition":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":{"closure_fn_spacing":"one"},"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"modifier_keywords":{"elements":["method","property"]},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"single_space_around_construct":{"constructs_followed_by_a_single_space":["abstract","as","case","catch","class","do","else","elseif","final","for","foreach","function","if","interface","namespace","private","protected","public","static","switch","trait","try","use_lambda","while"],"constructs_preceded_by_a_single_space":["as","else","elseif","use_lambda"]},"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"ordered_imports":{"sort_algorithm":"alpha"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true},"ruleCustomisationPolicyVersion":"null-policy","hashes":{"src\/Number.php":"24aa9f086b4d1f1dca036b52579161aa","src\/Formatter\/Formatter.php":"9964fe6d64137d383a5e82f8ea2da3f8","src\/AbstractNumber.php":"9b14b307a149c8265dcbb1c3c9cee006","src\/Exception\/InvalidRoundingModeException.php":"d71e665e4e240b22fdb9db64069e763d","src\/Exception\/DecimalExponentError.php":"ac4b9e400f191ce060ba161da6fb05fc","src\/Exception\/InvalidNumberInputTypeException.php":"5a4835631a06a4c2b21662b11272d2af","src\/Exception\/DivisionByZeroError.php":"3fde70a49d1d654451d3416b120f0589","tests\/NumberTest.php":"63f06c0b0bb535cd8e759891d05fb270","tests\/AbstractNumberImplementationTest.php":"4acfadd14746301afbba928ca3c5ac48","tests\/TestClasses\/Money.php":"d0cfe302a13cebba31984b8349c2ee41"}} \ No newline at end of file