private static function preserveBreakpoint($value, $length)
    {
        if (strlen($value) <= $length) {
            return $length;
        }
        $breakpoint = mb_strpos($value, ' ', $length);
        $length = $breakpoint;
        if (false === $breakpoint) {
            $length = mb_strlen($value);
        }
        return $length;
    }
private static function preserveBreakpoint($value, $length)
    {
        if (strlen($value) <= $length) {
            return $length;
        }
        $breakpoint = mb_strpos($value, ' ', $length);
        $length = $breakpoint;
        if (false === $breakpoint) {
            $length = mb_strlen($value);
        }
        return $length;
    }
private static function preserveBreakpoint ( $ value , $ length ) { if ( strlen ( $ value ) <= $ length ) { return $ length ; } $ breakpoint = mb_strpos ( $ value , ' ' , $ length ) ; $ length = $ breakpoint ; if ( false === $ breakpoint ) { $ length = mb_strlen ( $ value ) ; } return $ length ; }
Check truncate length to avoid split a word

@param string $value
@param int    $length

@return int
Check truncate length to avoid split a word