mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fix logger error
This commit is contained in:
parent
65a5c94c2f
commit
3989c4faff
@ -23,6 +23,7 @@
|
||||
namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Chill\PersonBundle\Privacy\PrivacyEvent;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\PersonBundle\Form\PersonType;
|
||||
@ -69,21 +70,27 @@ class PersonController extends Controller
|
||||
* @var ConfigPersonAltNamesHelper
|
||||
*/
|
||||
protected $configPersonAltNameHelper;
|
||||
|
||||
public function __construct(
|
||||
|
||||
/**
|
||||
* @var \Psr\Log\LoggerInterface
|
||||
*/
|
||||
private $logger;
|
||||
|
||||
public function __construct(
|
||||
SimilarPersonMatcher $similarPersonMatcher,
|
||||
TranslatorInterface $translator,
|
||||
EventDispatcherInterface $eventDispatcher,
|
||||
PersonRepository $personRepository,
|
||||
ConfigPersonAltNamesHelper $configPersonAltNameHelper
|
||||
|
||||
ConfigPersonAltNamesHelper $configPersonAltNameHelper,
|
||||
LoggerInterface $logger
|
||||
) {
|
||||
$this->similarPersonMatcher = $similarPersonMatcher;
|
||||
$this->translator = $translator;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
$this->configPersonAltNameHelper = $configPersonAltNameHelper;
|
||||
$this->personRepository = $personRepository;
|
||||
}
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public function getCFGroup()
|
||||
{
|
||||
@ -296,10 +303,10 @@ class PersonController extends Controller
|
||||
$person = $this->_bindCreationForm($form);
|
||||
|
||||
$errors = $this->_validatePersonAndAccompanyingPeriod($person);
|
||||
$this->get('logger')->info(sprintf('Person created with %d errors ', count($errors)));
|
||||
$this->logger->info(sprintf('Person created with %d errors ', count($errors)));
|
||||
|
||||
if ($errors->count() > 0) {
|
||||
$this->get('logger')->info('The created person has errors');
|
||||
$this->logger->info('The created person has errors');
|
||||
$flashBag = $this->get('session')->getFlashBag();
|
||||
$translator = $this->get('translator');
|
||||
|
||||
@ -321,7 +328,7 @@ class PersonController extends Controller
|
||||
|
||||
return $this->_renderNewForm($form);
|
||||
} else {
|
||||
$this->get('logger')->info('Person created without errors');
|
||||
$this->logger->info('Person created without errors');
|
||||
}
|
||||
|
||||
$alternatePersons = $this->similarPersonMatcher
|
||||
|
@ -6,6 +6,7 @@ services:
|
||||
$eventDispatcher: '@Symfony\Component\EventDispatcher\EventDispatcherInterface'
|
||||
$personRepository: '@Chill\PersonBundle\Repository\PersonRepository'
|
||||
$configPersonAltNameHelper: '@Chill\PersonBundle\Config\ConfigPersonAltNamesHelper'
|
||||
$logger: '@Psr\Log\LoggerInterface'
|
||||
tags: ['controller.service_arguments']
|
||||
|
||||
Chill\PersonBundle\Controller\TimelinePersonController:
|
||||
|
Loading…
x
Reference in New Issue
Block a user