Skip to content

Commit 14b6249

Browse files
committed
Updated github actions + added rector
1 parent 9233b01 commit 14b6249

File tree

10 files changed

+200
-73
lines changed

10 files changed

+200
-73
lines changed

.github/workflows/phpstan-5.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@ 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
18-
17+
php_version: 8.2
1918
- name: PHPStan
20-
uses: php-actions/phpstan@v2
19+
uses: php-actions/phpstan@v3
2120
with:
2221
path: src/
2322
args: --level=5

.github/workflows/phpstan-7.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ 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
1818

1919
- name: PHPStan
20-
uses: php-actions/phpstan@v2
20+
uses: php-actions/phpstan@v3
2121
with:
2222
path: src/
2323
args: --level=5

.github/workflows/phpstan-8.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ 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
1818

1919
- name: PHPStan
20-
uses: php-actions/phpstan@v2
20+
uses: php-actions/phpstan@v3
2121
with:
2222
path: src/
2323
args: --level=5

.github/workflows/phpunit.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Mutations
2+
on: push
3+
jobs:
4+
phpunit:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: shivammathur/setup-php@v2
9+
with:
10+
php-version: '8.2'
11+
tools: composer:v2
12+
coverage: pcov
13+
- uses: actions/cache@v2
14+
with:
15+
path: '**/vendor'
16+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
17+
restore-keys: |
18+
${{ runner.os }}-composer-
19+
- uses: php-actions/composer@v6
20+
with:
21+
args: --prefer-dist
22+
php_version: 8.2
23+
- name: Run tests & generate Coverage
24+
run: bin/phpunit --configuration=phpunit.xml tests --coverage-html var/coverage --whitelist=src
25+
- name: Store coverage files
26+
uses: actions/upload-artifact@v2
27+
with:
28+
path: var/coverage

.github/workflows/quality.yaml

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,9 @@ jobs:
44
cs-fixer:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
7+
- uses: actions/checkout@v3
88
- name: Cs-Fixer
99
run: |
10-
wget -q https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer
10+
wget -q https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer
1111
chmod a+x php-cs-fixer
1212
PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run
13-
14-
phpunit:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- uses: actions/checkout@v2
18-
- uses: shivammathur/setup-php@v2
19-
with:
20-
php-version: '8.0'
21-
tools: composer:v2
22-
coverage: pcov
23-
- uses: actions/cache@v2
24-
with:
25-
path: '**/vendor'
26-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
27-
restore-keys: |
28-
${{ runner.os }}-composer-
29-
- uses: php-actions/composer@v5
30-
with:
31-
args: --prefer-dist
32-
php_version: 8.0
33-
34-
- name: Run tests & generate Coverage
35-
run: bin/phpunit --configuration=phpunit.xml tests --coverage-html var/coverage --whitelist=src
36-
37-
- name: Store coverage files
38-
uses: actions/upload-artifact@v2
39-
with:
40-
path: var/coverage
41-
42-
phpstan:
43-
runs-on: ubuntu-latest
44-
steps:
45-
- uses: actions/checkout@v2
46-
- uses: actions/cache@v2
47-
with:
48-
path: '**/vendor'
49-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
50-
restore-keys: |
51-
${{ runner.os }}-composer-
52-
- uses: php-actions/composer@v5
53-
with:
54-
args: --prefer-dist
55-
php_version: 8.0
56-
57-
- name: PHPStan
58-
uses: php-actions/phpstan@v2
59-
with:
60-
path: src/
61-
args: --level=4

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
return (new PhpCsFixer\Config())
88
->setRiskyAllowed(true)
99
->setRules([
10+
'@PHP82Migration' => true,
1011
'@PHP81Migration' => true,
1112
'@PHP80Migration:risky' => true,
1213
'@PHPUnit84Migration:risky' => true,

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"minimum-stability": "dev",
1717
"prefer-stable": true,
1818
"require": {
19-
"php": "^8.0",
19+
"php": "^8.2",
2020
"symfony/console": "^5.2",
2121
"php-etl/pipeline-contracts": "^0.3.0",
2222
"php-etl/console-state": "^0.1.0"
@@ -33,5 +33,8 @@
3333
"branch-alias": {
3434
"dev-main": "0.1.x-dev"
3535
}
36+
},
37+
"require-dev": {
38+
"rector/rector": "^0.15.21"
3639
}
3740
}

composer.lock

Lines changed: 124 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rector.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
6+
use Rector\Config\RectorConfig;
7+
use Rector\PHPUnit\Set\PHPUnitLevelSetList;
8+
use Rector\Set\ValueObject\LevelSetList;
9+
use Rector\Symfony\Set\SymfonyLevelSetList;
10+
11+
return static function (RectorConfig $rectorConfig): void {
12+
$rectorConfig->paths([
13+
__DIR__ . '/src',
14+
__DIR__ . '/tests',
15+
]);
16+
17+
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
18+
19+
$rectorConfig->sets([
20+
LevelSetList::UP_TO_PHP_82,
21+
PHPUnitLevelSetList::UP_TO_PHPUNIT_100,
22+
SymfonyLevelSetList::UP_TO_SYMFONY_60,
23+
]);
24+
};

src/Console.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111

1212
final class Console implements ActionRuntimeInterface
1313
{
14-
private State\StateOutput\Action $state;
14+
private readonly State\StateOutput\Action $state;
1515

1616
public function __construct(
1717
ConsoleOutput $output,
18-
private ExecutingActionInterface $action,
18+
private readonly ExecutingActionInterface $action,
1919
?State\StateOutput\Action $state = null
2020
) {
2121
$this->state = $state ?? new State\StateOutput\Action($output, 'A', 'Action');

0 commit comments

Comments
 (0)