code/event/publisher/profiler.php
public function setDelegate($delegate)
    {
        if (!$delegate instanceof EventPublisherInterface) {
            throw new \InvalidArgumentException('Delegate: '.get_class($delegate).' does not implement EventPublisherInterface');
        }

        return parent::setDelegate($delegate);
    }
public function setDelegate($delegate)
    {
        if (!$delegate instanceof EventPublisherInterface) {
            throw new \InvalidArgumentException('Delegate: '.get_class($delegate).' does not implement EventPublisherInterface');
        }

        return parent::setDelegate($delegate);
    }
public function setDelegate ( $ delegate ) { if ( ! $ delegate instanceof EventPublisherInterface ) { throw new \ InvalidArgumentException ( 'Delegate: ' . get_class ( $ delegate ) . ' does not implement EventPublisherInterface' ) ; } return parent :: setDelegate ( $ delegate ) ; }
Set the decorated event publisher

@param   EventPublisherInterface $delegate The decorated event publisher
@return  EventPublisherProfiler
@throws  \InvalidArgumentException If the delegate is not an event publisher
Set the decorated event publisher