src/DunitCommand.php
private function parseStringToArray($string)
    {
        // convert commas to spaces
        $string = str_replace(',', ' ', $string);
        // convert new lines to spaces
        $string = str_replace(PHP_EOL, ' ', $string);
        // split on the spaces and filter out empty elements
        return array_values(
            array_filter(
                array_map(
                    'trim',
                    explode(' ', $string)
                ),
                'strlen'
            )
        );
    }
private function parseStringToArray($string)
    {
        // convert commas to spaces
        $string = str_replace(',', ' ', $string);
        // convert new lines to spaces
        $string = str_replace(PHP_EOL, ' ', $string);
        // split on the spaces and filter out empty elements
        return array_values(
            array_filter(
                array_map(
                    'trim',
                    explode(' ', $string)
                ),
                'strlen'
            )
        );
    }
private function parseStringToArray ( $ string ) { // convert commas to spaces $ string = str_replace ( ',' , ' ' , $ string ) ; // convert new lines to spaces $ string = str_replace ( PHP_EOL , ' ' , $ string ) ; // split on the spaces and filter out empty elements return array_values ( array_filter ( array_map ( 'trim' , explode ( ' ' , $ string ) ) , 'strlen' ) ) ; }
Parses a string into an array by splitting on spaces, commas or
new line characters and stripping out any empty elements.
@param string $string The input string.
@return array Returns the list of elements as an array.
Parses a string into an array by splitting on spaces commas or new line characters and stripping out any empty elements .