diff options
-rw-r--r-- | lib/SkinContext.php | 8 |
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])) |