protected final function split($text, $keepEmpty = false)
    {
        $lines = array_map(function ($line) {
            return trim($line);
        }, explode("\n", $text));

        if (!$keepEmpty) {
            $lines = array_filter($lines);
            return array_values($lines);
        }

        return $lines;
    }