Skip to content

Commit c6fa6b6

Browse files
Add PHP 8.4 and 8.5 support
1 parent adfa81b commit c6fa6b6

File tree

14 files changed

+95
-108
lines changed

14 files changed

+95
-108
lines changed

.cs.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@
99
[
1010
'@PSR1' => true,
1111
'@PSR2' => true,
12-
'@Symfony' => true,
13-
'psr_autoloading' => true,
1412
// custom rules
13+
'psr_autoloading' => true,
1514
'align_multiline_comment' => ['comment_type' => 'phpdocs_only'], // psr-5
1615
'phpdoc_to_comment' => false,
1716
'no_superfluous_phpdoc_tags' => false,
1817
'array_indentation' => true,
1918
'array_syntax' => ['syntax' => 'short'],
2019
'cast_spaces' => ['space' => 'none'],
2120
'concat_space' => ['spacing' => 'one'],
22-
'compact_nullable_typehint' => true,
21+
'compact_nullable_type_declaration' => true,
2322
'declare_equal_normalize' => ['space' => 'single'],
2423
'general_phpdoc_annotation_remove' => [
2524
'annotations' => [
@@ -36,7 +35,11 @@
3635
'phpdoc_order' => true, // psr-5
3736
'phpdoc_no_useless_inheritdoc' => false,
3837
'protected_to_private' => false,
39-
'yoda_style' => false,
38+
'yoda_style' => [
39+
'equal' => false,
40+
'identical' => false,
41+
'less_and_greater' => false
42+
],
4043
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
4144
'ordered_imports' => [
4245
'sort_algorithm' => 'alpha',
@@ -47,6 +50,7 @@
4750
'blank_line_between_import_groups' => true,
4851
'fully_qualified_strict_types' => true,
4952
'no_null_property_initialization' => false,
53+
'nullable_type_declaration_for_default_null_value' => false,
5054
'operator_linebreak' => [
5155
'only_booleans' => true,
5256
'position' => 'beginning',
@@ -55,6 +59,16 @@
5559
'import_classes' => true,
5660
'import_constants' => null,
5761
'import_functions' => null
62+
],
63+
'class_definition' => [
64+
'space_before_parenthesis' => true,
65+
],
66+
'trailing_comma_in_multiline' => [
67+
'after_heredoc' => true,
68+
'elements' => ['array_destructuring', 'arrays', 'match']
69+
],
70+
'function_declaration' => [
71+
'closure_fn_spacing' => 'none',
5872
]
5973
]
6074
)

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ indent_style = tab
1919
indent_size = 4
2020

2121
[*.yml]
22-
indent_size = 4
22+
indent_size = 2

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
/tests export-ignore
1616
/build export-ignore
1717
/docs export-ignore
18+
/.github export-ignore
1819
/build.xml export-ignore
1920
/phpunit.xml export-ignore
2021
/.gitattributes export-ignore
2122
/.gitignore export-ignore
22-
/.scrutinizer.* export-ignore
2323
/.editorconfig export-ignore
2424

2525
# Define binary file attributes.

.github/workflows/build.yml

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,50 @@ name: build
33
on: [ push, pull_request ]
44

55
jobs:
6-
run:
7-
runs-on: ${{ matrix.operating-system }}
8-
strategy:
9-
matrix:
10-
operating-system: [ ubuntu-latest ]
11-
php-versions: [ '8.1', '8.2' ]
12-
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
13-
14-
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v1
17-
18-
- name: Setup PHP
19-
uses: shivammathur/setup-php@v2
20-
with:
21-
php-version: ${{ matrix.php-versions }}
22-
extensions: mbstring, intl, zip, gmp
23-
coverage: none
24-
25-
- name: Check PHP Version
26-
run: php -v
27-
28-
- name: Check Composer Version
29-
run: composer -V
30-
31-
- name: Check PHP Extensions
32-
run: php -m
33-
34-
- name: Validate composer.json and composer.lock
35-
run: composer validate
36-
37-
- name: Install dependencies
38-
run: composer install --prefer-dist --no-progress --no-suggest
39-
40-
- name: Run test suite
41-
run: composer test:all
6+
run:
7+
runs-on: ${{ matrix.operating-system }}
8+
strategy:
9+
matrix:
10+
operating-system: [ ubuntu-latest ]
11+
php-versions: [ '8.1', '8.2', '8.3', '8.4', '8.5' ]
12+
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v5
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php-versions }}
22+
extensions: gmp
23+
coverage: xdebug
24+
25+
- name: Check PHP Version
26+
run: php -v
27+
28+
- name: Check Composer Version
29+
run: composer -V
30+
31+
- name: Validate composer.json and composer.lock
32+
run: composer validate
33+
34+
- name: Install dependencies
35+
run: composer update --prefer-dist --no-progress --no-suggest
36+
37+
- name: Run PHP Coding Standards Fixer
38+
run: composer cs:check
39+
40+
- name: Run PHP CodeSniffer
41+
run: composer sniffer:check
42+
43+
- name: Run PHPStan
44+
run: composer stan
45+
46+
- name: Run tests
47+
if: ${{ matrix.php-versions != '8.4' }}
48+
run: composer test
49+
50+
- name: Run tests with coverage
51+
if: ${{ matrix.php-versions == '8.4' }}
52+
run: composer test:coverage

