protected function buildBuilders($pattern, array $matches)
    {
        $result = [
            'pattern' => $pattern,
            'segments' => []
        ];

        foreach ($matches as $match) {
            list($key,) = $this->splitSegment($match[3]);
            $result['pattern'] = str_replace($match[0], '{' . $key . '}', $result['pattern']);
            $result['segments']['{' . $key . '}'] = '{value}' . $match[4] . (isset($match[7]) ? $match[7] : '');
        }

        return $result;
    }
protected function buildBuilders($pattern, array $matches)
    {
        $result = [
            'pattern' => $pattern,
            'segments' => []
        ];

        foreach ($matches as $match) {
            list($key,) = $this->splitSegment($match[3]);
            $result['pattern'] = str_replace($match[0], '{' . $key . '}', $result['pattern']);
            $result['segments']['{' . $key . '}'] = '{value}' . $match[4] . (isset($match[7]) ? $match[7] : '');
        }

        return $result;
    }
protected function buildBuilders ( $ pattern , array $ matches ) { $ result = [ 'pattern' => $ pattern , 'segments' => [ ] ] ; foreach ( $ matches as $ match ) { list ( $ key , ) = $ this -> splitSegment ( $ match [ 3 ] ) ; $ result [ 'pattern' ] = str_replace ( $ match [ 0 ] , '{' . $ key . '}' , $ result [ 'pattern' ] ) ; $ result [ 'segments' ] [ '{' . $ key . '}' ] = '{value}' . $ match [ 4 ] . ( isset ( $ match [ 7 ] ) ? $ match [ 7 ] : '' ) ; } return $ result ; }
Builds array allowing route creation

@param string $pattern
@param array  $matches

@return array
Builds array allowing route creation