Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Chemaclass/EdifactParser
Browse files Browse the repository at this point in the history
  • Loading branch information
Chemaclass committed Jun 7, 2020
2 parents ec872bd + 349db8c commit 2935bd5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 23 deletions.
28 changes: 8 additions & 20 deletions .github/workflows/ci.yml
Expand Up @@ -7,8 +7,8 @@ on:
name: CI

jobs:
coding-guidelines:
name: Coding Guidelines
build:
name: Style + Tests

runs-on: ubuntu-latest

Expand All @@ -22,26 +22,14 @@ jobs:
php-version: 7.4
coverage: none

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run friendsofphp/php-cs-fixer
run: ./vendor/bin/php-cs-fixer fix --diff-format=udiff --dry-run --show-progress=dots --using-cache=no --verbose

type-checker:
name: Type Checker

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none

- name: Update dependencies with composer
run: ./vendor/bin/composer update --no-interaction --no-ansi --no-progress

- name: Run vimeo/psalm on internal code
run: ./vendor/bin/psalm --config=psalm.xml --no-progress --shepherd --show-info=false --stats

- name: Run test suite
run: composer run-script test
6 changes: 3 additions & 3 deletions src/Segments/SegmentFactory.php
Expand Up @@ -55,13 +55,13 @@ public static function withDefaultSegments(): self
/** @param array<string,string> $segments */
private function __construct(array $segments)
{
Assert::allLength(array_keys($segments), self::TAG_LENGTH);
foreach ($segments as $tag => $class) {
Assert::length($tag, self::TAG_LENGTH);

array_map(function (string $class): void {
if (!$this->classImplements($class, SegmentInterface::class)) {
throw new InvalidArgumentException("'{$class}' must implements 'SegmentInterface'");
}
}, $segments);
}

$this->segments = $segments;
}
Expand Down

0 comments on commit 2935bd5

Please sign in to comment.