src/Leevel/Event/Observer.php
public function update(SplSubject $subject): void
    {
        if (method_exists($this, 'handle')) {
            $handle = [$this, 'handle'];
        } elseif ($this->handle) {
            $handle = [$this, '__invoke'];
        } else {
            $handle = null;
        }

        if (!is_callable($handle)) {
            throw new InvalidArgumentException(
                sprintf('Observer %s must has handle method.', get_class($this))
            );
        }

        $subject->container->call($handle, $subject->notifyArgs);
    }
public function update(SplSubject $subject): void
    {
        if (method_exists($this, 'handle')) {
            $handle = [$this, 'handle'];
        } elseif ($this->handle) {
            $handle = [$this, '__invoke'];
        } else {
            $handle = null;
        }

        if (!is_callable($handle)) {
            throw new InvalidArgumentException(
                sprintf('Observer %s must has handle method.', get_class($this))
            );
        }

        $subject->container->call($handle, $subject->notifyArgs);
    }
{@inheritdoc}