From 9984f7b7d60dcf2ad63b650decec6ce6e8b3259c Mon Sep 17 00:00:00 2001 From: Stein Magne Bjorklund <steinmb@smbjorklund.com> Date: Mon, 20 Sep 2021 19:43:59 +0200 Subject: [PATCH] Inject Configuration into Importer.php Enable us to replace global states. --- classes/Importer.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/classes/Importer.php b/classes/Importer.php index f85bbd26..82bed232 100644 --- a/classes/Importer.php +++ b/classes/Importer.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); namespace uib\ub\loadspeakr; @@ -13,10 +13,16 @@ define("CNT", "http://www.w3.org/2011/content#"); define("RDFS", "http://www.w3.org/2000/01/rdf-schema#"); define("FILE", "settings.inc.php"); -class Importer +final class Importer { private $basedir; private $external_basedir; + private Configuration $configuration; + + public function __construct(Configuration $configuration) + { + $this->configuration = $configuration; + } public function run() { -- GitLab