public static function fromString($string)
    {
        try {
            $lineBreak = StringUtil::detectLineBreak($string);
        } catch (DifferentLineBreaksFoundException $e) {
            $lineBreak = $e->getNumberLineBreakOther() >= $e->getNumberLineBreakWindows()
                ? StringUtil::LINE_BREAK_OTHER
                : StringUtil::LINE_BREAK_WINDOWS;
        }

        return new static(StringUtil::breakIntoLines($string), $lineBreak);
    }
public static function fromString($string)
    {
        try {
            $lineBreak = StringUtil::detectLineBreak($string);
        } catch (DifferentLineBreaksFoundException $e) {
            $lineBreak = $e->getNumberLineBreakOther() >= $e->getNumberLineBreakWindows()
                ? StringUtil::LINE_BREAK_OTHER
                : StringUtil::LINE_BREAK_WINDOWS;
        }

        return new static(StringUtil::breakIntoLines($string), $lineBreak);
    }
public static function fromString ( $ string ) { try { $ lineBreak = StringUtil :: detectLineBreak ( $ string ) ; } catch ( DifferentLineBreaksFoundException $ e ) { $ lineBreak = $ e -> getNumberLineBreakOther ( ) >= $ e -> getNumberLineBreakWindows ( ) ? StringUtil :: LINE_BREAK_OTHER : StringUtil :: LINE_BREAK_WINDOWS ; } return new static ( StringUtil :: breakIntoLines ( $ string ) , $ lineBreak ) ; }
Creates a Text instance from a string.

@param $string

@return static
Creates a Text instance from a string .