public function __construct($routes = array()) { if (!is_array($routes)) { throw new \InvalidArgumentException("Routes must be an array"); } $this->addRoutes($routes); }