modules = $modules; $this->config = $config; $this->route = $route; } /** * Run the Application * * @return mixed */ public function run() { return $this; } /** * Get all routes from enabled modules * * @return array */ public function getAllRoutes(): ?array { $allRoutes = []; foreach ($this->modules as $module) { $allRoutes = array_merge($allRoutes, $module); } return $allRoutes; } /** * Get the route of the instance call * * @return mixed * @throws \Exception */ public function getRoute() { if ($this->route === null) { throw new \RuntimeException('Route was not configured'); } return $this->route; } /** * Get all services * * @return array */ public function getAllServices(): array { $allServices = []; foreach ($this->modules as $module) { $allServices = array_merge($allServices, $module); } return $allServices; } }