Using method-chaining for DICE

This commit is contained in:
Philipp Holzer 2019-08-05 09:02:55 +02:00
parent a66580444f
commit 9682cc440c
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
9 changed files with 27 additions and 25 deletions

View file

@ -57,9 +57,9 @@ class ApiTest extends DatabaseTest
{
parent::setUp();
$this->dice = new Dice();
$this->dice = $this->dice->addRules(include __DIR__ . '/../../static/dependencies.config.php');
$this->dice = $this->dice->addRule(Database::class, ['instanceOf' => StaticDatabase::class, 'shared' => true]);
$this->dice = (new Dice())
->addRules(include __DIR__ . '/../../static/dependencies.config.php')
->addRule(Database::class, ['instanceOf' => StaticDatabase::class, 'shared' => true]);
BaseObject::setDependencyInjection($this->dice);
/** @var Database $dba */