Skip to content

Commit ea79810

Browse files
authored
Merge pull request #10 from php-etl/feature/qualityflow-improvments
update composer to php 8.2, update php 8.2 with rector, add rector ac…
2 parents eedde03 + 98b3cb9 commit ea79810

40 files changed

+5164
-1462
lines changed

.github/workflows/infection.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@ jobs:
44
infection:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
7+
- uses: actions/checkout@v3
88
- uses: shivammathur/setup-php@v2
99
with:
10-
php-version: '8.0'
10+
php-version: '8.2'
1111
tools: composer:v2
1212
coverage: pcov
13-
- uses: actions/cache@v2
13+
- uses: actions/cache@v3
1414
with:
1515
path: '**/vendor'
1616
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
1717
restore-keys: |
1818
${{ runner.os }}-composer-
19-
- uses: php-actions/composer@v5
19+
- uses: php-actions/composer@v6
2020
with:
2121
args: --prefer-dist
22-
php_version: 8.0
22+
php_version: '8.2'
2323

2424
- name: Infection
2525
run: |
26-
wget -q https://github.com/infection/infection/releases/download/0.20.0/infection.phar
27-
wget -q https://github.com/infection/infection/releases/download/0.20.0/infection.phar.asc
26+
wget -q https://github.com/infection/infection/releases/download/0.26.18/infection.phar
27+
wget -q https://github.com/infection/infection/releases/download/0.26.18/infection.phar.asc
2828
chmod +x infection.phar
2929
./infection.phar
3030
3131
- name: Store infection log
32-
uses: actions/upload-artifact@v2
32+
uses: actions/upload-artifact@v3
3333
with:
3434
path: infection.log

.github/workflows/phpstan-5.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,23 @@ jobs:
44
phpstan:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
8-
- uses: actions/cache@v2
7+
- uses: actions/checkout@v3
8+
- uses: actions/cache@v3
99
with:
1010
path: '**/vendor'
1111
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
1212
restore-keys: |
1313
${{ runner.os }}-composer-
14-
- uses: php-actions/composer@v5
14+
- uses: php-actions/composer@v6
1515
with:
1616
args: --prefer-dist
17-
php_version: 8.0
17+
php_version: '8.2'
18+
php_extensions: zip xdebug
19+
1820
- name: PHPStan
19-
uses: php-actions/phpstan@v2
21+
uses: php-actions/phpstan@v3
2022
with:
2123
path: src/
2224
level: 5
23-
php_version: 8.0
25+
php_version: '8.2'
26+
php_extensions: zip xdebug

.github/workflows/phpstan-6.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: PHPStan level 6
2+
on: push
3+
jobs:
4+
phpstan:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/cache@v3
9+
with:
10+
path: '**/vendor'
11+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
12+
restore-keys: |
13+
${{ runner.os }}-composer-
14+
- uses: php-actions/composer@v6
15+
with:
16+
args: --prefer-dist
17+
php_version: '8.2'
18+
php_extensions: zip xdebug
19+
- name: PHPStan
20+
uses: php-actions/phpstan@v3
21+
with:
22+
path: src/
23+
level: 6
24+
php_version: '8.2'
25+
php_extensions: zip xdebug

.github/workflows/phpstan-7.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@ jobs:
44
phpstan:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
8-
- uses: actions/cache@v2
7+
- uses: actions/checkout@v3
8+
- uses: actions/cache@v3
99
with:
1010
path: '**/vendor'
1111
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
1212
restore-keys: |
1313
${{ runner.os }}-composer-
14-
- uses: php-actions/composer@v5
14+
- uses: php-actions/composer@v6
1515
with:
1616
args: --prefer-dist
17-
php_version: 8.0
17+
php_version: '8.2'
18+
php_extensions: zip xdebug
1819
- name: PHPStan
19-
uses: php-actions/phpstan@v2
20+
uses: php-actions/phpstan@v3
2021
with:
2122
path: src/
2223
level: 7
23-
php_version: 8.0
24+
php_version: '8.2'
25+
php_extensions: zip xdebug

