{"record":{"id":"502d4fcbc2ab2c71","repo":"nikic/PHP-Parser","slug":"expected-string-or-instance-of-node-identifier-or","errorCode":null,"errorMessage":"Expected string or instance of Node\\Identifier or Node\\Expr","messagePattern":"Expected string or instance of Node\\\\Identifier or Node\\\\Expr","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"lib/PhpParser/BuilderHelpers.php","lineNumber":96,"sourceCode":"    }\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\n        throw new \\LogicException('Expected string or instance of Node\\Identifier or Node\\Expr');\n    }\n\n    /**\n     * Normalizes a name: Converts string names to Name nodes.\n     *\n     * @param Name|string $name The name to normalize\n     *\n     * @return Name The normalized name\n     */\n    public static function normalizeName($name): Name {\n        if ($name instanceof Name) {\n            return $name;\n        }\n\n        if (is_string($name)) {\n            if (!$name) {\n                throw new \\LogicException('Name cannot be empty');\n            }","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/nikic/PHP-Parser/blob/fbd47f7ebcbb450138d92642a0a53b72a5285dda/lib/PhpParser/BuilderHelpers.php#L78-L114","documentation":"Error \"Expected string or instance of Node\\Identifier or Node\\Expr\" thrown in nikic/PHP-Parser.","triggerScenarios":"Thrown at lib/PhpParser/BuilderHelpers.php:96 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"}