From 378881378aab5454c84cb1fecbbcc675f64dc27f Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Fri, 25 Sep 2020 21:18:18 +0200 Subject: Refactor textprocessors They are now managed by TextprocessorRepository and are instances of Textprocessor. This replaces the global $textprocessors variable. --- ratatoeskr/sys/Env.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 ratatoeskr/sys/Env.php (limited to 'ratatoeskr/sys/Env.php') diff --git a/ratatoeskr/sys/Env.php b/ratatoeskr/sys/Env.php new file mode 100644 index 0000000..cfe1598 --- /dev/null +++ b/ratatoeskr/sys/Env.php @@ -0,0 +1,37 @@ +lazyLoaded[$ident])) { + $this->lazyLoaded[$ident] = $callback(); + } + return $this->lazyLoaded[$ident]; + } + + public static function getGlobal(): self + { + self::$globalInstance = self::$globalInstance ?? new self(); + + return self::$globalInstance; + } + + public function textprocessors(): TextprocessorRepository + { + return $this->lazy("textprocessors", [TextprocessorRepository::class, 'buildDefault']); + } +} -- cgit v1.2.3-70-g09d2