Merge branch 'develop' into eventdispatcher-part3

This commit is contained in:
Art4 2025-05-12 14:32:53 +00:00
commit ea172010f8
91 changed files with 821 additions and 799 deletions

View file

@ -17,16 +17,16 @@ class SyslogLoggerFactoryWrapper extends SyslogLogger
{
public function create(IManageConfigValues $config): LoggerInterface
{
$logOpts = $config->get('system', 'syslog_flags') ?? SyslogLoggerClass::DEFAULT_FLAGS;
$logFacility = $config->get('system', 'syslog_facility') ?? SyslogLoggerClass::DEFAULT_FACILITY;
$logOpts = (int) $config->get('system', 'syslog_flags') ?? SyslogLoggerClass::DEFAULT_FLAGS;
$logFacility = (int) $config->get('system', 'syslog_facility') ?? SyslogLoggerClass::DEFAULT_FACILITY;
$loglevel = SyslogLogger::mapLegacyConfigDebugLevel($config->get('system', 'loglevel'));
if (array_key_exists($loglevel, SyslogLoggerClass::logLevels)) {
$loglevel = SyslogLoggerClass::logLevels[$loglevel];
} else {
if (!array_key_exists($loglevel, SyslogLoggerClass::logLevels)) {
throw new LogLevelException(sprintf('The level "%s" is not valid.', $loglevel));
}
$loglevel = SyslogLoggerClass::logLevels[$loglevel];
return new SyslogLoggerWrapper($this->channel, $this->introspection, $loglevel, $logOpts, $logFacility);
}
}

View file

@ -17,7 +17,7 @@ class SyslogLoggerWrapper extends SyslogLogger
{
private $content;
public function __construct(string $channel, IHaveCallIntrospections $introspection, string $logLevel, string $logOptions, string $logFacility)
public function __construct(string $channel, IHaveCallIntrospections $introspection, int $logLevel, int $logOptions, int $logFacility)
{
parent::__construct($channel, $introspection, $logLevel, $logOptions, $logFacility);

View file

@ -152,13 +152,13 @@ class UserSessionTest extends MockedTestCase
'data' => [
'remote' => ['3' => '21'],
],
'expected' => false,
'expected' => 0,
],
'empty' => [
'cid' => 21,
'data' => [
],
'expected' => false,
'expected' => 0,
],
];
}
@ -167,7 +167,7 @@ class UserSessionTest extends MockedTestCase
public function testGetUserIdForVisitorContactID(int $cid, array $data, $expected)
{
$userSession = new UserSession(new ArraySession($data));
$this->assertEquals($expected, $userSession->getUserIDForVisitorContactID($cid));
$this->assertSame($expected, $userSession->getUserIDForVisitorContactID($cid));
}
public function dataAuthenticated()