{"record":{"id":"5bead9ea3d4c0f46","repo":"nikic/PHP-Parser","slug":"expected-node-or-builder-object","errorCode":null,"errorMessage":"Expected node or builder object","messagePattern":"Expected node or builder object","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"lib/PhpParser/BuilderHelpers.php","lineNumber":36,"sourceCode":" */\nfinal class BuilderHelpers {\n    /**\n     * Normalizes a node: Converts builder objects to nodes.\n     *\n     * @param Node|Builder $node The node to normalize\n     *\n     * @return Node The normalized node\n     */\n    public static function normalizeNode($node): Node {\n        if ($node instanceof Builder) {\n            return $node->getNode();\n        }\n\n        if ($node instanceof Node) {\n            return $node;\n        }\n\n        throw new \\LogicException('Expected node or builder object');\n    }\n\n    /**\n     * 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) {","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/nikic/PHP-Parser/blob/fbd47f7ebcbb450138d92642a0a53b72a5285dda/lib/PhpParser/BuilderHelpers.php#L18-L54","documentation":"Error \"Expected node or builder object\" thrown in nikic/PHP-Parser.","triggerScenarios":"Thrown at lib/PhpParser/BuilderHelpers.php:36 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"}