.github/workflows/phpstan-8.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@ jobs:
44
phpstan:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
8-
- uses: actions/cache@v2
7+
- uses: actions/checkout@v3
8+
- uses: actions/cache@v3
99
with:
1010
path: '**/vendor'
1111
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
1212
restore-keys: |
1313
${{ runner.os }}-composer-
14-
- uses: php-actions/composer@v5
14+
- uses: php-actions/composer@v6
1515
with:
1616
args: --prefer-dist
17-
php_version: 8.0
17+
php_version: '8.2'
18+
php_extensions: zip xdebug
1819
- name: PHPStan
19-
uses: php-actions/phpstan@v2
20+
uses: php-actions/phpstan@v3
2021
with:
2122
path: src/
2223
level: 8
23-
php_version: 8.0
24+
php_version: '8.2'
25+
php_extensions: zip xdebug

.github/workflows/quality.yaml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,60 +4,64 @@ jobs:
44
cs-fixer:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
7+
- uses: actions/checkout@v3
8+
- uses: shivammathur/setup-php@v2
9+
with:
10+
php-version: '8.2'
11+
coverage: none
812
- name: Cs-Fixer
913
run: |
10-
wget -q https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer
14+
wget -q https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer
1115
chmod a+x php-cs-fixer
1216
PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run
1317
1418
phpunit:
1519
runs-on: ubuntu-latest
1620
steps:
17-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v3
1822
- uses: shivammathur/setup-php@v2
1923
with:
20-
php-version: '8.0'
24+
php-version: '8.2'
2125
tools: composer:v2
2226
coverage: pcov
2327
extensions: zip, xdebug
24-
- uses: actions/cache@v2
28+
- uses: actions/cache@v3
2529
with:
2630
path: '**/vendor'
2731
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
2832
restore-keys: |
2933
${{ runner.os }}-composer-
30-
- uses: php-actions/composer@v5
34+
- uses: php-actions/composer@v6
3135
with:
3236
args: --prefer-dist
33-
php_version: 8.0
37+
php_version: '8.2'
3438
php_extensions: zip xdebug
3539
- name: Run tests & generate Coverage
36-
run: bin/phpunit --configuration=phpunit.xml tests --coverage-html var/coverage --whitelist=src
40+
run: bin/phpunit --coverage-html var/coverage
3741
- name: Store coverage files
38-
uses: actions/upload-artifact@v2
42+
uses: actions/upload-artifact@v3
3943
with:
4044
path: var/coverage
4145

4246
phpstan:
4347
runs-on: ubuntu-latest
4448
steps:
45-
- uses: actions/checkout@v2
46-
- uses: actions/cache@v2
49+
- uses: actions/checkout@v3
50+
- uses: actions/cache@v3
4751
with:
4852
path: '**/vendor'
4953
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
5054
restore-keys: |
5155
${{ runner.os }}-composer-
52-
- uses: php-actions/composer@v5
56+
- uses: php-actions/composer@v6
5357
with:
5458
args: --prefer-dist
55-
php_version: 8.0
59+
php_version: '8.2'
5660
php_extensions: zip xdebug
5761
- name: PHPStan
58-
uses: php-actions/phpstan@v2
62+
uses: php-actions/phpstan@v3
5963
with:
6064
path: src/
6165
level: 4
62-
php_version: 8.0
66+
php_version: '8.2'
6367
php_extensions: zip xdebug

.github/workflows/rector.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# github action that checks code with Rector
2+
name: Rector
3+
4+
on:
5+
pull_request: null
6+
7+
jobs:
8+
rector:
9+
runs-on: ubuntu-latest
10+
if: github.event.pull_request.head.repo.full_name == 'php-etl/spreadsheet-flow'
11+
steps:
12+
-
13+
if: github.event.pull_request.head.repo.full_name == github.repository
14+
uses: actions/checkout@v3
15+
16+
-
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: '8.2'
20+
coverage: none
21+
22+
- uses: "ramsey/composer-install@v2"
23+
24+
- run: bin/rector --ansi
25+
26+
-
27+
# commit only to core contributors who have repository access
28+
uses: stefanzweifel/git-auto-commit-action@v4
29+
with:
30+
commit_message: '[rector] Rector fixes'
31+
commit_author: 'GitHub Action <actions@github.com>'
32+
commit_user_email: 'action@github.com'

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.idea/
22
vendor/
3+
/.php-cs-fixer.cache
4+
/bin/

