src/RouterCollection.php
private function call(string $method, string $pattern, string $className, string $function, array $options = []): void
    {
        if (empty($className) || empty($function)) {
            throw new Exception('Missing params, we need 2 parameters');
        }

        $route = [
            'method' => $method,
            'pattern' => $pattern,
            'className' => $className,
            'function' => $function,
        ];
        $this->collections[] = $route;

        if (array_key_exists('options', $options)) {
            $this->setOptions($route, $options);
        }

        return;
    }
private function call(string $method, string $pattern, string $className, string $function, array $options = []): void
    {
        if (empty($className) || empty($function)) {
            throw new Exception('Missing params, we need 2 parameters');
        }

        $route = [
            'method' => $method,
            'pattern' => $pattern,
            'className' => $className,
            'function' => $function,
        ];
        $this->collections[] = $route;

        if (array_key_exists('options', $options)) {
            $this->setOptions($route, $options);
        }

        return;
    }
private function call ( string $ method , string $ pattern , string $ className , string $ function , array $ options = [ ] ) : void { if ( empty ( $ className ) || empty ( $ function ) ) { throw new Exception ( 'Missing params, we need 2 parameters' ) ; } $ route = [ 'method' => $ method , 'pattern' => $ pattern , 'className' => $ className , 'function' => $ function , ] ; $ this -> collections [ ] = $ route ; if ( array_key_exists ( 'options' , $ options ) ) { $ this -> setOptions ( $ route , $ options ) ; } return ; }
Add the call function to the collection array.

@param  string $method
@param  string $pattern
@param  string $className
@param  string $function
@return void
Add the call function to the collection array .