Skip to content

Commit

Permalink
Fixed the PHPStan Github Actions
Browse files Browse the repository at this point in the history
added README
  • Loading branch information
gplanchat committed Sep 26, 2021
1 parent 55c2a4b commit 693c7de
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 41 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/actions.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/phpstan-5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: PHPStan level 5
on: push
jobs:
phpstan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: '**/vendor'
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- uses: php-actions/composer@v5
with:
args: --prefer-dist
php_version: 8.0
- name: PHPStan
uses: php-actions/phpstan@v2
with:
path: src/
level: 4
php_version: 8.0
23 changes: 23 additions & 0 deletions .github/workflows/phpstan-7.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: PHPStan level 7
on: push
jobs:
phpstan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: '**/vendor'
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- uses: php-actions/composer@v5
with:
args: --prefer-dist
php_version: 8.0
- name: PHPStan
uses: php-actions/phpstan@v2
with:
path: src/
level: 7
php_version: 8.0
23 changes: 23 additions & 0 deletions .github/workflows/phpstan-8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: PHPStan level 8
on: push
jobs:
phpstan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: '**/vendor'
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- uses: php-actions/composer@v5
with:
args: --prefer-dist
php_version: 8.0
- name: PHPStan
uses: php-actions/phpstan@v2
with:
path: src/
level: 8
php_version: 8.0
33 changes: 33 additions & 0 deletions .github/workflows/quality.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Quality (PHPStan level 4)
on: push
jobs:
cs-fixer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cs-Fixer
run: |
wget -q https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer
chmod a+x php-cs-fixer
PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run
phpstan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: '**/vendor'
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- uses: php-actions/composer@v5
with:
args: --prefer-dist
php_version: 8.0
- name: PHPStan
uses: php-actions/phpstan@v2
with:
path: src/
level: 4
php_version: 8.0
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Configurator contracts
===

This package brings interfaces for opt-in components, such as plugins, aimed at providing extra functionalities to an Extract-Transform-Load code compiler.


[![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)
[![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)
[![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)
[![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)
![PHP](https://img.shields.io/packagist/php-v/php-etl/configurator-contracts)

Documentation
---

[See full Documentation](https://php-etl.github.io/documentation)

17 changes: 12 additions & 5 deletions src/Pipeline.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,24 @@ final class Pipeline
/** @var list<Pipeline\StepExtractor|Pipeline\StepTransformer|Pipeline\StepLoader> */
public array $steps = [];

/**
* @param list<string> $dependencies
* @param array<string, string>|list<Pipeline\StepExtractor|Pipeline\StepTransformer|Pipeline\StepLoader> $steps
*/
public function __construct(
public string $name,
public array $dependencies = [],
array $steps = [],
) {
foreach ($steps as $name => $type) {
if ($type instanceof Pipeline\StepExtractor
|| $type instanceof Pipeline\StepTransformer
|| $type instanceof Pipeline\StepLoader
) {
$this->steps[] = $type;
if (!is_string($name)) {
if (
$type instanceof Pipeline\StepExtractor
|| $type instanceof Pipeline\StepTransformer
|| $type instanceof Pipeline\StepLoader
) {
$this->steps[] = $type;
}
continue;
}

Expand Down
1 change: 1 addition & 0 deletions src/RepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

interface RepositoryInterface
{
/** @param FileInterface|DirectoryInterface<FileInterface> ...$files */
public function addFiles(FileInterface|DirectoryInterface ...$files): self;
/** @return iterable<FileInterface> */
public function getFiles(): iterable;
Expand Down

0 comments on commit 693c7de

Please sign in to comment.