Skip to content

Commit

Permalink
Rename dataToFormat by serialize_rejection
Browse files Browse the repository at this point in the history
  • Loading branch information
JoMessina committed Oct 17, 2023
1 parent 63a31b9 commit 92cb153
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/Plugin/Filtering/Builder/Reject.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class Reject implements StepBuilderInterface
private ?Node\Expr $logger = null;
private ?Node\Expr $rejection = null;
private ?Node\Expr $state = null;
private ?Node\Expr $dataToFormat = null;
private ?Node\Expr $serialize_rejection = null;
/** @var list<?Node\Expr> */
private array $exclusions = [];

Expand All @@ -43,9 +43,9 @@ public function withState(Node\Expr $state): self
return $this;
}

public function withDataToFormat(Node\Expr $dataToFormat): self
public function withSerialiazeRejection(Node\Expr $serialize_rejection): self
{
$this->dataToFormat = $dataToFormat;
$this->serialize_rejection = $serialize_rejection;

return $this;
}
Expand Down Expand Up @@ -133,7 +133,7 @@ class: new Node\Stmt\Class_(null, [
new Node\Expr\New_(
new Node\Name\FullyQualified(RejectionResultBucket::class),
[
$this->dataToFormat !== null ? new Node\Arg($this->dataToFormat) : new Node\Arg(new Node\Expr\Variable('input'))
$this->serialize_rejection !== null ? new Node\Arg($this->serialize_rejection) : new Node\Arg(new Node\Expr\Variable('input'))
]
),
),
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/Filtering/Configuration/Reject.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getConfigTreeBuilder(): TreeBuilder
->then(asExpression())
->end()
->end()
->scalarNode('dataToFormat')
->scalarNode('serialize_rejection')
->cannotBeEmpty()
->validate()
->ifTrue(isExpression())
Expand Down
4 changes: 2 additions & 2 deletions src/Plugin/Filtering/Factory/Reject.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public function compile(array $config): Repository\Reject
$builder->withExclusions(
compileExpression($interpreter, $condition['when'])
);
if (array_key_exists('dataToFormat', $condition)) {
$builder->withDataToFormat(compileExpression($interpreter, $condition['dataToFormat']));
if (array_key_exists('serialize_rejection', $condition)) {
$builder->withSerialiazeRejection(compileExpression($interpreter, $condition['serialize_rejection']));
}
}

Expand Down

0 comments on commit 92cb153

Please sign in to comment.