Skip to content

Commit

Permalink
fix best practice
Browse files Browse the repository at this point in the history
  • Loading branch information
jturbide committed Feb 24, 2024
1 parent cf48ac9 commit ce58b9a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Di/InjectableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,9 @@ public function getDI(): DiInterface
{
if (!isset($this->container)) {
$this->container = Di::getDefault();

if (!$this->container) {
$this->container = new DI();
}
}

return $this->container;
return $this->container ?? new DI();
}

public function setDI(DiInterface $container): void
Expand Down

0 comments on commit ce58b9a

Please sign in to comment.