Skip to content

Commit 693c7de

Browse files
committed
Fixed the PHPStan Github Actions
added README
1 parent 55c2a4b commit 693c7de

File tree

8 files changed

+132
-41
lines changed

8 files changed

+132
-41
lines changed

.github/workflows/actions.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/phpstan-5.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PHPStan level 5
2+
on: push
3+
jobs:
4+
phpstan:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: actions/cache@v2
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@v5
15+
with:
16+
args: --prefer-dist
17+
php_version: 8.0
18+
- name: PHPStan
19+
uses: php-actions/phpstan@v2
20+
with:
21+
path: src/
22+
level: 4
23+
php_version: 8.0

.github/workflows/phpstan-7.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PHPStan level 7
2+
on: push
3+
jobs:
4+
phpstan:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: actions/cache@v2
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@v5
15+
with:
16+
args: --prefer-dist
17+
php_version: 8.0
18+
- name: PHPStan
19+
uses: php-actions/phpstan@v2
20+
with:
21+
path: src/
22+
level: 7
23+
php_version: 8.0

.github/workflows/phpstan-8.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PHPStan level 8
2+
on: push
3+
jobs:
4+
phpstan:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: actions/cache@v2
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@v5
15+
with:
16+
args: --prefer-dist
17+
php_version: 8.0
18+
- name: PHPStan
19+
uses: php-actions/phpstan@v2
20+
with:
21+
path: src/
22+
level: 8
23+
php_version: 8.0

.github/workflows/quality.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Quality (PHPStan level 4)
2+
on: push
3+
jobs:
4+
cs-fixer:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- name: Cs-Fixer
9+
run: |
10+
wget -q https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer
11+
chmod a+x php-cs-fixer
12+
PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run
13+
14+
phpstan:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/cache@v2
19+
with:
20+
path: '**/vendor'
21+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
22+
restore-keys: |
23+
${{ runner.os }}-composer-
24+
- uses: php-actions/composer@v5
25+
with:
26+
args: --prefer-dist
27+
php_version: 8.0
28+
- name: PHPStan
29+
uses: php-actions/phpstan@v2
30+
with:
31+
path: src/
32+
level: 4
33+
php_version: 8.0

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Configurator contracts
2+
===
3+
4+
This package brings interfaces for opt-in components, such as plugins, aimed at providing extra functionalities to an Extract-Transform-Load code compiler.
5+
6+
7+
[![Quality](https://github.com/php-etl/configurator-contracts/actions/workflows/quality.yaml/badge.svg)](https://github.com/php-etl/configurator-contracts/actions/workflows/quality.yaml)
8+
[![PHPStan level 5](https://github.com/php-etl/configurator-contracts/actions/workflows/phpstan-5.yaml/badge.svg)](https://github.com/php-etl/configurator-contracts/actions/workflows/phpstan-5.yaml)
9+
[![PHPStan level 7](https://github.com/php-etl/configurator-contracts/actions/workflows/phpstan-7.yaml/badge.svg)](https://github.com/php-etl/configurator-contracts/actions/workflows/phpstan-7.yaml)
10+
[![PHPStan level 8](https://github.com/php-etl/configurator-contracts/actions/workflows/phpstan-8.yaml/badge.svg)](https://github.com/php-etl/configurator-contracts/actions/workflows/phpstan-8.yaml)
11+
![PHP](https://img.shields.io/packagist/php-v/php-etl/configurator-contracts)
12+
13+
Documentation
14+
---
15+
16+
[See full Documentation](https://php-etl.github.io/documentation)
17+

src/Pipeline.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,24 @@ final class Pipeline
88
/** @var list<Pipeline\StepExtractor|Pipeline\StepTransformer|Pipeline\StepLoader> */
99
public array $steps = [];
1010

11+
/**
12+
* @param list<string> $dependencies
13+
* @param array<string, string>|list<Pipeline\StepExtractor|Pipeline\StepTransformer|Pipeline\StepLoader> $steps
14+
*/
1115
public function __construct(
1216
public string $name,
1317
public array $dependencies = [],
1418
array $steps = [],
1519
) {
1620
foreach ($steps as $name => $type) {
17-
if ($type instanceof Pipeline\StepExtractor
18-
|| $type instanceof Pipeline\StepTransformer
19-
|| $type instanceof Pipeline\StepLoader
20-
) {
21-
$this->steps[] = $type;
21+
if (!is_string($name)) {
22+
if (
23+
$type instanceof Pipeline\StepExtractor
24+
|| $type instanceof Pipeline\StepTransformer
25+
|| $type instanceof Pipeline\StepLoader
26+
) {
27+
$this->steps[] = $type;
28+
}
2229
continue;
2330
}
2431

src/RepositoryInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
interface RepositoryInterface
1010
{
11+
/** @param FileInterface|DirectoryInterface<FileInterface> ...$files */
1112
public function addFiles(FileInterface|DirectoryInterface ...$files): self;
1213
/** @return iterable<FileInterface> */
1314
public function getFiles(): iterable;

0 commit comments

Comments
 (0)