Move setupLegacyServiceLocator() into App class

This commit is contained in:
Art4 2025-01-09 13:34:10 +00:00
parent 2f3ef5359f
commit f1dba9f89e
2 changed files with 23 additions and 7 deletions

View file

@ -10,7 +10,6 @@ declare(strict_types=1);
namespace Friendica\Core;
use Dice\Dice;
use Friendica\DI;
/**
* Wrapper for the Dice class to make some basic setups
@ -42,7 +41,7 @@ final class DiceContainer implements Container
*/
public function setup(): void
{
$this->setupLegacyServiceLocator();
// this method can be removed
}
/**
@ -71,8 +70,17 @@ final class DiceContainer implements Container
$this->container = $this->container->addRule($name, $rule);
}
private function setupLegacyServiceLocator(): void
/**
* Only used to inject Dice into DI class
*
* @see \Friendica\DI
*
* @internal
*
* @deprecated
*/
public function getDice(): Dice
{
DI::init($this->container);
return $this->container;
}
}