Fix TimelineBuilder service.

This commit is contained in:
Pol Dellaiera 2021-05-06 14:37:15 +02:00
parent d2a93f0763
commit 1f488109e3
4 changed files with 77 additions and 50 deletions

View File

@ -29,7 +29,7 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface;
* *
* @author Julien Fastré <julien.fastre@champs-libres.coop> * @author Julien Fastré <julien.fastre@champs-libres.coop>
*/ */
class TimelineBuilder implements ContainerAwareInterface class TimelineBuilder implements ContainerAwareInterface, TimelineBuilderInterface
{ {
use \Symfony\Component\DependencyInjection\ContainerAwareTrait; use \Symfony\Component\DependencyInjection\ContainerAwareTrait;

View File

@ -0,0 +1,24 @@
<?php
/*
* Copyright (C) 2015 Champs-Libres Coopérative <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\MainBundle\Timeline;
interface TimelineBuilderInterface
{
}

View File

@ -5,3 +5,5 @@ services:
- "@doctrine.orm.entity_manager" - "@doctrine.orm.entity_manager"
calls: calls:
- [ setContainer, ["@service_container"]] - [ setContainer, ["@service_container"]]
Chill\MainBundle\Timeline\TimelineBuilderInterface: "@chill_main.timeline_builder"

View File

@ -26,6 +26,7 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Chill\MainBundle\Timeline\TimelineBuilder; use Chill\MainBundle\Timeline\TimelineBuilder;
use Chill\MainBundle\Pagination\PaginatorFactory; use Chill\MainBundle\Pagination\PaginatorFactory;
use Chill\MainBundle\Timeline\TimelineBuilderInterface;
use Chill\PersonBundle\Security\Authorization\PersonVoter; use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
@ -45,7 +46,7 @@ class TimelinePersonController extends AbstractController
/** /**
* *
* @var TimelineBuilder * @var TimelineBuilderInterface
*/ */
protected $timelineBuilder; protected $timelineBuilder;
@ -62,7 +63,7 @@ class TimelinePersonController extends AbstractController
*/ */
public function __construct( public function __construct(
EventDispatcherInterface $eventDispatcher, EventDispatcherInterface $eventDispatcher,
TimelineBuilder $timelineBuilder, TimelineBuilderInterface $timelineBuilder,
PaginatorFactory $paginatorFactory PaginatorFactory $paginatorFactory
) { ) {
$this->eventDispatcher = $eventDispatcher; $this->eventDispatcher = $eventDispatcher;