{"record":{"id":"b7cb9800aa39654b","repo":"nikic/PHP-Parser","slug":"unexpected-node-of-type-s","errorCode":null,"errorMessage":"Unexpected node of type \"%s\"","messagePattern":"Unexpected node of type \"(.+?)\"","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"lib/PhpParser/Builder/Trait_.php","lineNumber":51,"sourceCode":"     * Adds a statement.\n     *\n     * @param Stmt|PhpParser\\Builder $stmt The statement to add\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addStmt($stmt) {\n        $stmt = BuilderHelpers::normalizeNode($stmt);\n\n        if ($stmt instanceof Stmt\\Property) {\n            $this->properties[] = $stmt;\n        } elseif ($stmt instanceof Stmt\\ClassMethod) {\n            $this->methods[] = $stmt;\n        } elseif ($stmt instanceof Stmt\\TraitUse) {\n            $this->uses[] = $stmt;\n        } elseif ($stmt instanceof Stmt\\ClassConst) {\n            $this->constants[] = $stmt;\n        } else {\n            throw new \\LogicException(sprintf('Unexpected node of type \"%s\"', $stmt->getType()));\n        }\n\n        return $this;\n    }\n\n    /**\n     * Adds an attribute group.\n     *\n     * @param Node\\Attribute|Node\\AttributeGroup $attribute\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addAttribute($attribute) {\n        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);\n\n        return $this;\n    }\n","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/nikic/PHP-Parser/blob/fbd47f7ebcbb450138d92642a0a53b72a5285dda/lib/PhpParser/Builder/Trait_.php#L33-L69","documentation":"Error \"Unexpected node of type \"%s\"\" thrown in nikic/PHP-Parser.","triggerScenarios":"Thrown at lib/PhpParser/Builder/Trait_.php:51 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"}