Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosas committed May 7, 2023
1 parent 34d9c14 commit 6be012a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ci/phpstan-phpat.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ includes:
- ../extension.neon

parameters:
level: 1
level: 0
paths:
- ../src
- ../tests/architecture
Expand Down
5 changes: 4 additions & 1 deletion src/Statement/Builder/StatementBuilderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use InvalidArgumentException;
use PHPat\Rule\Assertion\Declaration\DeclarationAssertion;
use PHPat\Rule\Assertion\Relation\RelationAssertion;
use PHPat\Test\RelationRule;
use PHPat\Test\Rule;
use PHPat\Test\TestParser;

Expand All @@ -24,12 +25,14 @@ public function create(string $classname): StatementBuilder
{
if (is_a($classname, RelationAssertion::class, true)) {
$statementBuilder = sprintf('%s\\RelationStatementBuilder', __NAMESPACE__);
$rules = array_filter($this->rules, static fn ($rule) => is_a($rule, RelationRule::class, true));
} elseif (is_a($classname, DeclarationAssertion::class, true)) {
$statementBuilder = sprintf('%s\\DeclarationStatementBuilder', __NAMESPACE__);
$rules = array_filter($this->rules, static fn ($rule) => is_a($rule, RelationRule::class, true));
} else {
throw new InvalidArgumentException(sprintf('"%s" is not a valid statement builder', $classname));
}

return new $statementBuilder($classname, $this->rules);
return new $statementBuilder($classname, $rules);
}
}

0 comments on commit 6be012a

Please sign in to comment.