remove has
This commit is contained in:
@@ -41,14 +41,10 @@ trait Behaviour
|
|||||||
|
|
||||||
$dispatcher->subscribeTo('applicationStart', function (Event $event) {
|
$dispatcher->subscribeTo('applicationStart', function (Event $event) {
|
||||||
$container = $event->getArgument('container');
|
$container = $event->getArgument('container');
|
||||||
if (!self::hasLogger($container)) {
|
|
||||||
return; }
|
|
||||||
self::getLogger($container)->notice('Application start: ' . $_ENV['APPLICATION_NAME']); });
|
self::getLogger($container)->notice('Application start: ' . $_ENV['APPLICATION_NAME']); });
|
||||||
|
|
||||||
$dispatcher->subscribeTo('applicationStop', function (Event $event) {
|
$dispatcher->subscribeTo('applicationStop', function (Event $event) {
|
||||||
$container = $event->getArgument('container');
|
$container = $event->getArgument('container');
|
||||||
if (!self::hasLogger($container)) {
|
|
||||||
return; }
|
|
||||||
self::getLogger($container)->notice('Application stop: ' . $_ENV['APPLICATION_NAME']); });
|
self::getLogger($container)->notice('Application stop: ' . $_ENV['APPLICATION_NAME']); });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,9 +61,4 @@ trait Behaviour
|
|||||||
{
|
{
|
||||||
return [$container->get(Handler::class)];
|
return [$container->get(Handler::class)];
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function hasLogger(Container $container): bool
|
|
||||||
{
|
|
||||||
return $container->has(Logger::class);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user