summaryrefslogtreecommitdiff
path: root/lib/SkinContext.php
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-07-09 20:28:38 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-07-09 20:28:38 +0300
commit1add1065cf750d6c18b38ed574cab64007c217c9 (patch)
tree0aa84e50aa632d965fc33e5ae7d2c83a04367b71 /lib/SkinContext.php
parent1d079dabe630efcacb17394d175dcc93cac012ff (diff)
fix for template functions with default valuesHEADmaster
Diffstat (limited to 'lib/SkinContext.php')
-rw-r--r--lib/SkinContext.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/SkinContext.php b/lib/SkinContext.php
index b4192c3..69a6f91 100644
--- a/lib/SkinContext.php
+++ b/lib/SkinContext.php
@@ -28,8 +28,12 @@ class SkinContext {
continue; // skip $ctx
$key = $plain_args ? $n-1 : $param->name;
- if (!$plain_args && !array_key_exists($param->name, $arguments))
- throw new InvalidArgumentException('argument '.$param->name.' not found');
+ if (!$plain_args && !array_key_exists($param->name, $arguments)) {
+ if (!$param->isDefaultValueAvailable())
+ throw new InvalidArgumentException('argument '.$param->name.' not found');
+ else
+ continue;
+ }
if (is_string($arguments[$key]) || $arguments[$key] instanceof SkinString) {
if (is_string($arguments[$key]))