Skip to content

Commit

Permalink
Update requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
odan committed Sep 9, 2023
1 parent fb9cdf2 commit 70a2747
Show file tree
Hide file tree
Showing 10 changed files with 145 additions and 131 deletions.
22 changes: 20 additions & 2 deletions .cs.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
'cast_spaces' => ['space' => 'none'],
'concat_space' => ['spacing' => 'one'],
'compact_nullable_typehint' => true,
'declare_equal_normalize' => ['space' => 'single'],
'general_phpdoc_annotation_remove' => [
'annotations' => [
'author',
'package',
],
],
'increment_style' => ['style' => 'post'],
'list_syntax' => ['syntax' => 'short'],
'echo_tag_syntax' => ['format' => 'long'],
Expand All @@ -33,11 +40,22 @@
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
'ordered_imports' => [
'sort_algorithm' => 'alpha',
'imports_order' => ['class', 'const', 'function']
'imports_order' => ['class', 'const', 'function'],
],
'single_line_throw' => false,
'declare_strict_types' => false,
'blank_line_between_import_groups' => true,
'fully_qualified_strict_types' => true,
'global_namespace_import' => false,
'no_null_property_initialization' => false,
'operator_linebreak' => [
'only_booleans' => true,
'position' => 'beginning',
],
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => null,
'import_functions' => null
]
]
)
->setFinder(
Expand Down
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,16 @@ end_of_line = lf

[composer.json]
indent_size = 4

[*.js]
indent_size = 4

[*.neon]
indent_size = 4
indent_style = tab

[*.xml]
indent_size = 4

[*.yml]
indent_size = 4
48 changes: 19 additions & 29 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
# Set the default behavior, in case people don't have core.autocrlf set.
# Git will always convert line endings to LF on checkout. You should use
# this for files that must keep LF endings, even on Windows.
* text eol=lf

# ------------------------------------------------------------------------------
# All the files and directories that can be excluded from dist,
# we could have a more clean vendor/
#
# So when someone will install that package through with --prefer-dist option,
# all the files and directories listed in .gitattributes file will be excluded.
# This could have a big impact on big deployments and/or testing.
# ------------------------------------------------------------------------------

/build export-ignore
/docs linguist-documentation
/tests export-ignore
/.cs.php export-ignore
/.coveralls.* export-ignore
/.editorconfig export-ignore
/build export-ignore
/docs export-ignore
/build.xml export-ignore
/phpunit.xml export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.* export-ignore
/.travis.* export-ignore
/build.xml export-ignore
/phpcs.xml export-ignore
/phpstan.neon export-ignore
/phpunit.xml export-ignore

# Set the default behavior, in case people don't have core.autocrlf set.
# Git will always convert line endings to LF on checkout. You should use
# this for files that must keep LF endings, even on Windows.
* text eol=lf
/.editorconfig export-ignore

# Define binary file attributes.
# - Do not treat them as text.
Expand All @@ -29,17 +30,6 @@
*.gif binary
*.ico binary
*.jpg binary
*.jpeg binary
*.png binary
*.phar binary
*.zip binary
*.gz binary
*.otf binary
*.eot binary
*.svg binary
*.ttf binary
*.woff binary
*.woff2 binary
*.pfx binary
*.p12 binary
*.pem
*.xml
71 changes: 36 additions & 35 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,39 @@ name: build
on: [ push, pull_request ]

jobs:
run:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php-versions: [ '8.0', '8.1', '8.2' ]
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none

- name: Check PHP Version
run: php -v

- name: Check Composer Version
run: composer -V

- name: Check PHP Extensions
run: php -m

- name: Validate composer.json and composer.lock
run: composer validate

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run test suite
run: composer test:all
run:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest ]
php-versions: [ '8.1', '8.2' ]
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, zip, gmp
coverage: none

- name: Check PHP Version
run: php -v

- name: Check Composer Version
run: composer -V

