Skip to content

Commit

Permalink
generateMessage will always return a string.
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Quadling authored and Richard Quadling committed Dec 24, 2018
1 parent d133974 commit 753666c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Assert/Assertion.php
Original file line number Diff line number Diff line change
Expand Up @@ -2589,9 +2589,9 @@ protected static function stringify($value)
*
* @param string|callable $message
*
* @return string|null
* @return string
*/
protected static function generateMessage($message)
protected static function generateMessage($message): string
{
if (\is_callable($message)) {
$traces = \debug_backtrace(0);
Expand All @@ -2618,6 +2618,6 @@ protected static function generateMessage($message)
} // @codeCoverageIgnoreEnd
}

return \is_null($message) ? null : (string) $message;
return (string) $message;
}
}

0 comments on commit 753666c

Please sign in to comment.