diff options
author | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2024-08-19 14:12:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-19 14:12:11 +0200 |
commit | ba9638eae5376aa97e496c629b27aaa9d1c8f330 (patch) | |
tree | 57508143d85d8a8f6f8e24f164c956af014319bc /lib | |
parent | 40c91aa31e5348a92d22d93fd2881788a75626cd (diff) | |
parent | 2ec68b1eb90aca54e69defd42bf0a610a09f4f49 (diff) | |
download | nextcloud-server-ba9638eae5376aa97e496c629b27aaa9d1c8f330.tar.gz nextcloud-server-ba9638eae5376aa97e496c629b27aaa9d1c8f330.zip |
Merge pull request #47291 from nextcloud/refactor/log-php-8-1
refactor(Log): Use new in initializer instead of constructor body
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Log.php | 6 | ||||
-rw-r--r-- | lib/private/Server.php | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/lib/private/Log.php b/lib/private/Log.php index 4fce0436707..ea995642832 100644 --- a/lib/private/Log.php +++ b/lib/private/Log.php @@ -41,13 +41,9 @@ class Log implements ILogger, IDataLogger { public function __construct( private IWriter $logger, private SystemConfig $config, - private ?Normalizer $normalizer = null, + private Normalizer $normalizer = new Normalizer(), private ?IRegistry $crashReporters = null ) { - // FIXME: php8.1 allows "private Normalizer $normalizer = new Normalizer()," in initializer - if ($normalizer === null) { - $this->normalizer = new Normalizer(); - } } public function setEventDispatcher(IEventDispatcher $eventDispatcher): void { diff --git a/lib/private/Server.php b/lib/private/Server.php index a0072b43ee2..aaf4c925f98 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -735,7 +735,7 @@ class Server extends ServerContainer implements IServerContainer { $logger = $factory->get($logType); $registry = $c->get(\OCP\Support\CrashReport\IRegistry::class); - return new Log($logger, $this->get(SystemConfig::class), null, $registry); + return new Log($logger, $this->get(SystemConfig::class), crashReporters: $registry); }); $this->registerAlias(ILogger::class, \OC\Log::class); /** @deprecated 19.0.0 */ |