diff --git a/config/settings.yaml b/config/settings.yaml index a59d6ee5a..8c9bb36aa 100644 --- a/config/settings.yaml +++ b/config/settings.yaml @@ -19,7 +19,7 @@ services: class: Pimcore\Bundle\StudioBackendBundle\Setting\Service\SettingsService Pimcore\Bundle\StudioBackendBundle\Setting\Provider\ConfigSettingsProvider: - tags: [ 'pimcore.studio_api.settings_provider' ] + tags: [ 'pimcore.studio_backend.settings_provider' ] Pimcore\Bundle\StudioBackendBundle\Setting\Provider\SystemSettingsProvider: - tags: [ 'pimcore.studio_api.settings_provider' ] \ No newline at end of file + tags: [ 'pimcore.studio_backend.settings_provider' ] \ No newline at end of file diff --git a/src/Setting/Controller/GetController.php b/src/Setting/Controller/GetController.php index 4b67b2426..0a5d215e7 100644 --- a/src/Setting/Controller/GetController.php +++ b/src/Setting/Controller/GetController.php @@ -18,7 +18,6 @@ use OpenApi\Attributes\Get; use OpenApi\Attributes\JsonContent; -use Pimcore\Bundle\AdminBundle\System\AdminConfig; use Pimcore\Bundle\StudioBackendBundle\Controller\AbstractApiController; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Error\MethodNotAllowedResponse; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\Error\UnprocessableContentResponse; @@ -26,8 +25,6 @@ use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attributes\Response\SuccessResponse; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Config\Tags; use Pimcore\Bundle\StudioBackendBundle\Setting\Service\SettingsServiceInterface; -use Pimcore\Config; -use Pimcore\SystemSettingsConfig; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Serializer\SerializerInterface; @@ -66,4 +63,4 @@ public function getSystemSettings(): JsonResponse { return $this->jsonResponse($this->settingsService->getSettings()); } -} \ No newline at end of file +} diff --git a/src/Setting/Provider/ConfigSettingsProvider.php b/src/Setting/Provider/ConfigSettingsProvider.php index 94fde67ab..5f9e21444 100644 --- a/src/Setting/Provider/ConfigSettingsProvider.php +++ b/src/Setting/Provider/ConfigSettingsProvider.php @@ -17,14 +17,16 @@ namespace Pimcore\Bundle\StudioBackendBundle\Setting\Provider; use Pimcore\Config; +use Symfony\Component\DependencyInjection\Attribute\AsTaggedItem; /** * @internal */ -final class ConfigSettingsProvider implements SettingsProviderInterface +#[AsTaggedItem('pimcore.studio_backend.settings_provider')] +final readonly class ConfigSettingsProvider implements SettingsProviderInterface { public function __construct( - private readonly Config $config + private Config $config ) { @@ -40,4 +42,4 @@ public function getSettings(): array ]; } -} \ No newline at end of file +} diff --git a/src/Setting/Provider/SystemSettingsProvider.php b/src/Setting/Provider/SystemSettingsProvider.php index b63831ec0..803f34c2d 100644 --- a/src/Setting/Provider/SystemSettingsProvider.php +++ b/src/Setting/Provider/SystemSettingsProvider.php @@ -17,13 +17,15 @@ namespace Pimcore\Bundle\StudioBackendBundle\Setting\Provider; use Pimcore\SystemSettingsConfig; +use Symfony\Component\DependencyInjection\Attribute\AsTaggedItem; /** * @internal */ -final class SystemSettingsProvider implements SettingsProviderInterface +#[AsTaggedItem('pimcore.studio_backend.settings_provider')] +final readonly class SystemSettingsProvider implements SettingsProviderInterface { - private readonly array $systemSettings; + private array $systemSettings; public function __construct( SystemSettingsConfig $systemSettingsConfig, @@ -45,4 +47,4 @@ public function getSettings(): array 'main_domain' => $this->systemSettings['general']['domain'], ]; } -} \ No newline at end of file +} diff --git a/src/Setting/Service/Loader/TaggedIteratorAdapter.php b/src/Setting/Service/Loader/TaggedIteratorAdapter.php index 0786c56cb..0955f9292 100644 --- a/src/Setting/Service/Loader/TaggedIteratorAdapter.php +++ b/src/Setting/Service/Loader/TaggedIteratorAdapter.php @@ -24,7 +24,7 @@ */ final class TaggedIteratorAdapter implements SettingProviderLoaderInterface { - public const SETTINGS_PROVIDER_TAG = 'pimcore.studio_api.settings_provider'; + public const SETTINGS_PROVIDER_TAG = 'pimcore.studio_backend.settings_provider'; public function __construct( #[TaggedIterator(self::SETTINGS_PROVIDER_TAG)] diff --git a/src/Setting/Service/SettingsService.php b/src/Setting/Service/SettingsService.php index 06452a6d8..dbbd15bc5 100644 --- a/src/Setting/Service/SettingsService.php +++ b/src/Setting/Service/SettingsService.php @@ -19,10 +19,10 @@ /** * @internal */ -final class SettingsService implements SettingsServiceInterface +final readonly class SettingsService implements SettingsServiceInterface { public function __construct( - private readonly SettingProviderLoaderInterface $settingProviderLoader + private SettingProviderLoaderInterface $settingProviderLoader ) { } @@ -30,7 +30,7 @@ public function __construct( public function getSettings(): array { $settings = []; - foreach($this->settingProviderLoader->loadSettingProviders() as $settingProvider) { + foreach ($this->settingProviderLoader->loadSettingProviders() as $settingProvider) { $settings = [ ... $settings, ... $settingProvider->getSettings() @@ -38,4 +38,4 @@ public function getSettings(): array } return $settings; } -} \ No newline at end of file +}