Skip to content

Commit 9c5de04

Browse files
committed
Require PHP 8
1 parent ecba216 commit 9c5de04

File tree

8 files changed

+45
-66
lines changed

8 files changed

+45
-66
lines changed

.cs.php

Lines changed: 5 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(
@@ -18,7 +20,6 @@
1820
'cast_spaces' => ['space' => 'none'],
1921
'concat_space' => ['spacing' => 'one'],
2022
'compact_nullable_typehint' => true,
21-
'declare_equal_normalize' => ['space' => 'single'],
2223
'increment_style' => ['style' => 'post'],
2324
'list_syntax' => ['syntax' => 'short'],
2425
'echo_tag_syntax' => ['format' => 'long'],
@@ -35,6 +36,8 @@
3536
'imports_order' => ['class', 'const', 'function']
3637
],
3738
'single_line_throw' => false,
39+
'fully_qualified_strict_types' => true,
40+
'global_namespace_import' => false,
3841
]
3942
)
4043
->setFinder(

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[composer.json]
2+
indent_style = space
3+
indent_size = 4

.github/workflows/build.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
runs-on: ${{ matrix.operating-system }}
88
strategy:
99
matrix:
10-
operating-system: [ubuntu-latest]
11-
php-versions: ['7.3', '7.4', '8.0']
10+
operating-system: [ ubuntu-latest ]
11+
php-versions: [ '8.0', '8.1' ]
1212
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
1313

1414
steps:
@@ -19,7 +19,6 @@ jobs:
1919
uses: shivammathur/setup-php@v2
2020
with:
2121
php-version: ${{ matrix.php-versions }}
22-
extensions: mbstring, intl, zip
2322
coverage: none
2423

2524
- name: Check PHP Version
@@ -34,15 +33,8 @@ jobs:
3433
- name: Validate composer.json and composer.lock
3534
run: composer validate
3635

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
36+
- name: Install dependencies
37+
run: composer install --prefer-dist --no-progress --no-suggest
4438

4539
- name: Run test suite
46-
run: composer check
47-
env:
48-
PHP_CS_FIXER_IGNORE_ENV: 1
40+
run: composer test:all

.scrutinizer.yml

Lines changed: 11 additions & 9 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:
@@ -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,10 @@ build:
3033
dependencies:
3134
before:
3235
- composer self-update
33-
- composer update --no-interaction --prefer-dist --no-progress
36+
- composer install --no-interaction --prefer-dist --no-progress
3437
tests:
3538
before:
36-
-
37-
command: composer test:coverage
38-
coverage:
39-
file: 'build/logs/clover.xml'
40-
format: 'clover'
39+
- command: composer test:coverage
40+
coverage:
41+
file: 'build/logs/clover.xml'
42+
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

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 7.3+ or 8.0+
15+
* PHP 8.0+
1616

1717
## Installation
1818

composer.json

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"name": "selective/array-reader",
3-
"type": "library",
43
"description": "A strictly typed array reader",
4+
"license": "MIT",
5+
"type": "library",
56
"keywords": [
67
"array",
78
"reader",
@@ -11,20 +12,15 @@
1112
"strong"
1213
],
1314
"homepage": "https://github.com/selective-php/array-reader",
14-
"license": "MIT",
1515
"require": {
16-
"php": "^7.3 || ^8.0",
17-
"cakephp/chronos": "^2"
16+
"php": "^8.0",
17+
"cakephp/chronos": "^2 || ^3"
1818
},
1919
"require-dev": {
2020
"friendsofphp/php-cs-fixer": "^3",
21-
"overtrue/phplint": "^2.3",
2221
"phpstan/phpstan": "^1",
23-
"phpunit/phpunit": "^9",
24-
"squizlabs/php_codesniffer": "^3.5"
25-
},
26-
"config": {
27-
"sort-packages": true
22+
"phpunit/phpunit": "^9 || ^10",
23+
"squizlabs/php_codesniffer": "^3"
2824
},
2925
"autoload": {
3026
"psr-4": {
@@ -36,21 +32,22 @@
3632
"Selective\\ArrayReader\\Test\\": "tests/"
3733
}
3834
},
35+
"config": {
36+
"sort-packages": true
37+
},
3938
"scripts": {
40-
"check": [
41-
"@lint",
42-
"@cs:check",
43-
"@sniffer:check",
44-
"@phpstan",
45-
"@test:coverage"
46-
],
47-
"cs:check": "php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php",
48-
"cs:fix": "php-cs-fixer fix --config=.cs.php",
49-
"lint": "phplint ./ --exclude=vendor --no-interaction --no-cache",
50-
"phpstan": "phpstan analyse src --level=max -c phpstan.neon --no-progress --ansi",
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",
5141
"sniffer:check": "phpcs --standard=phpcs.xml",
5242
"sniffer:fix": "phpcbf --standard=phpcs.xml",
43+
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi --xdebug",
5344
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always",
54-
"test:coverage": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always --coverage-clover build/logs/clover.xml --coverage-html build/coverage"
45+
"test:all": [
46+
"@cs:check",
47+
"@sniffer:check",
48+
"@stan",
49+
"@test"
50+
],
51+
"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"
5552
}
5653
}

phpcs.xml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,6 @@
1212
<rule ref="PSR2"></rule>
1313
<rule ref="PSR12"></rule>
1414

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>
3315
<rule ref="Squiz.Commenting.FunctionComment.ParamCommentNotCapital">
3416
<type>warning</type>
3517
</rule>

0 commit comments

Comments
 (0)