1818use Symfony \Component \DependencyInjection \Extension \PrependExtensionInterface ;
1919use Symfony \Component \DependencyInjection \Loader ;
2020
21- class IbexaSystemInfoExtension extends Extension implements PrependExtensionInterface
21+ final class IbexaSystemInfoExtension extends Extension implements PrependExtensionInterface
2222{
23- public const EXTENSION_NAME = 'ibexa_system_info ' ;
24- public const METRICS_TAG = 'ibexa.system_info.metrics ' ;
25- public const SERVICE_TAG = 'ibexa.system_info.service ' ;
23+ public const string EXTENSION_NAME = 'ibexa_system_info ' ;
24+ public const string METRICS_TAG = 'ibexa.system_info.metrics ' ;
25+ public const string SERVICE_TAG = 'ibexa.system_info.service ' ;
2626
2727 public function getAlias (): string
2828 {
2929 return self ::EXTENSION_NAME ;
3030 }
3131
32+ /**
33+ * @param array<string, mixed> $config
34+ */
3235 public function getConfiguration (array $ config , ContainerBuilder $ container ): Configuration
3336 {
3437 return new Configuration ();
@@ -54,7 +57,6 @@ public function load(array $configs, ContainerBuilder $container): void
5457 $ container ->setParameter (
5558 'ibexa.system_info.powered_by.name ' ,
5659 $ this ->getPoweredByName (
57- $ container ,
5860 $ config ['system_info ' ]['powered_by ' ]['release ' ]
5961 )
6062 );
@@ -66,12 +68,10 @@ public function prepend(ContainerBuilder $container): void
6668 $ this ->prependJMSTranslation ($ container );
6769 }
6870
69- private function getPoweredByName (ContainerBuilder $ container , ?string $ release ): string
71+ private function getPoweredByName (?string $ release ): string
7072 {
71- $ vendor = $ container ->getParameter ('kernel.project_dir ' ) . '/vendor/ ' ;
72-
7373 // Autodetect product name
74- $ name = self ::getNameByPackages ($ vendor );
74+ $ name = self ::getNameByPackages ();
7575
7676 if ($ release === 'major ' ) {
7777 $ name .= ' v ' . (int )Ibexa::VERSION ;
@@ -112,8 +112,10 @@ public static function getEditionByPackages(): string
112112 return 'oss ' ;
113113 }
114114
115- public static function getNameByPackages (string $ vendor = null ): string
115+ public static function getNameByPackages (): string
116116 {
117- return IbexaSystemInfo::PRODUCT_NAME_VARIANTS [self ::getEditionByPackages ()];
117+ return IbexaSystemInfo::PRODUCT_NAME_VARIANTS [
118+ self ::getEditionByPackages ()
119+ ];
118120 }
119121}
0 commit comments