Skip to content

Commit

Permalink
Merge pull request #1736 from bobvandevijver/fix-symfony-5.2
Browse files Browse the repository at this point in the history
Explicitly mark public services as public for Symfony 5.2 compatibility
  • Loading branch information
XWB authored Nov 30, 2020
2 parents 581f3df + e4a2abd commit fefa9e7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function process(ContainerBuilder $container)
}

if (!$providerDef->isPublic()) {
throw new \InvalidArgumentException(sprintf('Elastica persister "%s" must be a public service', $id));
throw new \InvalidArgumentException(sprintf('Elastica pager provider "%s" must be a public service', $id));
}

$registeredProviders[$index][$type] = $id;
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/FOSElasticaExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ private function loadObjectPersister(array $typeConfig, Reference $typeRef, Cont
}

$serviceDef->addTag('fos_elastica.persister', ['index' => $indexName, 'type' => $typeName]);
$serviceDef->setPublic(true);

$container->setDefinition($serviceId, $serviceDef);

Expand Down Expand Up @@ -617,6 +618,7 @@ private function loadTypePagerProvider(array $typeConfig, ContainerBuilder $cont
*/
$providerId = sprintf('fos_elastica.pager_provider.%s.%s', $indexName, $typeName);
$providerDef->addTag('fos_elastica.pager_provider', ['index' => $indexName, 'type' => $typeName]);
$providerDef->setPublic(true);

$container->setDefinition($providerId, $providerDef);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ private function createPagerPersisterDefinition(array $attributes = array())
{
$definition = new Definition(PagerPersisterInterface::class);
$definition->addTag('fos_elastica.pager_persister', $attributes);
$definition->setPublic(true);

return $definition;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public function testShouldSkipClassCheckIfDefinitionHasFactory()
$provider = $this->createProviderDefinition(['index' => 'foo', 'type' => 'bar']);
$provider->setClass(\stdClass::class);
$provider->setFactory('a_factory_function');
$provider->setPublic(true);

$container->setDefinition('a_foo_provider', $provider);

Expand All @@ -146,6 +147,7 @@ private function createProviderDefinition(array $attributes = array())
{
$definition = new Definition(PagerProviderInterface::class);
$definition->addTag('fos_elastica.pager_provider', $attributes);
$definition->setPublic(true);

return $definition;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ private function createPersisterDefinition(array $attributes = array())
{
$definition = new Definition(ObjectPersisterInterface::class);
$definition->addTag('fos_elastica.persister', $attributes);
$definition->setPublic(true);

return $definition;
}
Expand Down

0 comments on commit fefa9e7

Please sign in to comment.