locator = $locator; $this->servicesList = $servicesList; } public function getTranslations(): array { $result = []; foreach ($this->servicesList as $service) { $shortName = explode('\\', $service); $shortName = end($shortName); $result[$shortName] = $service; } return $result; } public function getTranslation(string $class): BaseTranslation { if (!$this->locator->has($class)) { throw new TranslationException('Translation class not found'); } return $this->locator->get($class); } }