protected function startController()
	{
		$this->benchmark->start('controller');
		$this->benchmark->start('controller_constructor');

		// Is it routed to a Closure?
		if (is_object($this->controller) && (get_class($this->controller) === 'Closure'))
		{
			$controller = $this->controller;
			return $controller(...$this->router->params());
		}

		// No controller specified - we don't know what to do now.
		if (empty($this->controller))
		{
			throw PageNotFoundException::forEmptyController();
		}

		// Try to autoload the class
		if (! class_exists($this->controller, true) || $this->method[0] === '_')
		{
			throw PageNotFoundException::forControllerNotFound($this->controller, $this->method);
		}
		else if (! method_exists($this->controller, '_remap') &&
				! is_callable([$this->controller, $this->method], false)
		)
		{
			throw PageNotFoundException::forMethodNotFound($this->method);
		}
	}
protected function startController()
	{
		$this->benchmark->start('controller');
		$this->benchmark->start('controller_constructor');

		// Is it routed to a Closure?
		if (is_object($this->controller) && (get_class($this->controller) === 'Closure'))
		{
			$controller = $this->controller;
			return $controller(...$this->router->params());
		}

		// No controller specified - we don't know what to do now.
		if (empty($this->controller))
		{
			throw PageNotFoundException::forEmptyController();
		}

		// Try to autoload the class
		if (! class_exists($this->controller, true) || $this->method[0] === '_')
		{
			throw PageNotFoundException::forControllerNotFound($this->controller, $this->method);
		}
		else if (! method_exists($this->controller, '_remap') &&
				! is_callable([$this->controller, $this->method], false)
		)
		{
			throw PageNotFoundException::forMethodNotFound($this->method);
		}
	}
protected function startController ( ) { $ this -> benchmark -> start ( 'controller' ) ; $ this -> benchmark -> start ( 'controller_constructor' ) ; // Is it routed to a Closure? if ( is_object ( $ this -> controller ) && ( get_class ( $ this -> controller ) === 'Closure' ) ) { $ controller = $ this -> controller ; return $ controller ( ... $ this -> router -> params ( ) ) ; } // No controller specified - we don't know what to do now. if ( empty ( $ this -> controller ) ) { throw PageNotFoundException :: forEmptyController ( ) ; } // Try to autoload the class if ( ! class_exists ( $ this -> controller , true ) || $ this -> method [ 0 ] === '_' ) { throw PageNotFoundException :: forControllerNotFound ( $ this -> controller , $ this -> method ) ; } else if ( ! method_exists ( $ this -> controller , '_remap' ) && ! is_callable ( [ $ this -> controller , $ this -> method ] , false ) ) { throw PageNotFoundException :: forMethodNotFound ( $ this -> method ) ; } }
Now that everything has been setup, this method attempts to run the
controller method and make the script go. If it's not able to, will
show the appropriate Page Not Found error.
Now that everything has been setup this method attempts to run the controller method and make the script go . If it s not able to will show the appropriate Page Not Found error .