File tree Expand file tree Collapse file tree 2 files changed +10
-46
lines changed
src/DependencyInjection/CompilerPass Expand file tree Collapse file tree 2 files changed +10
-46
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 66
77use Netgen \ApiPlatformExtras \Command \GenerateIriTemplatesCommand ;
88use Netgen \ApiPlatformExtras \Service \IriTemplatesService ;
9+ use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
910use Symfony \Component \DependencyInjection \ContainerBuilder ;
1011use Symfony \Component \DependencyInjection \Definition ;
1112
12- final class IriTemplateGeneratorCompilerPass extends FeatureCompilerPass
13+ final class IriTemplateGeneratorCompilerPass implements CompilerPassInterface
1314{
15+ private const FEATURE_ENABLED_PARAMETER = 'netgen_api_platform_extras.features.iri_template_generator.enabled ' ;
16+
1417 public function process (ContainerBuilder $ container ): void
1518 {
16- if ($ container ->getParameter ($ this ->getFeatureEnabledParameterPath ()) === false ) {
19+ if (
20+ !$ container ->hasParameter (self ::FEATURE_ENABLED_PARAMETER )
21+ || $ container ->getParameter (self ::FEATURE_ENABLED_PARAMETER ) === false
22+ ) {
1723 return ;
1824 }
1925
@@ -22,8 +28,7 @@ public function process(ContainerBuilder $container): void
2228 IriTemplatesService::class,
2329 new Definition (IriTemplatesService::class),
2430 )
25- ->setAutowired (true )
26- ->setPublic (true );
31+ ->setAutowired (true );
2732
2833 $ container
2934 ->setDefinition (
@@ -37,7 +42,6 @@ public function process(ContainerBuilder $container): void
3742 'description ' => 'Generate IRI templates and write them to a JSON file ' ,
3843 ],
3944 )
40- ->setAutowired (true )
41- ->setPublic (true );
45+ ->setAutowired (true );
4246 }
4347}
You can’t perform that action at this time.
0 commit comments