protected function appendGroupInfo(Route $route): void
    {
        $path = $bak = $route->getPath();

        // Always add '/' prefix.
        $path = \strpos($path, '/') === 0 ? $path : '/' . $path;
        $path = $this->currentGroupPrefix . $path;

        // Has setting 'ignoreLastSlash'
        if ($path !== '/' && $this->ignoreLastSlash) {
            $path = \rtrim($path, '/');
        }

        // Not in group and path not change.
        if ($bak === $path) {
            return;
        }

        $route->setPath($path);

        // Not in group
        if (!$this->currentGroupPrefix) {
            return;
        }

        if ($this->currentGroupOption) {
            $route->setOptions(\array_merge($this->currentGroupOption, $route->getOptions()));
        }

        // Prepend group middleware at before.
        if ($this->currentGroupChains) {
            $route->setChains(\array_merge($this->currentGroupChains, $route->getChains()));
        }
    }
protected function appendGroupInfo(Route $route): void
    {
        $path = $bak = $route->getPath();

        // Always add '/' prefix.
        $path = \strpos($path, '/') === 0 ? $path : '/' . $path;
        $path = $this->currentGroupPrefix . $path;

        // Has setting 'ignoreLastSlash'
        if ($path !== '/' && $this->ignoreLastSlash) {
            $path = \rtrim($path, '/');
        }

        // Not in group and path not change.
        if ($bak === $path) {
            return;
        }

        $route->setPath($path);

        // Not in group
        if (!$this->currentGroupPrefix) {
            return;
        }

        if ($this->currentGroupOption) {
            $route->setOptions(\array_merge($this->currentGroupOption, $route->getOptions()));
        }

        // Prepend group middleware at before.
        if ($this->currentGroupChains) {
            $route->setChains(\array_merge($this->currentGroupChains, $route->getChains()));
        }
    }
protected function appendGroupInfo ( Route $ route ) : void { $ path = $ bak = $ route -> getPath ( ) ; // Always add '/' prefix. $ path = \ strpos ( $ path , '/' ) === 0 ? $ path : '/' . $ path ; $ path = $ this -> currentGroupPrefix . $ path ; // Has setting 'ignoreLastSlash' if ( $ path !== '/' && $ this -> ignoreLastSlash ) { $ path = \ rtrim ( $ path , '/' ) ; } // Not in group and path not change. if ( $ bak === $ path ) { return ; } $ route -> setPath ( $ path ) ; // Not in group if ( ! $ this -> currentGroupPrefix ) { return ; } if ( $ this -> currentGroupOption ) { $ route -> setOptions ( \ array_merge ( $ this -> currentGroupOption , $ route -> getOptions ( ) ) ) ; } // Prepend group middleware at before. if ( $ this -> currentGroupChains ) { $ route -> setChains ( \ array_merge ( $ this -> currentGroupChains , $ route -> getChains ( ) ) ) ; } }
prepare for add
@param Route $route
@return void
prepare for add