- name: Check PHP Extensions
run: php -m

- name: Validate composer.json and composer.lock
run: composer validate

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run test suite
run: composer test:all
16 changes: 3 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
.idea/
nbproject/
composer.phar
composer.lock
.DS_STORE
cache.properties
.php_cs.cache
.vscode
nbproject/
vendor/
build/
.phpunit.result.cache

tests/example-test.xml
tests/signed-example.xml



.phpunit.cache/
.phpunit.result.cache
69 changes: 34 additions & 35 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
filter:
paths: [ "src/*" ]
excluded_paths: [ "vendor/*", "tests/*" ]
paths: [ "src/*" ]
excluded_paths: [ "vendor/*", "tests/*" ]

checks:
php:
code_rating: true
duplication: true
php:
code_rating: true
duplication: true

tools:
external_code_coverage: false
external_code_coverage: false

build:
environment:
php:
version: 8.1.2
ini:
xdebug.mode: coverage
mysql: false
node: false
postgresql: false
mongodb: false
elasticsearch: false
redis: false
memcached: false
neo4j: false
rabbitmq: false
nodes:
analysis:
tests:
override:
- php-scrutinizer-run
dependencies:
before:
- composer self-update
- composer install --no-interaction --prefer-dist --no-progress
tests:
before:
- command: composer test:coverage
coverage:
file: 'build/logs/clover.xml'
format: 'clover'
environment:
php:
version: 8.1.2
ini:
xdebug.mode: coverage
mysql: false
node: false
postgresql: false
mongodb: false
elasticsearch: false
redis: false
memcached: false
neo4j: false
rabbitmq: false
nodes:
analysis:
tests:
override:
- php-scrutinizer-run
dependencies:
before:
- composer self-update
tests:
before:
- command: composer test:coverage
coverage:
file: 'build/logs/clover.xml'
format: 'clover'
5 changes: 3 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License
The MIT License (MIT)

Copyright (c) 2023 Daniel Opitz
Copyright (c) 2023 odan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
],
"homepage": "https://github.com/selective-php/xmldsig",
"require": {
"php": "~8.0 || ~8.1 || ~8.2",
"php": "~8.1 || ~8.2",
"ext-dom": "*",
"ext-openssl": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3",
"phpstan/phpstan": "^1",
"phpunit/phpunit": "^9 || ^10",
"phpunit/phpunit": "^10",
"squizlabs/php_codesniffer": "^3",
"starkbank/ecdsa": "^2.0"
},
Expand All @@ -43,11 +43,11 @@
],
"cs:fix": [
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
"php-cs-fixer fix --config=.cs.php --ansi"
"php-cs-fixer fix --config=.cs.php --ansi --verbose"
],
"sniffer:check": "phpcs --standard=phpcs.xml",
"sniffer:fix": "phpcbf --standard=phpcs.xml",
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi --xdebug",
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi",
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always",
"test:all": [
"@cs:check",
Expand Down
20 changes: 11 additions & 9 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
bootstrap="vendor/autoload.php"
colors="true"
backupGlobals="false"
backupStaticAttributes="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="false">
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false">
<coverage/>
<testsuites>
<testsuite name="Tests">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
<exclude>
<directory>vendor</directory>
<directory>build</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="Tests">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
</source>
</phpunit>
4 changes: 2 additions & 2 deletions tests/XmlSignatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @coversDefaultClass \Selective\XmlDSig\XmlSigner
*/
class XmlSignatureTest extends TestCase
final class XmlSignatureTest extends TestCase
{
/**
* Test.
Expand Down Expand Up @@ -87,7 +87,7 @@ public function testSignAndVerify(string $privateKeyFile, string $publicKeyFile,
*
* @return array<int, mixed> The data
*/
public function providerTestSignAndVerify(): array
public static function providerTestSignAndVerify(): array
{
$keyFiles = [];

Expand Down

0 comments on commit 70a2747

Please sign in to comment.