Skip to content

Commit

Permalink
Fix #107: Add message formatting to README examples
Browse files Browse the repository at this point in the history
  • Loading branch information
samdark committed Dec 8, 2021
1 parent 6a1a19d commit b14c9fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -172,7 +172,7 @@ final class Pi extends Rule
$result = new Result();
$equal = \abs($value - M_PI) < PHP_FLOAT_EPSILON;
if (!$equal) {
$result->addError('Value is not PI.');
$result->addError($this->formatMessage('Value is not PI.'));
}
return $result;
}
Expand All @@ -199,7 +199,7 @@ final class CompanyName extends Rule

if ($hasCompany && $this->isCompanyNameValid($value) === false) {

$result->addError('Company name is not valid.');
$result->addError($this->formatMessage('Company name is not valid.'));
}
return $result;
}
Expand Down Expand Up @@ -237,7 +237,7 @@ final class NoLessThanExistingBidRule extends Rule

$currentMax = $connection->query('SELECT MAX(price) FROM bid')->scalar();
if ($value <= $currentMax) {
$result->addError('There is a higher bid.');
$result->addError($this->formatMessage('There is a higher bid of {bid}.', ['bid' => $currentMax]));
}

return $result;
Expand Down

0 comments on commit b14c9fe

Please sign in to comment.