Fix errors in Core namespace

This commit is contained in:
Art4 2024-12-03 20:11:46 +00:00
parent 6ad1dd72d6
commit 496f0755b1
15 changed files with 79 additions and 75 deletions

View file

@ -55,7 +55,7 @@ class StreamLogger extends AbstractLogger
/**
* {@inheritdoc}
* @param string $level The minimum loglevel at which this logger will be triggered
* @param int $logLevel The minimum loglevel at which this logger will be triggered
*
* @throws LoggerException
*/

View file

@ -17,7 +17,7 @@ class LoggerSettingsCheck implements ICheckLoggerSettings
{
/** @var IManageConfigValues */
protected $config;
/** @var $fileSystem */
/** @var FileSystem */
protected $fileSystem;
/** @var L10n */
protected $l10n;
@ -38,10 +38,8 @@ class LoggerSettingsCheck implements ICheckLoggerSettings
try {
$stream = $this->fileSystem->createStream($file);
if (!isset($stream)) {
throw new LoggerUnusableException('Stream is null.');
}
} catch (LoggerUnusableException $exception) {
throw new LoggerUnusableException('Stream is null.', $exception);
} catch (\Throwable $exception) {
return $this->l10n->t('The logfile \'%s\' is not usable. No logging possible (error: \'%s\')', $file, $exception->getMessage());
}
@ -57,16 +55,14 @@ class LoggerSettingsCheck implements ICheckLoggerSettings
if ($this->config->get('system', 'debugging')) {
$file = $this->config->get('system', 'dlogfile');
if (empty($file)) {
if ($file === null || $file === '') {
return null;
}
try {
$stream = $this->fileSystem->createStream($file);
if (!isset($stream)) {
throw new LoggerUnusableException('Stream is null.');
}
} catch (LoggerUnusableException $exception) {
throw new LoggerUnusableException('Stream is null.', $exception);
} catch (\Throwable $exception) {
return $this->l10n->t('The debug logfile \'%s\' is not usable. No logging possible (error: \'%s\')', $file, $exception->getMessage());
}