From 27fa4c0cdff12458c7101254785d70566e2634d6 Mon Sep 17 00:00:00 2001 From: Art4 Date: Thu, 9 Jan 2025 09:16:52 +0000 Subject: [PATCH] Remove Dice rules for unused $devLogger service --- src/DI.php | 4 ++-- static/dependencies.config.php | 6 ------ tests/functional/DependencyCheckTest.php | 12 ------------ 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/DI.php b/src/DI.php index ea1aafc8f9..72be1f3aaa 100644 --- a/src/DI.php +++ b/src/DI.php @@ -305,8 +305,8 @@ abstract class DI public static function flushLogger() { $flushDice = self::$dice - ->addRule(LoggerInterface::class, self::$dice->getRule(LoggerInterface::class)) - ->addRule('$devLogger', self::$dice->getRule('$devLogger')); + ->addRule(LoggerInterface::class, self::$dice->getRule(LoggerInterface::class)); + static::init($flushDice); } diff --git a/static/dependencies.config.php b/static/dependencies.config.php index 28ae277c21..5d1edfea22 100644 --- a/static/dependencies.config.php +++ b/static/dependencies.config.php @@ -180,12 +180,6 @@ return (function(string $basepath, array $getVars, array $serverVars, array $coo \Friendica\Core\Logger\Capability\IHaveCallIntrospections::IGNORE_CLASS_LIST, ], ], - '$devLogger' => [ - 'instanceOf' => \Friendica\Core\Logger\Factory\StreamLogger::class, - 'call' => [ - ['createDev', [], Dice::CHAIN_CALL], - ], - ], \Friendica\Core\Cache\Capability\ICanCache::class => [ 'instanceOf' => \Friendica\Core\Cache\Factory\Cache::class, 'call' => [ diff --git a/tests/functional/DependencyCheckTest.php b/tests/functional/DependencyCheckTest.php index 866380fbdf..e06450e754 100644 --- a/tests/functional/DependencyCheckTest.php +++ b/tests/functional/DependencyCheckTest.php @@ -118,18 +118,6 @@ class DependencyCheckTest extends FixtureTestCase self::assertInstanceOf(LoggerInterface::class, $logger); } - public function testDevLogger() - { - /** @var IManageConfigValues $config */ - $config = $this->dice->create(IManageConfigValues::class); - $config->set('system', 'dlogfile', $this->root->url() . '/friendica.log'); - - /** @var LoggerInterface $logger */ - $logger = $this->dice->create('$devLogger', ['dev']); - - self::assertInstanceOf(LoggerInterface::class, $logger); - } - public function testCache() { /** @var ICanCache $cache */