Skip to content

Commit

Permalink
fix code after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
JoMessina committed Oct 30, 2023
1 parent c2e0bce commit 3d3b395
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Plugin/Filtering/Builder/Reject.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ private function buildExclusions(Exclusion ...$exclusions): array
new Node\Expr\Variable('input'),
new Node\Expr\Yield_(
new Node\Expr\New_(
$exclusion->reason ? new Node\Name\FullyQualified(RejectionWithReasonResultBucket::class) : new Node\Name\FullyQualified(RejectionResultBucket::class),
null !== $exclusion->reason ? new Node\Name\FullyQualified(RejectionWithReasonResultBucket::class) : new Node\Name\FullyQualified(RejectionResultBucket::class),

Check failure on line 73 in src/Plugin/Filtering/Builder/Reject.php

View workflow job for this annotation

GitHub Actions / phpstan

Class Kiboko\Component\Bucket\RejectionWithReasonResultBucket not found.
[
null !== $this->rejection_serializer ? new Node\Arg($this->rejection_serializer) : new Node\Arg(new Node\Expr\Variable('input')),
null !== $exclusion->rejectionSerializer ? new Node\Arg($exclusion->rejectionSerializer) : new Node\Arg(new Node\Expr\Variable('input')),
$exclusion->reason ? new Node\Arg($exclusion->reason) : new Node\Arg(
new Node\Expr\ConstFetch(
new Node\Name(null)
Expand Down
3 changes: 2 additions & 1 deletion src/Plugin/Filtering/DTO/Exclusion.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Exclusion
{
public function __construct(
public Expr $when,
public ?Expr $reason = null
public ?Expr $reason = null,
public ?Expr $rejectionSerializer = null
){}
}
4 changes: 1 addition & 3 deletions src/Plugin/Filtering/Factory/Reject.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@ public function compile(array $config): Repository\Reject
new Filtering\DTO\Exclusion(
compileExpression($interpreter, $condition['when']),
compileValueWhenExpression($interpreter, $condition['reason']) ?: null,
compileExpression($interpreter, $condition['rejection_serializer']) ?: null
),
);
if (\array_key_exists('rejection_serializer', $condition)) {
$builder->withRejectionSerializer(compileExpression($interpreter, $condition['rejection_serializer']));
}
}

return $repository;
Expand Down

0 comments on commit 3d3b395

Please sign in to comment.