{"record":{"id":"b0f2a6ba5893c2a6","repo":"nikic/PHP-Parser","slug":"expected-string-or-instance-of-node-identifier","errorCode":null,"errorMessage":"Expected string or instance of Node\\Identifier","messagePattern":"Expected string or instance of Node\\\\Identifier","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"lib/PhpParser/BuilderHelpers.php","lineNumber":77,"sourceCode":"    }\n\n    /**\n     * Normalizes strings to Identifier.\n     *\n     * @param string|Identifier $name The identifier to normalize\n     *\n     * @return Identifier The normalized identifier\n     */\n    public static function normalizeIdentifier($name): Identifier {\n        if ($name instanceof Identifier) {\n            return $name;\n        }\n\n        if (\\is_string($name)) {\n            return new Identifier($name);\n        }\n\n        throw new \\LogicException('Expected string or instance of Node\\Identifier');\n    }\n\n    /**\n     * Normalizes strings to Identifier, also allowing expressions.\n     *\n     * @param string|Identifier|Expr $name The identifier to normalize\n     *\n     * @return Identifier|Expr The normalized identifier or expression\n     */\n    public static function normalizeIdentifierOrExpr($name) {\n        if ($name instanceof Identifier || $name instanceof Expr) {\n            return $name;\n        }\n\n        if (\\is_string($name)) {\n            return new Identifier($name);\n        }\n","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/nikic/PHP-Parser/blob/fbd47f7ebcbb450138d92642a0a53b72a5285dda/lib/PhpParser/BuilderHelpers.php#L59-L95","documentation":"Error \"Expected string or instance of Node\\Identifier\" thrown in nikic/PHP-Parser.","triggerScenarios":"Thrown at lib/PhpParser/BuilderHelpers.php:77 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":"fbd47f7ebcbb450138d92642a0a53b72a5285dda","analyzedAt":"2026-08-17T03:58:32.123Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}