public function config(array $config): void
    {
        if ($this->routeCounter > 0) {
            throw new \LogicException('Routing has been added, and configuration is not allowed!');
        }

        $props = [
            'name'                   => 1,
            'chains'                 => 1,
            // 'defaultRoute'           => 1,
            'ignoreLastSlash'        => 1,
            'tmpCacheNumber'         => 1,
            'handleMethodNotAllowed' => 1,
            'autoRoute'              => 1,
            'controllerNamespace'    => 1,
            'controllerSuffix'       => 1,
        ];

        foreach ($config as $name => $value) {
            if (isset($props[$name])) {
                $this->$name = $value;
            }
        }
    }
public function config(array $config): void
    {
        if ($this->routeCounter > 0) {
            throw new \LogicException('Routing has been added, and configuration is not allowed!');
        }

        $props = [
            'name'                   => 1,
            'chains'                 => 1,
            // 'defaultRoute'           => 1,
            'ignoreLastSlash'        => 1,
            'tmpCacheNumber'         => 1,
            'handleMethodNotAllowed' => 1,
            'autoRoute'              => 1,
            'controllerNamespace'    => 1,
            'controllerSuffix'       => 1,
        ];

        foreach ($config as $name => $value) {
            if (isset($props[$name])) {
                $this->$name = $value;
            }
        }
    }
public function config ( array $ config ) : void { if ( $ this -> routeCounter > 0 ) { throw new \ LogicException ( 'Routing has been added, and configuration is not allowed!' ) ; } $ props = [ 'name' => 1 , 'chains' => 1 , // 'defaultRoute'           => 1, 'ignoreLastSlash' => 1 , 'tmpCacheNumber' => 1 , 'handleMethodNotAllowed' => 1 , 'autoRoute' => 1 , 'controllerNamespace' => 1 , 'controllerSuffix' => 1 , ] ; foreach ( $ config as $ name => $ value ) { if ( isset ( $ props [ $ name ] ) ) { $ this -> $ name = $ value ; } } }
config the router
@param array $config
@throws \LogicException
config the router