Skip to content

Commit 74c95f4

Browse files
committed
Update requirements
1 parent aaf1037 commit 74c95f4

11 files changed

Lines changed: 143 additions & 119 deletions

File tree

.cs.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
'concat_space' => ['spacing' => 'one'],
2222
'compact_nullable_typehint' => true,
2323
'declare_equal_normalize' => ['space' => 'single'],
24+
'general_phpdoc_annotation_remove' => [
25+
'annotations' => [
26+
'author',
27+
'package',
28+
],
29+
],
2430
'increment_style' => ['style' => 'post'],
2531
'list_syntax' => ['syntax' => 'short'],
2632
'echo_tag_syntax' => ['format' => 'long'],
@@ -34,11 +40,22 @@
3440
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
3541
'ordered_imports' => [
3642
'sort_algorithm' => 'alpha',
37-
'imports_order' => ['class', 'const', 'function']
43+
'imports_order' => ['class', 'const', 'function'],
3844
],
3945
'single_line_throw' => false,
46+
'declare_strict_types' => false,
47+
'blank_line_between_import_groups' => true,
4048
'fully_qualified_strict_types' => true,
41-
'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+
]
4259
]
4360
)
4461
->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 & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +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.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 check
42-
env:
43-
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: 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'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ responses and many other things.
3131

3232
## Requirements
3333

34-
* PHP 8.0+
34+
* PHP 8.1+
3535

3636
## Installation
3737

composer.json

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"name": "selective/transformer",
3-
"type": "library",
43
"description": "A strictly typed array transformer with dot-access, fluent interface and filters.",
4+
"license": "MIT",
5+
"type": "library",
56
"keywords": [
67
"transformer",
78
"mapper",
@@ -14,19 +15,15 @@
1415
"json"
1516
],
1617
"homepage": "https://github.com/selective-php/transformer",
17-
"license": "MIT",
1818
"require": {
1919
"php": "^8.1"
2020
},
2121
"require-dev": {
2222
"friendsofphp/php-cs-fixer": "^3",
2323
"phpstan/phpstan": "^1",
24-
"phpunit/phpunit": "^9 || ^10",
24+
"phpunit/phpunit": "^10",
2525
"squizlabs/php_codesniffer": "^3"
2626
},
27-
"config": {
28-
"sort-packages": true
29-
},
3027
"autoload": {
3128
"psr-4": {
3229
"Selective\\Transformer\\": "src/"
@@ -37,12 +34,21 @@
3734
"Selective\\Transformer\\Test\\": "tests/"
3835
}
3936
},
37+
"config": {
38+
"sort-packages": true
39+
},
4040
"scripts": {
41-
"cs:check": "php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi",
42-
"cs:fix": "php-cs-fixer fix --config=.cs.php --ansi",
41+
"cs:check": [
42+
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
43+
"php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi"
44+
],
45+
"cs:fix": [
46+
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
47+
"php-cs-fixer fix --config=.cs.php --ansi --verbose"
48+
],
4349
"sniffer:check": "phpcs --standard=phpcs.xml",
4450
"sniffer:fix": "phpcbf --standard=phpcs.xml",
45-
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi --xdebug",
51+
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi",
4652
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always",
4753
"test:all": [
4854
"@cs:check",

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>

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)