public static function endsWith($needle, $haystack, $caseSensitive = true)
    {
        list($needle, $haystack) = self::transformCase($needle, $haystack, $caseSensitive);

        return (self::substring($haystack, -(self::length($needle))) === $needle);
    }