From f0d4562b9ef3bbc64cb8353f0597e639420ede6b Mon Sep 17 00:00:00 2001 From: Bruce Wells Date: Tue, 30 Oct 2018 16:16:01 -0400 Subject: Division By Zero Exception support Updated the documentation. Unit tests for strings. DivisionByZeroException support. --- src/NXP/Classes/Token/AbstractOperator.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/NXP/Classes/Token/AbstractOperator.php') diff --git a/src/NXP/Classes/Token/AbstractOperator.php b/src/NXP/Classes/Token/AbstractOperator.php index 6cdfe99..87634d5 100644 --- a/src/NXP/Classes/Token/AbstractOperator.php +++ b/src/NXP/Classes/Token/AbstractOperator.php @@ -17,4 +17,34 @@ abstract class AbstractOperator implements InterfaceToken, InterfaceOperator { const RIGHT_ASSOC = 'RIGHT'; const LEFT_ASSOC = 'LEFT'; + + /** + * Divide by zero reporting + * + * @var bool + */ + private $divideByZeroReporting = false; + + /** + * Set division by zero exception reporting + * + * @param bool $exception default true + * + * @return $this + */ + public function setDivisionByZeroException($exception = true) + { + $this->divideByZeroReporting = $exception; + return $this; + } + + /** + * Get division by zero exception status + * + * @return bool + */ + public function getDivisionByZeroException() + { + return $this->divideByZeroReporting; + } } -- cgit v1.2.3