function LoggerChannelFactory::__construct
Same name in other branches
- 11.x core/lib/Drupal/Core/Logger/LoggerChannelFactory.php \Drupal\Core\Logger\LoggerChannelFactory::__construct()
Constructs a LoggerChannelFactory.
Parameters
\Symfony\Component\HttpFoundation\RequestStack|null $requestStack: (optional) The request stack.
\Drupal\Core\Session\AccountInterface|null $currentUser: (optional) The current user.
1 method overrides LoggerChannelFactory::__construct()
- LoggerChannelWithoutConstructor::__construct in core/
tests/ Drupal/ Tests/ Core/ Logger/ LoggerChannelFactoryTest.php - Constructs a LoggerChannelFactory.
File
-
core/
lib/ Drupal/ Core/ Logger/ LoggerChannelFactory.php, line 46
Class
- LoggerChannelFactory
- Defines a factory for logging channels.
Namespace
Drupal\Core\LoggerCode
public function __construct(?RequestStack $requestStack = NULL, ?AccountInterface $currentUser = NULL) {
$this->requestStack = $requestStack;
$this->currentUser = $currentUser;
if (!$requestStack) {
@trigger_error('Calling ' . __METHOD__ . ' without the $requestStack argument is deprecated in drupal:10.3.0 and it will be required in drupal:11.0.0. See https://www.drupal.org/node/3416354', E_USER_DEPRECATED);
$this->requestStack = \Drupal::service('request_stack');
}
if (!$currentUser) {
@trigger_error('Calling ' . __METHOD__ . ' without the $currentUser argument is deprecated in drupal:10.3.0 and it will be required in drupal:11.0.0. See https://www.drupal.org/node/3416354', E_USER_DEPRECATED);
$this->currentUser = \Drupal::service('current_user');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.