Feature/moved settings to shopware backend - #4
Conversation
cf2c0d4 to
1eb8a12
Compare
| $providerName = $this->resolveDefaultProviderName(); | ||
| assert(is_string($providerName)); |
There was a problem hiding this comment.
Das ist komisch, da resolveDefaultProviderName NULL zurückgeben kann und danach prüfst du auf is_string.
There was a problem hiding this comment.
Ist angepasst
|
|
||
| if (!$this->hasProvider($salesChannelId)) { | ||
| throw new RuntimeException(\sprintf('No provider for salesChannel "%s" not found.', $salesChannelId)); | ||
| if (!$this->hasSalesChannelProvider($salesChannelId)) { |
There was a problem hiding this comment.
Da bin ich mir nicht sicher. Letztlich soll er hier prüfen ob es einen Default oder SalesChannel spezifischen Provider gibt.
There was a problem hiding this comment.
Dafür gibt es ja die getProvider Funktion. Hier in dem Fall soll er doch gezielt nach dem SalesChannel gucken.
| $providerName = $this->resolveSalesChannelProviderName($salesChannelId); | ||
| assert(is_string($providerName), 'Provider map value must be string'); | ||
|
|
||
| return $this->providers[$salesChannelId] = $this->providerCollection->get($providerName); |
There was a problem hiding this comment.
Auch hier muss mit ??= gearbeitet werden, oder wir sparen uns $providers da wir mit dem providerName in providerCollection suchen können.
Dann kann die class auch readonly werden
There was a problem hiding this comment.
Hab ich so angepasst, dass wir uns $provider sparen und aus der Collection raus arbeiten
|
|
||
| public function getSalesChannelProviderOverride(string $salesChannelId): ?string | ||
| { | ||
| $config = $this->systemConfigService->getDomain(self::PLUGIN_CONFIG_PREFIX, $salesChannelId, false); |
There was a problem hiding this comment.
Warum getDomain? Sollte es nicht getString sein?
There was a problem hiding this comment.
Habe ich angepasst.
| public const string DOMAIN = 'ShopwareTranslationBridge.config'; | ||
|
|
||
| public const string KEY_DEFAULT_PROVIDER = self::DOMAIN . '.defaultProvider'; | ||
|
|
||
| public const string KEY_RESPECT_TRANSLATION_FILES = self::DOMAIN . '.respectTranslationFiles'; |
There was a problem hiding this comment.
Das solltest du in ConfigurationResolver belassen.
There was a problem hiding this comment.
Ist bereits erledigt. Die Datei ist nur noch nicht aufgeräumt gewesen, da ich aus einem andere Projekt heraus gearbeitet habe, und der Change nicht übernommen wurde. Die Datei ist nun korrekt aufgeräumt
Co-authored-by: Sascha Heilmeier <sascha.heilmeier@netlogix.de>
Co-authored-by: Sascha Heilmeier <sascha.heilmeier@netlogix.de>
Co-authored-by: Sascha Heilmeier <sascha.heilmeier@netlogix.de>
No description provided.