Skip to content

Commit 6bcc078

Browse files
committed
Update requirements
1 parent 034d420 commit 6bcc078

File tree

13 files changed

+153
-125
lines changed

13 files changed

+153
-125
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: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
1-
# Path-based git attributes
2-
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3-
4-
public/* linguist-vendored
5-
docs/* linguist-documentation
6-
71
# Set the default behavior, in case people don't have core.autocrlf set.
82
# Git will always convert line endings to LF on checkout. You should use
93
# this for files that must keep LF endings, even on Windows.
104
* text eol=lf
115

6+
# ------------------------------------------------------------------------------
7+
# All the files and directories that can be excluded from dist,
8+
# we could have a more clean vendor/
9+
#
10+
# So when someone will install that package through with --prefer-dist option,
11+
# all the files and directories listed in .gitattributes file will be excluded.
12+
# This could have a big impact on big deployments and/or testing.
13+
# ------------------------------------------------------------------------------
14+
15+
/tests export-ignore
16+
/build export-ignore
17+
/docs export-ignore
18+
/build.xml export-ignore
19+
/phpunit.xml export-ignore
20+
/.gitattributes export-ignore
21+
/.gitignore export-ignore
22+
/.scrutinizer.* export-ignore
23+
/.editorconfig export-ignore
24+
1225
# Define binary file attributes.
1326
# - Do not treat them as text.
1427
# - Include binary diff in patches instead of "binary files differ."
28+
*.pdf binary
29+
*.mo binary
1530
*.gif binary
1631
*.ico binary
1732
*.jpg binary
33+
*.jpeg binary
1834
*.png binary
19-
*.phar binary
2035
*.zip binary
21-
*.gz binary
22-
*.otf binary
23-
*.eot binary
24-
*.svg binary
25-
*.ttf binary
26-
*.woff binary
27-
*.woff2 binary

.github/workflows/build.yml

Lines changed: 37 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,41 @@
11
name: build
22

3-
on: [push, pull_request]
3+
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.2', '7.3', '7.4', '8.0', '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, pdo, pdo_mysql, 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-reqs
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: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
.idea/
2-
nbproject/
3-
composer.phar
42
composer.lock
5-
.DS_STORE
6-
cache.properties
7-
.php_cs.cache
8-
.vscode
3+
nbproject/
94
vendor/
105
build/
6+
.phpunit.cache/
117
.phpunit.result.cache

.scrutinizer.yml

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

55
checks:
66
php:
@@ -12,7 +12,10 @@ tools:
1212

1313
build:
1414
environment:
15-
php: 7.4
15+
php:
16+
version: 8.1.2
17+
ini:
18+
xdebug.mode: coverage
1619
mysql: false
1720
node: false
1821
postgresql: false
@@ -30,11 +33,9 @@ build:
3033
dependencies:
3134
before:
3235
- composer self-update
33-
- composer update --no-interaction --prefer-dist --no-progress
3436
tests:
3537
before:
36-
-
37-
command: composer test:coverage
38+
- command: composer test:coverage
3839
coverage:
3940
file: 'build/logs/clover.xml'
4041
format: 'clover'

LICENSE

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

3-
Copyright (c) 2020 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
@@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ the [notification pattern](https://martinfowler.com/articles/replaceThrowWithNot
2525

2626
## Requirements
2727

28-
* PHP 7.2+ or 8.0+
28+
* PHP 8.1+
2929

3030
## Installation
3131

composer.json

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"name": "selective/validation",
3-
"type": "library",
43
"description": "Validation error collector and transformer",
4+
"license": "MIT",
5+
"type": "library",
56
"keywords": [
67
"validation",
78
"middleware",
89
"slim",
910
"slim4",
1011
"psr15"
1112
],
12-
"license": "MIT",
1313
"require": {
14-
"php": "^7.2 || ^8.0",
14+
"php": "^8.1",
1515
"ext-json": "*",
1616
"psr/http-factory": "^1.0.1",
1717
"psr/http-server-middleware": "^1.0.1"
@@ -21,16 +21,13 @@
2121
"fig/http-message-util": "^1.1",
2222
"friendsofphp/php-cs-fixer": "^3",
2323
"nyholm/psr7": "^1.4",
24-
"overtrue/phplint": "^1.1",
2524
"phpstan/phpstan": "^1",
26-
"phpunit/phpunit": "^8 || ^9",
25+
"phpunit/phpunit": "^10",
2726
"relay/relay": "^2.0",
2827
"slim/psr7": "^1",
29-
"squizlabs/php_codesniffer": "^3.5"
30-
},
31-
"config": {
32-
"sort-packages": true
28+
"squizlabs/php_codesniffer": "^3"
3329
},
30+
"minimum-stability": "stable",
3431
"autoload": {
3532
"psr-4": {
3633
"Selective\\Validation\\": "src/"
@@ -41,21 +38,27 @@
4138
"Selective\\Validation\\Test\\": "tests/"
4239
}
4340
},
44-
"minimum-stability": "stable",
41+
"config": {
42+
"sort-packages": true
43+
},
4544
"scripts": {
46-
"cs:check": "php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php",
47-
"cs:fix": "php-cs-fixer fix --config=.cs.php",
48-
"lint": "phplint ./ --exclude=vendor --no-interaction --no-cache",
49-
"phpstan": "phpstan analyse src --level=max -c phpstan.neon --no-progress --ansi",
45+
"cs:check": [
46+
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
47+
"php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi"
48+
],
49+
"cs:fix": [
50+
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
51+
"php-cs-fixer fix --config=.cs.php --ansi --verbose"
52+
],
5053
"sniffer:check": "phpcs --standard=phpcs.xml",
5154
"sniffer:fix": "phpcbf --standard=phpcs.xml",
52-
"test": "phpunit --configuration phpunit.xml --do-not-cache-result",
55+
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi",
56+
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always",
5357
"test:all": [
54-
"@lint",
5558
"@cs:check",
5659
"@sniffer:check",
57-
"@phpstan",
58-
"@test:coverage"
60+
"@stan",
61+
"@test"
5962
],
6063
"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"
6164
}

phpcs.xml

Lines changed: 2 additions & 21 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>
@@ -45,4 +26,4 @@
4526
<property name="absoluteNestingLevel" value="4"/>
4627
</properties>
4728
</rule>
48-
</ruleset>
29+
</ruleset>

0 commit comments

Comments
 (0)