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