injectableFactory = $injectableFactory; $this->classFinder = $classFinder; } public function checkAuthRequired(string $name) : bool { $className = $this->getClassName($name); if (!$className) { throw new NotFound("EntryPoint {$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("EntryPoint {$name} not found."); } return $className::$notStrictAuth ?? false; } public function run(string $name, Request $request, array $data = []) { $className = $this->getClassName($name); if (!$className) { throw new NotFound("EntryPoint {$name} not found."); } $entryPoint = $this->injectableFactory->create($className); $entryPoint->run($request, $data); } protected function getClassName(string $name) : ?string { $name = ucfirst($name); return $this->classFinder->find('EntryPoints', $name); } }