aboutsummaryrefslogtreecommitdiff
path: root/src/NXP/Classes/TokenFactory.php
diff options
context:
space:
mode:
authorBruce Wells <brucekwells@gmail.com>2020-04-11 03:40:21 +0300
committerGitHub <noreply@github.com>2020-04-11 03:40:21 +0300
commit7198653aef6eab55e1644eea9f16bf0dd0dc2edd (patch)
treee61d76954437062412493fb6436bf092ed4e4b40 /src/NXP/Classes/TokenFactory.php
parent4955c639e1069ba3d3415d01a3368f09b000c2a7 (diff)
Update documentation for PHPFUI/InstaDoc (#58)
Diffstat (limited to 'src/NXP/Classes/TokenFactory.php')
-rw-r--r--src/NXP/Classes/TokenFactory.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/NXP/Classes/TokenFactory.php b/src/NXP/Classes/TokenFactory.php
index 5aa634a..70d1ba9 100644
--- a/src/NXP/Classes/TokenFactory.php
+++ b/src/NXP/Classes/TokenFactory.php
@@ -54,6 +54,7 @@ class TokenFactory
* @param string $name
* @param callable $function
* @param int $places
+ * @return TokenFactory
* @throws \ReflectionException
*/
public function addFunction($name, callable $function, $places = null)
@@ -63,6 +64,8 @@ class TokenFactory
$places = $reflector->getNumberOfParameters();
}
$this->functions[$name] = [$places, $function];
+
+ return $this;
}
/**
@@ -79,6 +82,7 @@ class TokenFactory
/**
* Add operator
* @param string $operatorClass
+ * @return TokenFactory
* @throws UnknownOperatorException
* @throws \ReflectionException
*/
@@ -91,6 +95,8 @@ class TokenFactory
}
$this->operators[$operatorClass::getRegex()] = $operatorClass;
+
+ return $this;
}
/**
@@ -113,6 +119,7 @@ class TokenFactory
public function setDivisionByZeroException($exception = true)
{
$this->divideByZeroReporting = $exception;
+
return $this;
}
@@ -147,6 +154,7 @@ class TokenFactory
TokenComma::getRegex()
);
$s .= $operatorsRegex . '/i';
+
return $s;
}