Der Container wird nur bei der Initialisierung benötigt.

This commit is contained in:
2021-04-07 12:07:55 +02:00
parent 9a542c9108
commit 60eb1f92e8
@@ -23,7 +23,6 @@ class WorkingHoursController
{ {
protected PDO $databases; protected PDO $databases;
protected ContainerInterface $container;
/** /**
* WorkingHoursController constructor. * WorkingHoursController constructor.
@@ -34,11 +33,10 @@ class WorkingHoursController
*/ */
public function __construct(ContainerInterface $container) public function __construct(ContainerInterface $container)
{ {
$this->container = $container; if ($container->has('databases') === false) {
if ($this->container->has('databases') === false) {
throw new NotDatabasesException('Datenbank ist nicht Vorhanden'); throw new NotDatabasesException('Datenbank ist nicht Vorhanden');
} }
$this->databases = $this->container->get('databases'); $this->databases = $container->get('databases');
} }
/** /**