{"record":{"id":"e9604014201ce62f","repo":"phalcon/cphalcon","slug":"alias-name-must-be-a-string","errorCode":null,"errorMessage":"Alias name must be a string","messagePattern":"Alias name must be a string","errorType":"exception","errorClass":"Phalcon\\Di\\Exceptions\\AliasNameMustBeString","httpStatus":null,"severity":"error","filePath":"phalcon/Di/Di.zep","lineNumber":670,"sourceCode":"     * @throws Exception\n     */\n    public function setAlias(string name, var aliases) -> <self>\n    {\n        var alias, currentAliases, localAliases;\n\n        if (true !== this->has(name)) {\n            throw Exception::serviceNotFound(name);\n        }\n\n        let currentAliases = this->aliases;\n        let localAliases   = aliases;\n        if (typeof localAliases !== \"array\") {\n            let localAliases = [localAliases];\n        }\n\n        for alias in localAliases {\n            if (typeof alias !== \"string\") {\n                throw new AliasNameMustBeString();\n            }\n\n            if (true === isset(currentAliases[alias]) || true === this->has(alias)) {\n                throw new AliasAlreadyInUse(alias);\n            }\n\n            let currentAliases[alias] = name;\n        }\n\n        let this->aliases = currentAliases;\n\n        return this;\n    }\n\n    /**\n     * Set a default dependency injection container to be obtained into static\n     * methods\n     */","sourceCodeStart":652,"sourceCodeEnd":688,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Di/Di.zep#L652-L688","documentation":"Error \"Alias name must be a string\" thrown in phalcon/cphalcon.","triggerScenarios":"Thrown at phalcon/Di/Di.zep:670 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":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}