<commit_before><?php

namespace Rehyved\utilities;


class StringHelper
{
    public static function endsWith(string $haystack, string $needle, bool $caseSensitive = true){
        $haystackLength = strlen($haystack);
        $needleLength = strlen($needle);
        if ($needleLength > $haystackLength) return false;
        return substr_compare($haystack, $needle, $haystackLength - $needleLength, $needleLength, $caseSensitive) === 0;
    }

    public static function equals($first, $second, bool $caseSensitive = true){
        if($caseSensitive){
            return $first === $second;
        }else{
            return mb_strtolower($first) === mb_strtolower($second);
        }
    }

    public static function startsWith($haystack, $needle, bool $caseSensitive = true)
    {
        $haystackLength = strlen($haystack);
        $needleLength = strlen($needle);
        if ($needleLength > $haystackLength) return false;
        return substr_compare($haystack, $needle, 0, $needleLength, $caseSensitive) === 0;
    }

    public static function contains($haystack, $needle, bool $caseSensitive = true){
        if(!$caseSensitive){
            return stripos($haystack, $needle);
        }
        return strpos($haystack, $needle);
}
}<commit_msg>Fix for function not returning boolean value<commit_after><?php

namespace Rehyved\utilities;


class StringHelper
{
    public static function endsWith(string $haystack, string $needle, bool $caseSensitive = true){
        $haystackLength = strlen($haystack);
        $needleLength = strlen($needle);
        if ($needleLength > $haystackLength) return false;
        return substr_compare($haystack, $needle, $haystackLength - $needleLength, $needleLength, $caseSensitive) === 0;
    }

    public static function equals($first, $second, bool $caseSensitive = true){
        if($caseSensitive){
            return $first === $second;
        }else{
            return mb_strtolower($first) === mb_strtolower($second);
        }
    }

    public static function startsWith($haystack, $needle, bool $caseSensitive = true)
    {
        $haystackLength = strlen($haystack);
        $needleLength = strlen($needle);
        if ($needleLength > $haystackLength) return false;
        return substr_compare($haystack, $needle, 0, $needleLength, $caseSensitive) === 0;
    }

    public static function contains($haystack, $needle, bool $caseSensitive = true){
        if(!$caseSensitive){
            return stripos($haystack, $needle) !== false;
        }
        return strpos($haystack, $needle) !== false;
}
}
{'fraction_non_alphanumeric': 0.12456208641494745, 'fraction_numerical': 0.0023355391202802647, 'mean_word_length': 3.2339373970345964, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1352893', 'n_tokens_mistral': 779, 'n_tokens_neox': 737, 'n_words': 182}