{"record":{"id":"5ccea0465aaddcd7","repo":"moodle/moodle","slug":"merge-expects-1-or-more-arguments-0-were-provided","errorCode":null,"errorMessage":"merge() expects 1 or more arguments, 0 were provided","messagePattern":"merge\\(\\) expects 1 or more arguments, 0 were provided","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"public/lib/jmespath/src/FnDispatcher.php","lineNumber":258,"sourceCode":"        if ($type == 'number') {\n            return $value;\n        } elseif ($type == 'string' && is_numeric($value)) {\n            return mb_strpos($value, '.', 0, 'UTF-8') ? (float) $value : (int) $value;\n        } else {\n            return null;\n        }\n    }\n\n    private function fn_values(array $args)\n    {\n        $this->validate('values', $args, [['array', 'object']]);\n        return array_values((array) $args[0]);\n    }\n\n    private function fn_merge(array $args)\n    {\n        if (!$args) {\n            throw new \\RuntimeException(\n                \"merge() expects 1 or more arguments, 0 were provided\"\n            );\n        }\n\n        return call_user_func_array('array_replace', $args);\n    }\n\n    private function fn_to_array(array $args)\n    {\n        $this->validate('to_array', $args, [['any']]);\n\n        return Utils::isArray($args[0]) ? $args[0] : [$args[0]];\n    }\n\n    private function fn_map(array $args)\n    {\n        $this->validate('map', $args, [['expression'], ['any']]);\n        $result = [];","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/moodle/moodle/blob/48ea8c33227277e916cdd4079dbecef448b37f2c/public/lib/jmespath/src/FnDispatcher.php#L240-L276","documentation":"RuntimeException thrown by fn_merge() when the JMESPath merge() function is called with zero arguments — at least one object argument is required for merging to mean anything.","triggerScenarios":"Thrown at public/lib/jmespath/src/FnDispatcher.php:258 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the expression to pass one or more objects to merge()","Lint JMESPath expressions before running them"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"48ea8c33227277e916cdd4079dbecef448b37f2c","analyzedAt":"2026-09-14T20:34:48.527Z","contentChangedAt":"2026-09-14T20:34:48.527Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}