injectableFactory = $injectableFactory; $this->classFinder = $classFinder; } public function checkAuthRequired(string $name) : bool { $className = $this->getClassName($name); if (!$className) { throw new NotFound(); } return $className::$authRequired; } public function checkNotStrictAuth(string $name) : bool { $className = $this->getClassName($name); if (!$className) { throw new NotFound(); } return $className::$notStrictAuth; } public function run(string $name, array $data = []) { $className = $this->getClassName($name); if (!$className) { throw new NotFound(); } $entryPoint = $this->injectableFactory->create($className); $entryPoint->run($data); } protected function getClassName(string $name) : ?string { $name = ucfirst($name); return $this->classFinder->find('EntryPoints', $name); } }