{"record":{"id":"3db2720908ce1e9c","repo":"nikic/PHP-Parser","slug":"expected-statement-or-expression-node","errorCode":null,"errorMessage":"Expected statement or expression node","messagePattern":"Expected statement or expression node","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"lib/PhpParser/BuilderHelpers.php","lineNumber":58,"sourceCode":"     * Normalizes a node to a statement.\n     *\n     * Expressions are wrapped in a Stmt\\Expression node.\n     *\n     * @param Node|Builder $node The node to normalize\n     *\n     * @return Stmt The normalized statement node\n     */\n    public static function normalizeStmt($node): Stmt {\n        $node = self::normalizeNode($node);\n        if ($node instanceof Stmt) {\n            return $node;\n        }\n\n        if ($node instanceof Expr) {\n            return new Stmt\\Expression($node);\n        }\n\n        throw new \\LogicException('Expected statement or expression node');\n    }\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","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/nikic/PHP-Parser/blob/fbd47f7ebcbb450138d92642a0a53b72a5285dda/lib/PhpParser/BuilderHelpers.php#L40-L76","documentation":"Error \"Expected statement or expression node\" thrown in nikic/PHP-Parser.","triggerScenarios":"Thrown at lib/PhpParser/BuilderHelpers.php:58 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"}