From 13230631322675a6e07c4fde0f9c78626b336469 Mon Sep 17 00:00:00 2001 From: Bruce Wells Date: Thu, 10 Jan 2019 13:35:39 -0500 Subject: Replaceable operators (#38) * Updated from NeonXP/MathExecutor * Fixed function in () block issue * Fixing typos in and clarifying documentation. * Syncing from origin (#3) * Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36) * Allow for operators to be replaced based on regex expression --- src/NXP/Classes/TokenFactory.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/NXP/Classes/TokenFactory.php') diff --git a/src/NXP/Classes/TokenFactory.php b/src/NXP/Classes/TokenFactory.php index 4ed55af..778cb59 100644 --- a/src/NXP/Classes/TokenFactory.php +++ b/src/NXP/Classes/TokenFactory.php @@ -88,8 +88,7 @@ class TokenFactory throw new UnknownOperatorException($operatorClass); } - $this->operators[] = $operatorClass; - $this->operators = array_unique($this->operators); + $this->operators[$operatorClass::getRegex()] = $operatorClass; } /** -- cgit v1.2.3