public function connect($route, $callable){
    if(!is_string($route)){
      throw new \InvalidArgumentException("Route to connect to callable musts be provided as a string");
    }
    if(!is_callable($callable)){
      throw new \InvalidArgumentException("Provided callable for $route is not valid.");
    }
    $this->routes[$route] = $callable;
  }
public function connect($route, $callable){
    if(!is_string($route)){
      throw new \InvalidArgumentException("Route to connect to callable musts be provided as a string");
    }
    if(!is_callable($callable)){
      throw new \InvalidArgumentException("Provided callable for $route is not valid.");
    }
    $this->routes[$route] = $callable;
  }
public function connect ( $ route , $ callable ) { if ( ! is_string ( $ route ) ) { throw new \ InvalidArgumentException ( "Route to connect to callable musts be provided as a string" ) ; } if ( ! is_callable ( $ callable ) ) { throw new \ InvalidArgumentException ( "Provided callable for $route is not valid." ) ; } $ this -> routes [ $ route ] = $ callable ; }
Connect a route to a callable
@param string $route
@param callable $callable
@throws InvalidArgumentException
Connect a route to a callable