diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2022-07-09 20:28:38 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2022-07-09 20:28:38 +0300 |
commit | 1add1065cf750d6c18b38ed574cab64007c217c9 (patch) | |
tree | 0aa84e50aa632d965fc33e5ae7d2c83a04367b71 | |
parent | 1d079dabe630efcacb17394d175dcc93cac012ff (diff) |
-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])) |