{"record":{"id":"0776a317635ff035","repo":"symfony/translation","slug":"provider-s-not-found-available-s","errorCode":null,"errorMessage":"Provider \"%s\" not found. Available: \"%s\".","messagePattern":"Provider \"(.+?)\" not found\\. Available: \"(.+?)\"\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"Provider/TranslationProviderCollection.php","lineNumber":47,"sourceCode":"    public function __construct(iterable $providers)\n    {\n        $this->providers = \\is_array($providers) ? $providers : iterator_to_array($providers);\n    }\n\n    public function __toString(): string\n    {\n        return '['.implode(',', array_keys($this->providers)).']';\n    }\n\n    public function has(string $name): bool\n    {\n        return isset($this->providers[$name]);\n    }\n\n    public function get(string $name): ProviderInterface\n    {\n        if (!$this->has($name)) {\n            throw new InvalidArgumentException(\\sprintf('Provider \"%s\" not found. Available: \"%s\".', $name, (string) $this));\n        }\n\n        return $this->providers[$name];\n    }\n\n    public function keys(): array\n    {\n        return array_keys($this->providers);\n    }\n}\n","sourceCodeStart":29,"sourceCodeEnd":58,"githubUrl":"https://github.com/symfony/translation/blob/ae9e8a51bc29780d63c7f9efd6005d7c875e100b/Provider/TranslationProviderCollection.php#L29-L58","documentation":"Thrown by TranslationProviderCollection::get() when requesting a provider by name that is not registered in the collection. The message lists available provider names via the collection's string representation.","triggerScenarios":"Calling get($name) where has($name) is false — i.e. no provider service with that name exists in the collection.","commonSituations":"Typo in the provider name passed to translator provider commands (translation:extract, provider write/read), provider not configured under framework.translator.providers, or wrong service tag wiring.","solutions":["Check the exact provider name with $collection->keys() (names are listed in the exception)","Verify the provider is configured under framework.translator.providers in config/packages/translation.yaml","Call has($name) before get($name) in custom code"],"exampleFix":"// before\n$provider = $collection->get('acme'); // not registered\n// after\nif ($collection->has('acf')) {\n    $provider = $collection->get('acf');\n}","handlingStrategy":"validation","validationCode":"if (!$collection->has($name)) {\n    $name = $collection->keys()[0] ?? throw new \\RuntimeException('No providers configured.');\n}","typeGuard":null,"tryCatchPattern":"try {\n    $provider = $collection->get($name);\n} catch (InvalidArgumentException $e) {\n    // log available: (string) $collection, then rethrow or default\n}","preventionTips":["Call has() before get()","Dump $collection->keys() when debugging provider names","Configure providers under framework.translator.providers and keep names consistent between config and commands"],"tags":["php","symfony","translation","provider"],"backgroundTag":"resource-not-found","analyzedSha":"ae9e8a51bc29780d63c7f9efd6005d7c875e100b","analyzedAt":"2026-09-15T22:29:15.305Z","contentChangedAt":"2026-09-15T22:29:15.305Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}