injectableFactory = $injectableFactory; $this->classFinder = $classFinder; } public function checkAuthRequired(string $name): bool { $className = $this->getClassName($name); if (!$className) { throw new NotFound("Entry point '{$name}' not found."); } if ($className::$noAuth ?? false) { return false; } // for backward compatibility return $className::$authRequired ?? true; } public function checkNotStrictAuth(string $name): bool { $className = $this->getClassName($name); if (!$className) { throw new NotFound("Entry point '{$name}' not found."); } return $className::$notStrictAuth ?? false; } public function run(string $name, Request $request, Response $response) { $className = $this->getClassName($name); if (!$className) { throw new NotFound("Entry point '{$name}' not found."); } $entryPoint = $this->injectableFactory->create($className); $entryPoint->run($request, $response); } protected function getClassName(string $name): ?string { return $this->classFinder->find('EntryPoints', ucfirst($name)); } }