Znerol\Component\Stringprep\Profile::apply PHP Method

apply() public method

Apply this profile to a given string.
public apply ( $string, $encoding = 'UTF-8', $mode = self::MODE_STORE )
    public function apply($string, $encoding = 'UTF-8', $mode = self::MODE_STORE)
    {
        $codepoints = UnicodeUtil::stringToCodepoints($string);
        if ($mode == self::MODE_STORE) {
            $codepoints = array_filter($codepoints, 'Znerol\\Component\\Stringprep\\RFC3454\\A_1::filter');
        }
        $codepoints = $this->map($codepoints);
        $codepoints = $this->normalize($codepoints);
        $this->prohibit($codepoints);
        $this->checkbidi($codepoints);
        return UnicodeUtil::codepointsToString($codepoints);
    }