phalcon/cphalcon · error · InvalidEventSource

The source of {} event must be an object, got {}

Error message

The source of {} event must be an object, got {}

What it means

Error "The source of {} event must be an object, got {}" thrown in phalcon/cphalcon.

Source

Thrown at phalcon/Events/Event.zep:79

     * Event type
     *
     * @var string
     */
    protected type;

    /**
     * Phalcon\Events\Event constructor
     *
     * @param object source
     */
    public function __construct(
        string type,
        var source = null,
        var data = null,
        bool cancelable = true
    ) {
        if unlikely null !== source && typeof source !== "object" {
            throw new InvalidEventSource(type, (typeof source));
        }

        let this->type       = type,
            this->source     = source,
            this->data       = data,
            this->cancelable = cancelable;
    }

    public function getData() -> var
    {
        return this->data;
    }

    public function getSource() -> object | null
    {
        return this->source;
    }

View on GitHub (pinned to b7419de9cd)

When it happens

Trigger: Thrown at phalcon/Events/Event.zep:79 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phalcon/cphalcon@b7419de9cd (2026-08-21). Data as JSON: /api/errors/1e7e04b6c3b44318. Report an issue: GitHub.