.scrutinizer.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2023 odan
3+
Copyright (c) 2025 odan
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
[![Latest Version on Packagist](https://img.shields.io/github/release/selective-php/xmldsig.svg)](https://packagist.org/packages/selective/xmldsig)
44
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)
55
[![Build Status](https://github.com/selective-php/xmldsig/workflows/build/badge.svg)](https://github.com/selective-php/xmldsig/actions)
6-
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/selective-php/xmldsig.svg)](https://scrutinizer-ci.com/g/selective-php/xmldsig/code-structure)
7-
[![Quality Score](https://img.shields.io/scrutinizer/quality/g/selective-php/xmldsig.svg)](https://scrutinizer-ci.com/g/selective-php/xmldsig/?branch=master)
86
[![Total Downloads](https://img.shields.io/packagist/dt/selective/xmldsig.svg)](https://packagist.org/packages/selective/xmldsig/stats)
97

108
## Features
@@ -15,7 +13,7 @@
1513

1614
## Requirements
1715

18-
* PHP 8.1+
16+
* PHP 8.1 - 8.5
1917
* The openssl extension
2018
* A X.509 digital certificate
2119

composer.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@
1111
],
1212
"homepage": "https://github.com/selective-php/xmldsig",
1313
"require": {
14-
"php": "~8.1 || ~8.2",
14+
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
1515
"ext-dom": "*",
1616
"ext-openssl": "*"
1717
},
1818
"require-dev": {
1919
"friendsofphp/php-cs-fixer": "^3",
20-
"phpstan/phpstan": "^1",
21-
"phpunit/phpunit": "^10",
22-
"squizlabs/php_codesniffer": "^3",
23-
"starkbank/ecdsa": "^2.0"
20+
"phpstan/phpstan": "^2",
21+
"phpunit/phpunit": "^10 || ^12",
22+
"squizlabs/php_codesniffer": "^4",
23+
"starkbank/ecdsa": "^2.0",
24+
"ext-gmp": "*"
2425
},
2526
"autoload": {
2627
"psr-4": {
@@ -38,23 +39,24 @@
3839
},
3940
"scripts": {
4041
"cs:check": [
41-
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
42-
"php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi"
42+
"php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi --allow-unsupported-php-version=yes"
4343
],
4444
"cs:fix": [
45-
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
46-
"php-cs-fixer fix --config=.cs.php --ansi --verbose"
45+
"php-cs-fixer fix --config=.cs.php --ansi --verbose --allow-unsupported-php-version=yes"
4746
],
4847
"sniffer:check": "phpcs --standard=phpcs.xml",
4948
"sniffer:fix": "phpcbf --standard=phpcs.xml",
5049
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi",
51-
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always",
50+
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always --display-warnings --display-deprecations --no-coverage",
5251
"test:all": [
5352
"@cs:check",
5453
"@sniffer:check",
5554
"@stan",
5655
"@test"
5756
],
58-
"test:coverage": "php -d xdebug.mode=coverage -r \"require 'vendor/bin/phpunit';\" -- --configuration phpunit.xml --do-not-cache-result --colors=always --coverage-clover build/logs/clover.xml --coverage-html build/coverage"
57+
"test:coverage": [
58+
"@putenv XDEBUG_MODE=coverage",
59+
"phpunit --configuration phpunit.xml --do-not-cache-result --colors=always --display-warnings --display-deprecations --coverage-clover build/coverage/clover.xml --coverage-html build/coverage --coverage-text"
60+
]
5961
}
6062
}

phpstan.neon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
parameters:
22
level: 8
3-
checkGenericClassInNonGenericObjectType: false
43
reportUnmatchedIgnoredErrors: false
4+
treatPhpDocTypesAsCertain: false
55
paths:
66
- src
77
ignoreErrors:
8+
- identifier: missingType.generics
89
- '#has unknown class OpenSSLAsymmetricKey as its type#'
910
- '#(.*)OpenSSLAsymmetricKey(.*)null(.*) does not accept resource#'
1011
- '#openssl_free_key expects resource(.*) OpenSSLAsymmetricKey given#'

phpunit.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
bootstrap="vendor/autoload.php"
44
colors="true"
55
backupGlobals="false"
6-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
7-
cacheDirectory=".phpunit.cache"
8-
backupStaticProperties="false">
9-
<coverage/>
6+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.5/phpunit.xsd">
107
<testsuites>
118
<testsuite name="Tests">
129
<directory suffix="Test.php">tests</directory>

0 commit comments

Comments
 (0)