Skip to content

Commit 5f88426

Browse files
committed
Update requirements
1 parent 64e08cb commit 5f88426

File tree

12 files changed

+132
-112
lines changed

12 files changed

+132
-112
lines changed

.cs.php

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
return (new PhpCsFixer\Config())
3+
use PhpCsFixer\Config;
4+
5+
return (new Config())
46
->setUsingCache(false)
57
->setRiskyAllowed(true)
68
->setRules(
@@ -19,6 +21,12 @@
1921
'concat_space' => ['spacing' => 'one'],
2022
'compact_nullable_typehint' => true,
2123
'declare_equal_normalize' => ['space' => 'single'],
24+
'general_phpdoc_annotation_remove' => [
25+
'annotations' => [
26+
'author',
27+
'package',
28+
],
29+
],
2230
'increment_style' => ['style' => 'post'],
2331
'list_syntax' => ['syntax' => 'short'],
2432
'echo_tag_syntax' => ['format' => 'long'],
@@ -32,9 +40,22 @@
3240
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
3341
'ordered_imports' => [
3442
'sort_algorithm' => 'alpha',
35-
'imports_order' => ['class', 'const', 'function']
43+
'imports_order' => ['class', 'const', 'function'],
3644
],
3745
'single_line_throw' => false,
46+
'declare_strict_types' => false,
47+
'blank_line_between_import_groups' => true,
48+
'fully_qualified_strict_types' => true,
49+
'no_null_property_initialization' => false,
50+
'operator_linebreak' => [
51+
'only_booleans' => true,
52+
'position' => 'beginning',
53+
],
54+
'global_namespace_import' => [
55+
'import_classes' => true,
56+
'import_constants' => null,
57+
'import_functions' => null
58+
]
3859
]
3960
)
4061
->setFinder(

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
end_of_line = lf
7+
8+
[composer.json]
9+
indent_size = 4
10+
11+
[*.js]
12+
indent_size = 4
13+
14+
[*.neon]
15+
indent_size = 4
16+
indent_style = tab
17+
18+
[*.xml]
19+
indent_size = 4
20+
21+
[*.yml]
22+
indent_size = 4

.gitattributes

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@
1919
/phpunit.xml export-ignore
2020
/.gitattributes export-ignore
2121
/.gitignore export-ignore
22-
/.travis.* export-ignore
2322
/.scrutinizer.* export-ignore
2423
/.editorconfig export-ignore
25-
/.coveralls.* export-ignore
2624

2725
# Define binary file attributes.
2826
# - Do not treat them as text.

.github/workflows/build.yml

Lines changed: 36 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,39 @@ 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: ['7.3', '7.4', '8.0']
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
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 for PHP 7
38-
if: matrix.php-versions < '8.0'
39-
run: composer update --prefer-dist --no-progress
40-
41-
- name: Install dependencies for PHP 8
42-
if: matrix.php-versions >= '8.0'
43-
run: composer update --prefer-dist --no-progress --ignore-platform-req=php
44-
45-
- name: Run test suite
46-
run: composer check
47-
env:
48-
PHP_CS_FIXER_IGNORE_ENV: 1
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
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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ composer.lock
33
nbproject/
44
vendor/
55
build/
6+
.phpunit.cache/
67
.phpunit.result.cache

.scrutinizer.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
filter:
2-
paths: ["src/*"]
3-
excluded_paths: ["vendor/*", "tests/*"]
2+
paths: [ "src/*" ]
3+
excluded_paths: [ "vendor/*", "tests/*" ]
44

55
checks:
66
php:
@@ -13,9 +13,9 @@ tools:
1313
build:
1414
environment:
1515
php:
16-
version: 7.4
17-
pecl_extensions:
18-
- zip
16+
version: 8.1.2
17+
ini:
18+
xdebug.mode: coverage
1919
mysql: false
2020
node: false
2121
postgresql: false
@@ -33,11 +33,9 @@ build:
3333
dependencies:
3434
before:
3535
- composer self-update
36-
- composer update --no-interaction --prefer-dist --no-progress
3736
tests:
3837
before:
39-
-
40-
command: composer test:coverage
38+
- command: composer test:coverage
4139
coverage:
4240
file: 'build/logs/clover.xml'
4341
format: 'clover'

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) 2021 odan
3+
Copyright (c) 2023 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

