protected function parseData(
        array $segments,
        array $data,
        array $params,
        array &$replace,
        array &$replacements
    ): void {
        // Iterate through all the data properties
        foreach ($data as $key => $datum) {
            // If the data isn't found in the params array it is not a valid
            // param
            if (! isset($params[$key])) {
                throw new InvalidArgumentException(
                    "Invalid route param '{$key}'"
                );
            }

            $regex = $params[$key]['regex'];

            $this->validateDatum($key, $datum, $regex);

            if (\is_array($datum)) {
                // Get the segment by the param key and replace the {key}
                // within it to get the repeatable portion of the segment
                $segment     = $this->findParamSegment(
                    $segments,
                    $params[$key]['replace']
                );
                $deliminator = str_replace(
                    $params[$key]['replace'] . '*',
                    '',
                    $segment
                );

                // Set what to replace
                $replace[] = $params[$key]['replace'] . '*';
                // With the data value to replace with
                $replacements[] = implode($deliminator, $datum);

                continue;
            }

            // Set what to replace
            $replace[] = $params[$key]['replace'];
            // With the data value to replace with
            $replacements[] = $datum;
        }
    }
protected function parseData(
        array $segments,
        array $data,
        array $params,
        array &$replace,
        array &$replacements
    ): void {
        // Iterate through all the data properties
        foreach ($data as $key => $datum) {
            // If the data isn't found in the params array it is not a valid
            // param
            if (! isset($params[$key])) {
                throw new InvalidArgumentException(
                    "Invalid route param '{$key}'"
                );
            }

            $regex = $params[$key]['regex'];

            $this->validateDatum($key, $datum, $regex);

            if (\is_array($datum)) {
                // Get the segment by the param key and replace the {key}
                // within it to get the repeatable portion of the segment
                $segment     = $this->findParamSegment(
                    $segments,
                    $params[$key]['replace']
                );
                $deliminator = str_replace(
                    $params[$key]['replace'] . '*',
                    '',
                    $segment
                );

                // Set what to replace
                $replace[] = $params[$key]['replace'] . '*';
                // With the data value to replace with
                $replacements[] = implode($deliminator, $datum);

                continue;
            }

            // Set what to replace
            $replace[] = $params[$key]['replace'];
            // With the data value to replace with
            $replacements[] = $datum;
        }
    }
protected function parseData ( array $ segments , array $ data , array $ params , array & $ replace , array & $ replacements ) : void { // Iterate through all the data properties foreach ( $ data as $ key => $ datum ) { // If the data isn't found in the params array it is not a valid // param if ( ! isset ( $ params [ $ key ] ) ) { throw new InvalidArgumentException ( "Invalid route param '{$key}'" ) ; } $ regex = $ params [ $ key ] [ 'regex' ] ; $ this -> validateDatum ( $ key , $ datum , $ regex ) ; if ( \ is_array ( $ datum ) ) { // Get the segment by the param key and replace the {key} // within it to get the repeatable portion of the segment $ segment = $ this -> findParamSegment ( $ segments , $ params [ $ key ] [ 'replace' ] ) ; $ deliminator = str_replace ( $ params [ $ key ] [ 'replace' ] . '*' , '' , $ segment ) ; // Set what to replace $ replace [ ] = $ params [ $ key ] [ 'replace' ] . '*' ; // With the data value to replace with $ replacements [ ] = implode ( $ deliminator , $ datum ) ; continue ; } // Set what to replace $ replace [ ] = $ params [ $ key ] [ 'replace' ] ; // With the data value to replace with $ replacements [ ] = $ datum ; } }
Parse data for replacements.

@param array $segments     The segments
@param array $data         The data
@param array $params       The params
@param array $replace      The replace array
@param array $replacements The replacements array

@throws \InvalidArgumentException

@return void
Parse data for replacements .