public static function endsWith($string, $needle, $message = null, $propertyPath = null, $encoding = 'utf8')
{
static::string($string, $message, $propertyPath);
$stringPosition = mb_strlen($string, $encoding) - mb_strlen($needle, $encoding);
if (mb_strripos($string, $needle, null, $encoding) !== $stringPosition) {
$message = sprintf($message ?: 'Value "%s" does not end with "%s".', static::stringify($string), static::stringify($needle));
$constraints = array('needle' => $needle, 'encoding' => $encoding);
throw static::createException($string, $message, static::INVALID_STRING_END, $propertyPath, $constraints);
}
return true;
}