diff --git a/composer.lock b/composer.lock index ade669f..1f0fd02 100644 --- a/composer.lock +++ b/composer.lock @@ -422,35 +422,35 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.31", + "version": "9.2.32", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.18 || ^5.0", + "nikic/php-parser": "^4.19.1 || ^5.1.0", "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.6" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -459,7 +459,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "9.2.x-dev" } }, "autoload": { @@ -488,7 +488,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" }, "funding": [ { @@ -496,7 +496,7 @@ "type": "github" } ], - "time": "2024-03-02T06:37:42+00:00" + "time": "2024-08-22T04:23:01+00:00" }, { "name": "phpunit/php-file-iterator", diff --git a/src/AbstractFunction.php b/src/AbstractFunction.php index 9fafaeb..aa72a0e 100644 --- a/src/AbstractFunction.php +++ b/src/AbstractFunction.php @@ -267,14 +267,9 @@ public function setParam(string $key, float|int|bool|array|string $value): Abstr public function setParams(array $params): IFunction { foreach ($this->getAllowedKeys() as $key) { - if (!array_key_exists($key, $params)) { - throw new InvalidArgumentException(sprintf( - '%s is missing parameter key %s!', - static::class, - $key - )); + if (array_key_exists($key, $params)) { + $this->set($key, $params[$key]); } - $this->set($key, $params[$key]); } return $this; } diff --git a/tests/AbstractFunctionTest.php b/tests/AbstractFunctionTest.php index a603dde..b2e01d1 100644 --- a/tests/AbstractFunctionTest.php +++ b/tests/AbstractFunctionTest.php @@ -535,12 +535,7 @@ public static function provideInvalidJson(): array . '"params":{"DbF6y6oE":"CLsVlAje"}}' ], ['7072.8'], - ['true'], - [ - '{"name":"gYcOqTNx",' - . '"api":[{"type":"string","name":"gixpbEZj","direction":"input","optional":false}],' - . '"params":{"8rszwVLE":"dUK6wkp0"}}' - ] + ['true'] ]; }