File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
src/DependencyInjection/Compiler Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public function process(ContainerBuilder $container)
2929 $ registry = $ container ->getDefinition ('fos_elastica.pager_persister_registry ' );
3030
3131 $ nameToServiceIdMap = [];
32- foreach ($ container ->findTaggedServiceIds ('fos_elastica.pager_persister ' ) as $ id => $ attributes ) {
32+ foreach ($ container ->findTaggedServiceIds ('fos_elastica.pager_persister ' , true ) as $ id => $ attributes ) {
3333 foreach ($ attributes as $ attribute ) {
3434 if (!isset ($ attribute ['persisterName ' ])) {
3535 throw new \InvalidArgumentException (sprintf ('Elastica pager persister "%s" must specify the "persisterName" attribute. ' , $ id ));
@@ -53,6 +53,10 @@ public function process(ContainerBuilder $container)
5353 $ this ->assertClassImplementsPagerPersisterInterface ($ id , $ container ->getParameterBag ()->resolveValue ($ persisterDef ->getClass ()));
5454 }
5555
56+ if (!$ persisterDef ->isPublic ()) {
57+ throw new \InvalidArgumentException (sprintf ('Elastica pager persister "%s" must be a public service ' , $ id ));
58+ }
59+
5660 $ nameToServiceIdMap [$ persisterName ] = $ id ;
5761 }
5862 }
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ public function process(ContainerBuilder $container)
3030 $ registry = $ container ->getDefinition ('fos_elastica.pager_provider_registry ' );
3131
3232 $ registeredProviders = [];
33- foreach ($ container ->findTaggedServiceIds ('fos_elastica.pager_provider ' ) as $ id => $ attributes ) {
33+ foreach ($ container ->findTaggedServiceIds ('fos_elastica.pager_provider ' , true ) as $ id => $ attributes ) {
3434 foreach ($ attributes as $ attribute ) {
3535 if (!isset ($ attribute ['type ' ])) {
3636 throw new \InvalidArgumentException (sprintf ('Elastica provider "%s" must specify the "type" attribute. ' , $ id ));
@@ -56,6 +56,10 @@ public function process(ContainerBuilder $container)
5656 $ this ->assertClassImplementsPagerProviderInterface ($ id , $ container ->getParameterBag ()->resolveValue ($ providerDef ->getClass ()));
5757 }
5858
59+ if (!$ providerDef ->isPublic ()) {
60+ throw new \InvalidArgumentException (sprintf ('Elastica persister "%s" must be a public service ' , $ id ));
61+ }
62+
5963 $ registeredProviders [$ index ][$ type ] = $ id ;
6064 }
6165 }
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ public function process(ContainerBuilder $container)
3030 $ registry = $ container ->getDefinition ('fos_elastica.persister_registry ' );
3131
3232 $ registeredPersisters = [];
33- foreach ($ container ->findTaggedServiceIds ('fos_elastica.persister ' ) as $ id => $ attributes ) {
33+ foreach ($ container ->findTaggedServiceIds ('fos_elastica.persister ' , true ) as $ id => $ attributes ) {
3434 foreach ($ attributes as $ attribute ) {
3535 if (!isset ($ attribute ['type ' ])) {
3636 throw new \InvalidArgumentException (sprintf ('Elastica persister "%s" must specify the "type" attribute. ' , $ id ));
@@ -56,6 +56,10 @@ public function process(ContainerBuilder $container)
5656 $ this ->assertClassImplementsPersisterInterface ($ id , $ container ->getParameterBag ()->resolveValue ($ persisterDef ->getClass ()));
5757 }
5858
59+ if (!$ persisterDef ->isPublic ()) {
60+ throw new \InvalidArgumentException (sprintf ('Elastica persister "%s" must be a public service ' , $ id ));
61+ }
62+
5963 $ registeredPersisters [$ index ][$ type ] = $ id ;
6064 }
6165 }
You can’t perform that action at this time.
0 commit comments