src/Components/AbstractSegment.php
protected function validateSegment($data)
    {
        $delimiter = $this->delimiter;

        return $this->convertToArray($data, function ($str) use ($delimiter) {
            if ('' == $str) {
                return array();
            }
            if ($delimiter == $str[0]) {
                $str = substr($str, 1);
            }

            return explode($delimiter, $str);
        });
    }
protected function validateSegment($data)
    {
        $delimiter = $this->delimiter;

        return $this->convertToArray($data, function ($str) use ($delimiter) {
            if ('' == $str) {
                return array();
            }
            if ($delimiter == $str[0]) {
                $str = substr($str, 1);
            }

            return explode($delimiter, $str);
        });
    }
protected function validateSegment ( $ data ) { $ delimiter = $ this -> delimiter ; return $ this -> convertToArray ( $ data , function ( $ str ) use ( $ delimiter ) { if ( '' == $ str ) { return array ( ) ; } if ( $ delimiter == $ str [ 0 ] ) { $ str = substr ( $ str , 1 ) ; } return explode ( $ delimiter , $ str ) ; } ) ; }
Validate data before insertion into a URL segment based component

@param mixed $data the data to insert

@return array

@throws \RuntimeException if the data is not valid
Validate data before insertion into a URL segment based component