From 56e584f24e0286c8cff5adfa84f559d53d5ff08f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mor=C3=A1vek?= Date: Tue, 2 May 2023 09:01:08 +0200 Subject: [PATCH] Avoid naming collision in TexyMultiplier --- src/Texy/TexyMultiplier.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Texy/TexyMultiplier.php b/src/Texy/TexyMultiplier.php index c64e011..ecf6dbf 100644 --- a/src/Texy/TexyMultiplier.php +++ b/src/Texy/TexyMultiplier.php @@ -15,14 +15,14 @@ final class TexyMultiplier use Nette\SmartObject; /** - * @var TexyFactory[] + * @var array */ private array $factories = []; /** - * @var Texy\Texy[] + * @var array */ - private array $texy = []; + private array $instances = []; private string $defaultMode; @@ -43,14 +43,14 @@ public function getTexy(?string $mode = null): Texy\Texy { $mode ??= $this->defaultMode; - if (! isset($this->texy[$mode])) { + if (! isset($this->instances[$mode])) { if (! isset($this->factories[$mode])) { throw new \InvalidArgumentException("Missing Texy! factory for mode '{$mode}'."); } - $this->texy[$mode] = $this->factories[$mode]->create(); + $this->instances[$mode] = $this->factories[$mode]->create(); } - return $this->texy[$mode]; + return $this->instances[$mode]; } public function processBlock(string $text, ?string $mode = null): string