{"record":{"id":"b493346cef0edef4","repo":"phalcon/cphalcon","slug":"the-message-must-be-an-instance-of-messageinterfac","errorCode":null,"errorMessage":"The message must be an instance of MessageInterface","messagePattern":"The message must be an instance of MessageInterface","errorType":"exception","errorClass":"Phalcon\\Messages\\Exceptions\\MessageNotObject","httpStatus":null,"severity":"error","filePath":"phalcon/Messages/Traits/MessagesHelperTrait.zep","lineNumber":111,"sourceCode":"            return message;\n        }\n\n        return null;\n    }\n\n    /**\n     * Sets an attribute using the array-syntax\n     *\n     *```php\n     * $messages[0] = new \\Phalcon\\Messages\\Message(\"This is a message\");\n     *```\n     *\n     * @throws MessageNotObject\n     */\n    public function offsetSet(mixed offset, var value) -> void\n    {\n        if typeof value !== \"object\" || !(value instanceof MessageInterface) {\n            throw new MessageNotObject();\n        }\n\n        if (offset === null) {\n            let this->messages[] = value;\n        } else {\n            let this->messages[offset] = value;\n        }\n    }\n\n    /**\n     * Removes a message from the list\n     *\n     *```php\n     * unset($message[\"database\"]);\n     *```\n     */\n    public function offsetUnset(mixed offset) -> void\n    {","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Messages/Traits/MessagesHelperTrait.zep#L93-L129","documentation":"Error \"The message must be an instance of MessageInterface\" thrown in phalcon/cphalcon.","triggerScenarios":"Thrown at phalcon/Messages/Traits/MessagesHelperTrait.zep:111 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"}