Skip to content

Commit

Permalink
Slight refactor to get around xdebug coverage issue
Browse files Browse the repository at this point in the history
  • Loading branch information
chadicus committed Nov 19, 2019
1 parent be96c4a commit 5ca6340
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Filterer.php
Expand Up @@ -548,11 +548,8 @@ private static function handleCustomError(
) : array {
$error = $customError;
if ($error === null) {
$error = sprintf(
"Field '%s' with value '{value}' failed filtering, message '%s'",
$field,
$e->getMessage()
);
$errorFormat = "Field '%s' with value '{value}' failed filtering, message '%s'";
$error = sprintf($errorFormat, $field, $e->getMessage());
}

$errors[$field] = str_replace('{value}', trim(var_export($value, true), "'"), $error);
Expand Down

0 comments on commit 5ca6340

Please sign in to comment.