Skip to content

Commit

Permalink
removes implicit dependency on sebastian/exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
ju1ius committed Feb 15, 2024
1 parent 2bd8962 commit 0a41656
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions PhpUnit/DefinitionHasArgumentConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ final class DefinitionHasArgumentConstraint extends Constraint
private string|int $argumentIndex;
private mixed $expectedValue;
private bool $checkExpectedValue;
private Exporter $exporter;

public function __construct($argumentIndex, $expectedValue, bool $checkExpectedValue = true)
{
Expand All @@ -39,7 +38,6 @@ public function __construct($argumentIndex, $expectedValue, bool $checkExpectedV
$this->argumentIndex = $argumentIndex;
$this->expectedValue = $expectedValue;
$this->checkExpectedValue = $checkExpectedValue;
$this->exporter = new Exporter();
}

public function toString(): string
Expand Down Expand Up @@ -107,8 +105,8 @@ private function evaluateArgumentValue(Definition $definition, bool $returnResul
sprintf(
'The value of argument named "%s" (%s) is not equal to the expected value (%s)',
$this->argumentIndex,
$this->exporter->export($actualValue),
$this->exporter->export($this->expectedValue)
$this->exporter()->export($actualValue),
$this->exporter()->export($this->expectedValue)
)
);
}
Expand All @@ -124,15 +122,15 @@ private function evaluateArgumentValue(Definition $definition, bool $returnResul
$message = sprintf(
'The value of argument named "%s" (%s) is not equal to the expected value (%s)',
$this->argumentIndex,
$this->exporter->export($actualValue),
$this->exporter->export($this->expectedValue)
$this->exporter()->export($actualValue),
$this->exporter()->export($this->expectedValue)
);
} else {
$message = sprintf(
'The value of argument with index %d (%s) is not equal to the expected value (%s)',
$this->argumentIndex,
$this->exporter->export($actualValue),
$this->exporter->export($this->expectedValue)
$this->exporter()->export($actualValue),
$this->exporter()->export($this->expectedValue)
);
}

Expand Down

0 comments on commit 0a41656

Please sign in to comment.