Skip to content

Commit d96018c

Browse files
committed
Require PHP 8.1
1 parent e419e50 commit d96018c

File tree

12 files changed

+127
-85
lines changed

12 files changed

+127
-85
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: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1-
[composer.json]
1+
root = true
2+
3+
[*]
4+
charset = utf-8
25
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]
322
indent_size = 4

.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', '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-
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: 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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ build:
3636
- composer install --no-interaction --prefer-dist --no-progress
3737
tests:
3838
before:
39-
- command: composer test:coverage
40-
coverage:
41-
file: 'build/logs/clover.xml'
42-
format: 'clover'
39+
- command: composer test:coverage
40+
coverage:
41+
file: 'build/logs/clover.xml'
42+
format: 'clover'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A strictly typed array reader for PHP.
1212

1313
## Requirements
1414

15-
* PHP 8.0+
15+
* PHP 8.1+
1616

1717
## Installation
1818

composer.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
],
1414
"homepage": "https://github.com/selective-php/array-reader",
1515
"require": {
16-
"php": "^8.0",
16+
"php": "^8.1",
1717
"cakephp/chronos": "^2 || ^3"
1818
},
1919
"require-dev": {
2020
"friendsofphp/php-cs-fixer": "^3",
2121
"phpstan/phpstan": "^1",
22-
"phpunit/phpunit": "^9 || ^10",
22+
"phpunit/phpunit": "^10",
2323
"squizlabs/php_codesniffer": "^3"
2424
},
2525
"autoload": {
@@ -36,11 +36,17 @@
3636
"sort-packages": true
3737
},
3838
"scripts": {
39-
"cs:check": "php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi",
40-
"cs:fix": "php-cs-fixer fix --config=.cs.php --ansi",
39+
"cs:check": [
40+
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
41+
"php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi"
42+
],
43+
"cs:fix": [
44+
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
45+
"php-cs-fixer fix --config=.cs.php --ansi --verbose"
46+
],
4147
"sniffer:check": "phpcs --standard=phpcs.xml",
4248
"sniffer:fix": "phpcbf --standard=phpcs.xml",
43-
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi --xdebug",
49+
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi",
4450
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always",
4551
"test:all": [
4652
"@cs:check",

phpcs.xml

Lines changed: 1 addition & 2 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>

phpstan.neon

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
parameters:
22
level: 8
3-
paths:
4-
- src
53
reportUnmatchedIgnoredErrors: false
6-
ignoreErrors:
7-
- '#Property (.*?) type has no value type specified in iterable type array#'
8-
- '#Method (.*?) has parameter (.*?) with no value type specified in iterable type array#'
9-
- '#Method (.*?) return type has no value type specified in iterable type array#'
4+
paths:
5+
- src

phpunit.xml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@
33
bootstrap="vendor/autoload.php"
44
colors="true"
55
backupGlobals="false"
6-
backupStaticAttributes="false"
7-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
8-
<coverage processUncoveredFiles="false">
6+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
7+
cacheDirectory=".phpunit.cache"
8+
backupStaticProperties="false">
9+
<coverage/>
10+
<testsuites>
11+
<testsuite name="Tests">
12+
<directory suffix="Test.php">tests</directory>
13+
</testsuite>
14+
</testsuites>
15+
<source>
916
<include>
1017
<directory suffix=".php">src</directory>
1118
</include>
1219
<exclude>
1320
<directory>vendor</directory>
1421
<directory>build</directory>
1522
</exclude>
16-
</coverage>
17-
<testsuites>
18-
<testsuite name="Tests">
19-
<directory suffix="Test.php">tests</directory>
20-
</testsuite>
21-
</testsuites>
23+
</source>
2224
</phpunit>

0 commit comments

Comments
 (0)