mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Small improve
This commit is contained in:
parent
22fb471c89
commit
8d6bfb00d1
@ -261,9 +261,6 @@ class Compiler
|
||||
$p = $scope->tpl->parseParams($tokens, $p);
|
||||
|
||||
if (is_numeric($p["step"])) {
|
||||
if($p['to'] === false) {
|
||||
throw new InvalidArgumentException("Invalid value for parameter 'to'");
|
||||
}
|
||||
if ($p["step"] > 0) {
|
||||
$condition = "$var <= {$p['to']}";
|
||||
if ($p["last"]) {
|
||||
|
@ -1467,11 +1467,13 @@ class Template extends Render
|
||||
if ($tokens->is(Tokenizer::MACRO_STRING)) {
|
||||
$key = $tokens->getAndNext();
|
||||
if ($defaults && !isset($defaults[$key])) {
|
||||
throw new \Exception("Unknown parameter '$key'");
|
||||
throw new InvalidUsageException("Unknown parameter '$key'");
|
||||
}
|
||||
if ($tokens->is("=")) {
|
||||
$tokens->next();
|
||||
$params[$key] = $this->parseExpr($tokens);
|
||||
} else {
|
||||
throw new InvalidUsageException("Invalid value for parameter '$key' ");
|
||||
}
|
||||
} elseif ($tokens->is(Tokenizer::MACRO_SCALAR, '"', T_VARIABLE, "[", '(')) {
|
||||
$params[] = $this->parseExpr($tokens);
|
||||
|
Loading…
Reference in New Issue
Block a user