{"record":{"id":"1e7e04b6c3b44318","repo":"phalcon/cphalcon","slug":"the-source-of-event-must-be-an-object-got","errorCode":null,"errorMessage":"The source of {} event must be an object, got {}","messagePattern":"The source of (.+?) event must be an object, got (.+?)","errorType":"exception","errorClass":"InvalidEventSource","httpStatus":null,"severity":"error","filePath":"phalcon/Events/Event.zep","lineNumber":79,"sourceCode":"     * Event type\n     *\n     * @var string\n     */\n    protected type;\n\n    /**\n     * Phalcon\\Events\\Event constructor\n     *\n     * @param object source\n     */\n    public function __construct(\n        string type,\n        var source = null,\n        var data = null,\n        bool cancelable = true\n    ) {\n        if unlikely null !== source && typeof source !== \"object\" {\n            throw new InvalidEventSource(type, (typeof source));\n        }\n\n        let this->type       = type,\n            this->source     = source,\n            this->data       = data,\n            this->cancelable = cancelable;\n    }\n\n    public function getData() -> var\n    {\n        return this->data;\n    }\n\n    public function getSource() -> object | null\n    {\n        return this->source;\n    }\n","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Events/Event.zep#L61-L97","documentation":"Error \"The source of {} event must be an object, got {}\" thrown in phalcon/cphalcon.","triggerScenarios":"Thrown at phalcon/Events/Event.zep:79 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"}