{"record":{"id":"a6d5f23cda77d75a","repo":"phalcon/cphalcon","slug":"event-handler-must-be-an-object-or-callable","errorCode":null,"errorMessage":"Event handler must be an Object or Callable","messagePattern":"Event handler must be an Object or Callable","errorType":"exception","errorClass":"InvalidEventHandler","httpStatus":null,"severity":"error","filePath":"phalcon/Events/Manager.zep","lineNumber":243,"sourceCode":"                // Invokable object - generic callable.\n                let type = 3;\n            } else {\n                // Plain object - method named after the event. Capture\n                // the class name once at attach time so fireQueue() can\n                // skip get_class() per fire (type=2 tuples carry it).\n                this->insertHandlerEntry(\n                    eventType,\n                    handler,\n                    2,\n                    priority,\n                    get_class(handler)\n                );\n                return;\n            }\n        } elseif is_callable(handler) {\n            let type = 3;\n        } else {\n            throw new InvalidEventHandler();\n        }\n\n        this->insertHandlerEntry(eventType, handler, type, priority);\n    }\n\n    /**\n     * Returns if priorities are enabled\n     */\n    public function arePrioritiesEnabled() -> bool\n    {\n        return this->enablePriorities;\n    }\n\n    /**\n     * Removes every registered subscriber and detaches each listener they\n     * contributed. Listeners attached via attach() are untouched.\n     *\n     * Iterates a snapshot of `subscribers` so removeSubscriber() can safely","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Events/Manager.zep#L225-L261","documentation":"Error \"Event handler must be an Object or Callable\" thrown in phalcon/cphalcon.","triggerScenarios":"Thrown at phalcon/Events/Manager.zep:243 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"}