mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
fix logger service dependency injection
This commit is contained in:
parent
cedf08b906
commit
2c35fb1e5b
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Chill\MainBundle\Controller;
|
namespace Chill\MainBundle\Controller;
|
||||||
|
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
@ -21,7 +22,22 @@ class UserController extends AbstractController
|
|||||||
{
|
{
|
||||||
|
|
||||||
const FORM_GROUP_CENTER_COMPOSED = 'composed_groupcenter';
|
const FORM_GROUP_CENTER_COMPOSED = 'composed_groupcenter';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \Psr\Log\LoggerInterface
|
||||||
|
*/
|
||||||
|
private $logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UserController constructor.
|
||||||
|
*
|
||||||
|
* @param LoggerInterface $logger
|
||||||
|
*/
|
||||||
|
public function __construct(LoggerInterface $logger)
|
||||||
|
{
|
||||||
|
$this->logger = $logger;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lists all User entities.
|
* Lists all User entities.
|
||||||
*
|
*
|
||||||
@ -363,7 +379,7 @@ class UserController extends AbstractController
|
|||||||
$password = $editForm->get('new_password')->getData();
|
$password = $editForm->get('new_password')->getData();
|
||||||
|
|
||||||
// logging for prod
|
// logging for prod
|
||||||
$this->get('logger')->info('update password for an user', [
|
$this->logger->info('update password for an user', [
|
||||||
'by' => $this->getUser()->getUsername(),
|
'by' => $this->getUser()->getUsername(),
|
||||||
'user' => $user->getUsername()
|
'user' => $user->getUsername()
|
||||||
]);
|
]);
|
||||||
|
@ -20,8 +20,13 @@ services:
|
|||||||
|
|
||||||
Chill\MainBundle\Controller\PermissionsGroupController:
|
Chill\MainBundle\Controller\PermissionsGroupController:
|
||||||
arguments:
|
arguments:
|
||||||
$translatableStringHelper: '@Chill\MainBundle\Templating\TranslatableStringHelper'
|
$translatableStringHelper: '@Chill\MainBundle\Templating\TranslatableStringHelper'
|
||||||
$roleProvider: '@chill.main.role_provider'
|
$roleProvider: '@chill.main.role_provider'
|
||||||
$roleHierarchy: '@security.role_hierarchy'
|
$roleHierarchy: '@security.role_hierarchy'
|
||||||
$translator: '@Symfony\Contracts\Translation\TranslatorInterface'
|
$translator: '@Symfony\Contracts\Translation\TranslatorInterface'
|
||||||
tags: ['controller.service_arguments']
|
tags: ['controller.service_arguments']
|
||||||
|
|
||||||
|
Chill\MainBundle\Controller\UserController:
|
||||||
|
arguments:
|
||||||
|
$logger: '@Psr\Log\LoggerInterface'
|
||||||
|
tags: ['controller.service_arguments']
|
Loading…
x
Reference in New Issue
Block a user