make timeline & paginator service private

This commit is contained in:
2020-07-28 13:10:59 +02:00
parent 930ab84a58
commit e05031a743
7 changed files with 45 additions and 33 deletions

View File

@@ -120,6 +120,7 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
$loader->load('services/phonenumber.yml');
$loader->load('services/cache.yml');
$loader->load('services/templating.yml');
$loader->load('services/timeline.yml');
$this->configureCruds($container, $config['cruds'], $loader);
}

View File

@@ -17,28 +17,28 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\MainBundle\DependencyInjection;
namespace Chill\MainBundle\DependencyInjection\CompilerPass;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
/**
* Add services taggued with `name: chill.timeline` to
* timeline_builder service definition
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class TimelineCompilerClass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('chill.main.timeline_builder')) {
throw new \LogicException('service chill.main.timeline_builder '
if (!$container->hasDefinition('chill_main.timeline_builder')) {
throw new \LogicException('service chill_main.timeline_builder '
. 'is not defined.');
}
$definition = $container->getDefinition(
'chill.main.timeline_builder'
'chill_main.timeline_builder'
);
$taggedServices = $container->findTaggedServiceIds(
@@ -56,7 +56,7 @@ class TimelineCompilerClass implements CompilerPassInterface
$definition->addMethodCall(
'addProvider',
array($attributes["context"], $id)
array($attributes["context"], $id, new Reference($id))
);
}
}