.php-cs-fixer.dist.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
$finder = (new PhpCsFixer\Finder())
4+
->in('src')
5+
;
6+
7+
return (new PhpCsFixer\Config())
8+
->setRiskyAllowed(true)
9+
->setRules([
10+
'@PHP82Migration' => true,
11+
'@PHP81Migration' => true,
12+
'@PHP80Migration:risky' => true,
13+
'@PHPUnit84Migration:risky' => true,
14+
'@PSR1' => true,
15+
'@PSR12' => true,
16+
'@PhpCsFixer' => true,
17+
'@Symfony' => true,
18+
'ternary_to_elvis_operator' => true,
19+
'set_type_to_cast' => true,
20+
'self_accessor' => true,
21+
'psr_autoloading' => true,
22+
'php_unit_test_annotation' => ['style' => 'annotation'],
23+
'php_unit_set_up_tear_down_visibility' => true,
24+
'php_unit_construct' => true,
25+
'no_useless_sprintf' => true,
26+
'no_homoglyph_names' => true,
27+
'native_function_invocation' => true,
28+
'native_constant_invocation' => true,
29+
'modernize_types_casting' => true,
30+
'logical_operators' => true,
31+
'is_null' => true,
32+
'function_to_constant' => true,
33+
'fopen_flag_order' => true,
34+
'error_suppression' => true,
35+
'ereg_to_preg' => true,
36+
'dir_constant' => true,
37+
])
38+
->setFinder($finder)
39+
->setCacheFile('.php-cs-fixer.cache') // forward compatibility with 3.x line
40+
;

composer.json

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,30 @@
1616
"minimum-stability": "dev",
1717
"prefer-stable": true,
1818
"config": {
19-
"bin-dir": "bin"
19+
"bin-dir": "bin",
20+
"allow-plugins": {
21+
"infection/extension-installer": true,
22+
"php-http/discovery": true
23+
}
2024
},
2125
"require": {
22-
"php": "^8.0",
26+
"php": "^8.2",
2327
"ext-zip": "*",
2428
"ext-dom": "*",
2529
"ext-xmlreader": "*",
2630
"ext-simplexml": "*",
27-
"php-etl/bucket": "^0.2.0",
28-
"psr/log": "^1.1",
31+
"php-etl/bucket": "^0.3.0",
2932
"box/spout": "^3.1",
30-
"php-etl/pipeline-contracts": "^0.3.0"
33+
"php-etl/pipeline-contracts": "^0.4.0",
34+
"psr/log": "^3.0"
35+
},
36+
"require-dev": {
37+
"phpunit/phpunit": "^10.0",
38+
"phpstan/phpstan": "^1.10",
39+
"friendsofphp/php-cs-fixer": "^3.0",
40+
"infection/infection": "^0.26.18",
41+
"rector/rector": "^0.15.23",
42+
"php-etl/phpunit-extension": "^0.5.0"
3143
},
3244
"autoload": {
3345
"psr-4": {
@@ -41,13 +53,7 @@
4153
},
4254
"extra": {
4355
"branch-alias": {
44-
"dev-main": "0.1.x-dev"
56+
"dev-main": "0.2.x-dev"
4557
}
46-
},
47-
"require-dev": {
48-
"ext-xdebug": "*",
49-
"adlawson/vfs": "dev-develop",
50-
"phpunit/phpunit": "^9.0",
51-
"php-etl/phpunit-extension": "*"
5258
}
5359
}

0 commit comments

Comments
 (0)