{"record":{"id":"72fea4f06138b74e","repo":"nikic/PHP-Parser","slug":"multiple-access-type-modifiers-are-not-allowed","errorCode":null,"errorMessage":"Multiple access type modifiers are not allowed","messagePattern":"Multiple access type modifiers are not allowed","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"lib/PhpParser/Builder/TraitUseAdaptation.php","lineNumber":126,"sourceCode":"            $this->insteadof[] = BuilderHelpers::normalizeName($trait);\n        }\n\n        return $this;\n    }\n\n    protected function setModifier(int $modifier): void {\n        if ($this->type === self::TYPE_UNDEFINED) {\n            $this->type = self::TYPE_ALIAS;\n        }\n\n        if ($this->type !== self::TYPE_ALIAS) {\n            throw new \\LogicException('Cannot set access modifier for not alias adaptation buider');\n        }\n\n        if (is_null($this->modifier)) {\n            $this->modifier = $modifier;\n        } else {\n            throw new \\LogicException('Multiple access type modifiers are not allowed');\n        }\n    }\n\n    /**\n     * Returns the built node.\n     *\n     * @return Node The built node\n     */\n    public function getNode(): Node {\n        switch ($this->type) {\n            case self::TYPE_ALIAS:\n                return new Stmt\\TraitUseAdaptation\\Alias($this->trait, $this->method, $this->modifier, $this->alias);\n            case self::TYPE_PRECEDENCE:\n                return new Stmt\\TraitUseAdaptation\\Precedence($this->trait, $this->method, $this->insteadof);\n            default:\n                throw new \\LogicException('Type of adaptation is not defined');\n        }\n    }","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/nikic/PHP-Parser/blob/fbd47f7ebcbb450138d92642a0a53b72a5285dda/lib/PhpParser/Builder/TraitUseAdaptation.php#L108-L144","documentation":"Error \"Multiple access type modifiers are not allowed\" thrown in nikic/PHP-Parser.","triggerScenarios":"Thrown at lib/PhpParser/Builder/TraitUseAdaptation.php:126 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"}