Skip to content

Commit d14df58

Browse files
committed
Require PHP 8.1+
1 parent c6f07db commit d14df58

File tree

15 files changed

+166
-132
lines changed

15 files changed

+166
-132
lines changed

.cs.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020
'cast_spaces' => ['space' => 'none'],
2121
'concat_space' => ['spacing' => 'one'],
2222
'compact_nullable_typehint' => true,
23+
'declare_equal_normalize' => ['space' => 'single'],
24+
'general_phpdoc_annotation_remove' => [
25+
'annotations' => [
26+
'author',
27+
'package',
28+
],
29+
],
2330
'increment_style' => ['style' => 'post'],
2431
'list_syntax' => ['syntax' => 'short'],
2532
'echo_tag_syntax' => ['format' => 'long'],
@@ -33,11 +40,22 @@
3340
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
3441
'ordered_imports' => [
3542
'sort_algorithm' => 'alpha',
36-
'imports_order' => ['class', 'const', 'function']
43+
'imports_order' => ['class', 'const', 'function'],
3744
],
3845
'single_line_throw' => false,
46+
'declare_strict_types' => false,
47+
'blank_line_between_import_groups' => true,
3948
'fully_qualified_strict_types' => true,
40-
'global_namespace_import' => false,
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+
]
4159
]
4260
)
4361
->setFinder(

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,16 @@ end_of_line = lf
77

88
[composer.json]
99
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,14 +1,29 @@
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+
/.travis.* export-ignore
23+
/.scrutinizer.* export-ignore
24+
/.editorconfig export-ignore
25+
/.coveralls.* export-ignore
26+
1227
# Define binary file attributes.
1328
# - Do not treat them as text.
1429
# - Include binary diff in patches instead of "binary files differ."
@@ -17,13 +32,6 @@ docs/* linguist-documentation
1732
*.gif binary
1833
*.ico binary
1934
*.jpg binary
35+
*.jpeg binary
2036
*.png binary
21-
*.phar binary
2237
*.zip binary
23-
*.gz binary
24-
*.otf binary
25-
*.eot binary
26-
*.svg binary
27-
*.ttf binary
28-
*.woff binary
29-
*.woff2 binary

.github/workflows/build.yml

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +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: [ '8.0', '8.1' ]
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-
coverage: none
23-
24-
- name: Check PHP Version
25-
run: php -v
26-
27-
- name: Check Composer Version
28-
run: composer -V
29-
30-
- name: Check PHP Extensions
31-
run: php -m
32-
33-
- name: Validate composer.json and composer.lock
34-
run: composer validate
35-
36-
- name: Install dependencies
37-
run: composer install --prefer-dist --no-progress --no-suggest
38-
39-
- name: Run test suite
40-
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' ]
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: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
.idea/
2-
nbproject/
32
composer.lock
4-
.DS_STORE
5-
cache.properties
6-
.php_cs.cache
7-
.vscode/
8-
.phpunit.result.cache
3+
nbproject/
94
vendor/
105
build/
6+
.phpunit.cache/
7+
.phpunit.result.cache

.scrutinizer.yml

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

55
checks:
6-
php:
7-
code_rating: true
8-
duplication: true
6+
php:
7+
code_rating: true
8+
duplication: true
99

1010
tools:
11-
external_code_coverage: false
11+
external_code_coverage: false
1212

1313
build:
14-
environment:
15-
php:
16-
version: 8.1.2
17-
ini:
18-
xdebug.mode: coverage
19-
mysql: false
20-
node: false
21-
postgresql: false
22-
mongodb: false
23-
elasticsearch: false
24-
redis: false
25-
memcached: false
26-
neo4j: false
27-
rabbitmq: false
28-
nodes:
29-
analysis:
30-
tests:
31-
override:
32-
- php-scrutinizer-run
33-
dependencies:
34-
before:
35-
- composer self-update
36-
- composer install --no-interaction --prefer-dist --no-progress
37-
tests:
38-
before:
39-
- command: composer test:coverage
40-
coverage:
41-
file: 'build/logs/clover.xml'
42-
format: 'clover'
14+
environment:
15+
php:
16+
version: 8.1.2
17+
ini:
18+
xdebug.mode: coverage
19+
mysql: false
20+
node: false
21+
postgresql: false
22+
mongodb: false
23+
elasticsearch: false
24+
redis: false
25+
memcached: false
26+
neo4j: false
27+
rabbitmq: false
28+
nodes:
29+
analysis:
30+
tests:
31+
override:
32+
- php-scrutinizer-run
33+
dependencies:
34+
before:
35+
- composer self-update
36+
tests:
37+
before:
38+
- command: composer test:coverage
39+
coverage:
40+
file: 'build/logs/clover.xml'
41+
format: 'clover'

LICENSE

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
The MIT License (MIT)
2+
13
Copyright (c) 2023 odan
24

35
Permission is hereby granted, free of charge, to any person obtaining a copy
46
of this software and associated documentation files (the "Software"), to deal
57
in the Software without restriction, including without limitation the rights
68
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7-
copies of the Software, and to permit persons to whom the Software is furnished
8-
to do so, subject to the following conditions:
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
911

1012
The above copyright notice and this permission notice shall be included in all
1113
copies or substantial portions of the Software.
@@ -15,5 +17,6 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1517
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1618
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1719
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19-
THE SOFTWARE.
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A PSR-11 container implementation with optional **autowiring**.
1313

1414
## Requirements
1515

16-
* PHP 8.0+
16+
* PHP 8.1+
1717

1818
## Installation
1919

composer.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
"psr-11"
88
],
99
"require": {
10-
"php": "^7.4 || ^8.0",
10+
"php": "^8.1",
1111
"psr/container": "^2.0"
1212
},
1313
"require-dev": {
1414
"friendsofphp/php-cs-fixer": "^3",
1515
"phpstan/phpstan": "^1",
16-
"phpunit/phpunit": "^9 || ^10",
16+
"phpunit/phpunit": "^10",
1717
"squizlabs/php_codesniffer": "^3",
1818
"symfony/event-dispatcher": "^5 || 6.0.*"
1919
},
@@ -31,11 +31,17 @@
3131
"sort-packages": true
3232
},
3333
"scripts": {
34-
"cs:check": "php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi",
35-
"cs:fix": "php-cs-fixer fix --config=.cs.php --ansi",
34+
"cs:check": [
35+
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
36+
"php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi"
37+
],
38+
"cs:fix": [
39+
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
40+
"php-cs-fixer fix --config=.cs.php --ansi --verbose"
41+
],
3642
"sniffer:check": "phpcs --standard=phpcs.xml",
3743
"sniffer:fix": "phpcbf --standard=phpcs.xml",
38-
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi --xdebug",
44+
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi",
3945
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always",
4046
"test:all": [
4147
"@cs:check",

phpcs.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
<file>./src</file>
1010
<file>./tests</file>
1111

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

1514
<rule ref="Squiz.Commenting.FunctionComment.ParamCommentNotCapital">
1615
<type>warning</type>
@@ -27,4 +26,4 @@
2726
<property name="absoluteNestingLevel" value="4"/>
2827
</properties>
2928
</rule>
30-
</ruleset>
29+
</ruleset>

0 commit comments

Comments
 (0)