private function attachListeners(HasEmitterInterface $object, array $listeners)
    {
        $emitter = $object->getEmitter();
        foreach ($listeners as $el) {
            if ($el['once']) {
                $emitter->once($el['name'], $el['fn'], $el['priority']);
            } else {
                $emitter->on($el['name'], $el['fn'], $el['priority']);
            }
        }
    }
private function attachListeners(HasEmitterInterface $object, array $listeners)
    {
        $emitter = $object->getEmitter();
        foreach ($listeners as $el) {
            if ($el['once']) {
                $emitter->once($el['name'], $el['fn'], $el['priority']);
            } else {
                $emitter->on($el['name'], $el['fn'], $el['priority']);
            }
        }
    }
private function attachListeners ( HasEmitterInterface $ object , array $ listeners ) { $ emitter = $ object -> getEmitter ( ) ; foreach ( $ listeners as $ el ) { if ( $ el [ 'once' ] ) { $ emitter -> once ( $ el [ 'name' ] , $ el [ 'fn' ] , $ el [ 'priority' ] ) ; } else { $ emitter -> on ( $ el [ 'name' ] , $ el [ 'fn' ] , $ el [ 'priority' ] ) ; } } }
Attaches event listeners and properly sets their priorities and whether
or not they are are only executed once.

@param HasEmitterInterface $object    Object that has the event emitter.
@param array               $listeners Array of hashes representing event
event listeners. Each item contains
"name", "fn", "priority", & "once".
Attaches event listeners and properly sets their priorities and whether or not they are are only executed once .