How use service.yml
file set public static properties of class?
Example of class
<?php
class TelegramLog
{
protected static $logger;
protected static $update_logger;
public static $always_log_request_and_response = false;
public static $remove_bot_token = true;
public static function initialize(LoggerInterface $logger = null, LoggerInterface $update_logger = null): void
{
self::$logger = $logger ?: new NullLogger();
self::$update_logger = $update_logger ?: new NullLogger();
}
}
Part of my services.yaml
Longman\TelegramBot\TelegramLog:
calls:
- initialize:
$logger: '@logger'
$update_logger: '@logger'
I tried to use properties
keywords, but it works only for property of object.
I want to change default values $always_log_request_and_response
and $remove_bot_token
of properties in service.yml