composer.json

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"name": "selective/zip-responder",
3-
"type": "library",
43
"description": "A ZIP file and a stream responder (PSR-7)",
4+
"license": "MIT",
5+
"type": "library",
56
"keywords": [
67
"zip",
78
"psr7",
@@ -12,7 +13,6 @@
1213
"slim"
1314
],
1415
"homepage": "https://github.com/selective-php/zip-responder",
15-
"license": "MIT",
1616
"require": {
1717
"php": "^7.3 || ^8.0",
1818
"nyholm/psr7": "^1.4",
@@ -22,13 +22,9 @@
2222
"friendsofphp/php-cs-fixer": "^3",
2323
"maennchen/zipstream-php": "^2.1",
2424
"nelexa/zip": "^3.3 || ^4",
25-
"overtrue/phplint": "^2.3",
2625
"phpstan/phpstan": "^1",
27-
"phpunit/phpunit": "^9",
28-
"squizlabs/php_codesniffer": "^3.5"
29-
},
30-
"config": {
31-
"sort-packages": true
26+
"phpunit/phpunit": "^10",
27+
"squizlabs/php_codesniffer": "^3"
3228
},
3329
"autoload": {
3430
"psr-4": {
@@ -40,21 +36,28 @@
4036
"Selective\\Http\\Zip\\Test\\": "tests/"
4137
}
4238
},
39+
"config": {
40+
"sort-packages": true
41+
},
4342
"scripts": {
44-
"check": [
45-
"@lint",
46-
"@cs:check",
47-
"@sniffer:check",
48-
"@phpstan",
49-
"@test:coverage"
43+
"cs:check": [
44+
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
45+
"php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi"
46+
],
47+
"cs:fix": [
48+
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
49+
"php-cs-fixer fix --config=.cs.php --ansi --verbose"
5050
],
51-
"cs:check": "php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php",
52-
"cs:fix": "php-cs-fixer fix --config=.cs.php",
53-
"lint": "phplint ./ --exclude=vendor --no-interaction --no-cache",
54-
"phpstan": "phpstan analyse -c phpstan.neon --no-progress --ansi",
5551
"sniffer:check": "phpcs --standard=phpcs.xml",
5652
"sniffer:fix": "phpcbf --standard=phpcs.xml",
53+
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi",
5754
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always",
58-
"test:coverage": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always --coverage-clover build/logs/clover.xml --coverage-html build/coverage"
55+
"test:all": [
56+
"@cs:check",
57+
"@sniffer:check",
58+
"@stan",
59+
"@test"
60+
],
61+
"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"
5962
}
6063
}

phpcs.xml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,8 @@
99
<file>./src</file>
1010
<file>./tests</file>
1111

12-
<rule ref="PSR2"></rule>
13-
<rule ref="PSR12"></rule>
12+
<rule ref="PSR12"/>
1413

15-
<rule ref="Squiz.Commenting.ClassComment">
16-
<exclude name="Squiz.Commenting.ClassComment.TagNotAllowed"/>
17-
<type>warning</type>
18-
<exclude-pattern>*/tests/</exclude-pattern>
19-
</rule>
20-
<rule ref="Squiz.Commenting.ClassComment.Missing">
21-
<type>warning</type>
22-
</rule>
23-
<rule ref="Squiz.Commenting.FunctionComment.Missing">
24-
<type>warning</type>
25-
<exclude-pattern>*/config/</exclude-pattern>
26-
</rule>
27-
<rule ref="Squiz.Commenting.FunctionComment.MissingParamTag">
28-
<type>warning</type>
29-
</rule>
30-
<rule ref="Squiz.Commenting.FunctionComment.MissingParamComment">
31-
<type>warning</type>
32-
</rule>
3314
<rule ref="Squiz.Commenting.FunctionComment.ParamCommentNotCapital">
3415
<type>warning</type>
3516
</rule>

phpstan.neon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
parameters:
2-
level: max
2+
level: 8
33
paths:
4-
- src
4+
- src

0 commit comments

Comments
 (0)