{"record":{"id":"92aa54fbc3a910ad","repo":"Seldaek/monolog","slug":"expected-the-first-arg-to-be-a-string-got-meth","errorCode":null,"errorMessage":"Expected the first arg to be a string, got: ${method}","messagePattern":"Expected the first arg to be a string, got: (.+?)","errorType":"exception","errorClass":"UnexpectedValueException","httpStatus":null,"severity":"error","filePath":"src/Monolog/Handler/BrowserConsoleHandler.php","lineNumber":287,"sourceCode":"            $script[] = self::call('log', self::quote('%s: %o'), self::quote((string) $key), $value);\n        }\n\n        return $script;\n    }\n\n    private static function quote(string $arg): string\n    {\n        return '\"' . addcslashes($arg, \"\\\"\\n\\\\\") . '\"';\n    }\n\n    /**\n     * @param mixed $args\n     */\n    private static function call(...$args): string\n    {\n        $method = array_shift($args);\n        if (!\\is_string($method)) {\n            throw new \\UnexpectedValueException('Expected the first arg to be a string, got: '.var_export($method, true));\n        }\n\n        return self::call_array($method, $args);\n    }\n\n    /**\n     * @param mixed[] $args\n     */\n    private static function call_array(string $method, array $args): string\n    {\n        return 'c.' . $method . '(' . implode(', ', $args) . ');';\n    }\n}\n","sourceCodeStart":269,"sourceCodeEnd":301,"githubUrl":"https://github.com/Seldaek/monolog/blob/57eb1028342134e701e77c617565d51b6e5a2a53/src/Monolog/Handler/BrowserConsoleHandler.php#L269-L301","documentation":"Error \"Expected the first arg to be a string, got: ${method}\" thrown in Seldaek/monolog.","triggerScenarios":"Thrown at src/Monolog/Handler/BrowserConsoleHandler.php:287 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"57eb1028342134e701e77c617565d51b6e5a2a53","analyzedAt":"2026-08-17T02:36:30.259Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}