public function dispatch($signalClassName, $signalName, array $signalArguments = [])
    {
        if (!isset($this->slots[$signalClassName][$signalName])) {
            return;
        }

        foreach ($this->slots[$signalClassName][$signalName] as $slotInformation) {
            $finalSignalArguments = $signalArguments;
            if (isset($slotInformation['object'])) {
                $object = $slotInformation['object'];
            } elseif (substr($slotInformation['method'], 0, 2) === '::') {
                if (!isset($this->objectManager)) {
                    if (is_callable($slotInformation['class'] . $slotInformation['method'])) {
                        $object = $slotInformation['class'];
                    } else {
                        throw new Exception\InvalidSlotException(sprintf('Cannot dispatch %s::%s to class %s. The object manager is not yet available in the Signal Slot Dispatcher and therefore it cannot dispatch classes.', $signalClassName, $signalName, $slotInformation['class']), 1298113624);
                    }
                } else {
                    $object = $this->objectManager->getClassNameByObjectName($slotInformation['class']);
                }
                $slotInformation['method'] = substr($slotInformation['method'], 2);
            } else {
                if (!isset($this->objectManager)) {
                    throw new Exception\InvalidSlotException(sprintf('Cannot dispatch %s::%s to class %s. The object manager is not yet available in the Signal Slot Dispatcher and therefore it cannot dispatch classes.', $signalClassName, $signalName, $slotInformation['class']), 1298113624);
                }
                if (!$this->objectManager->isRegistered($slotInformation['class'])) {
                    throw new Exception\InvalidSlotException('The given class "' . $slotInformation['class'] . '" is not a registered object.', 1245673367);
                }
                $object = $this->objectManager->get($slotInformation['class']);
            }
            if ($slotInformation['passSignalInformation'] === true) {
                $finalSignalArguments[] = $signalClassName . '::' . $signalName;
            }
            if (!method_exists($object, $slotInformation['method'])) {
                throw new Exception\InvalidSlotException('The slot method ' . get_class($object) . '->' . $slotInformation['method'] . '() does not exist.', 1245673368);
            }
            call_user_func_array([$object, $slotInformation['method']], $finalSignalArguments);
        }
    }
public function dispatch($signalClassName, $signalName, array $signalArguments = [])
    {
        if (!isset($this->slots[$signalClassName][$signalName])) {
            return;
        }

        foreach ($this->slots[$signalClassName][$signalName] as $slotInformation) {
            $finalSignalArguments = $signalArguments;
            if (isset($slotInformation['object'])) {
                $object = $slotInformation['object'];
            } elseif (substr($slotInformation['method'], 0, 2) === '::') {
                if (!isset($this->objectManager)) {
                    if (is_callable($slotInformation['class'] . $slotInformation['method'])) {
                        $object = $slotInformation['class'];
                    } else {
                        throw new Exception\InvalidSlotException(sprintf('Cannot dispatch %s::%s to class %s. The object manager is not yet available in the Signal Slot Dispatcher and therefore it cannot dispatch classes.', $signalClassName, $signalName, $slotInformation['class']), 1298113624);
                    }
                } else {
                    $object = $this->objectManager->getClassNameByObjectName($slotInformation['class']);
                }
                $slotInformation['method'] = substr($slotInformation['method'], 2);
            } else {
                if (!isset($this->objectManager)) {
                    throw new Exception\InvalidSlotException(sprintf('Cannot dispatch %s::%s to class %s. The object manager is not yet available in the Signal Slot Dispatcher and therefore it cannot dispatch classes.', $signalClassName, $signalName, $slotInformation['class']), 1298113624);
                }
                if (!$this->objectManager->isRegistered($slotInformation['class'])) {
                    throw new Exception\InvalidSlotException('The given class "' . $slotInformation['class'] . '" is not a registered object.', 1245673367);
                }
                $object = $this->objectManager->get($slotInformation['class']);
            }
            if ($slotInformation['passSignalInformation'] === true) {
                $finalSignalArguments[] = $signalClassName . '::' . $signalName;
            }
            if (!method_exists($object, $slotInformation['method'])) {
                throw new Exception\InvalidSlotException('The slot method ' . get_class($object) . '->' . $slotInformation['method'] . '() does not exist.', 1245673368);
            }
            call_user_func_array([$object, $slotInformation['method']], $finalSignalArguments);
        }
    }
public function dispatch ( $ signalClassName , $ signalName , array $ signalArguments = [ ] ) { if ( ! isset ( $ this -> slots [ $ signalClassName ] [ $ signalName ] ) ) { return ; } foreach ( $ this -> slots [ $ signalClassName ] [ $ signalName ] as $ slotInformation ) { $ finalSignalArguments = $ signalArguments ; if ( isset ( $ slotInformation [ 'object' ] ) ) { $ object = $ slotInformation [ 'object' ] ; } elseif ( substr ( $ slotInformation [ 'method' ] , 0 , 2 ) === '::' ) { if ( ! isset ( $ this -> objectManager ) ) { if ( is_callable ( $ slotInformation [ 'class' ] . $ slotInformation [ 'method' ] ) ) { $ object = $ slotInformation [ 'class' ] ; } else { throw new Exception \ InvalidSlotException ( sprintf ( 'Cannot dispatch %s::%s to class %s. The object manager is not yet available in the Signal Slot Dispatcher and therefore it cannot dispatch classes.' , $ signalClassName , $ signalName , $ slotInformation [ 'class' ] ) , 1298113624 ) ; } } else { $ object = $ this -> objectManager -> getClassNameByObjectName ( $ slotInformation [ 'class' ] ) ; } $ slotInformation [ 'method' ] = substr ( $ slotInformation [ 'method' ] , 2 ) ; } else { if ( ! isset ( $ this -> objectManager ) ) { throw new Exception \ InvalidSlotException ( sprintf ( 'Cannot dispatch %s::%s to class %s. The object manager is not yet available in the Signal Slot Dispatcher and therefore it cannot dispatch classes.' , $ signalClassName , $ signalName , $ slotInformation [ 'class' ] ) , 1298113624 ) ; } if ( ! $ this -> objectManager -> isRegistered ( $ slotInformation [ 'class' ] ) ) { throw new Exception \ InvalidSlotException ( 'The given class "' . $ slotInformation [ 'class' ] . '" is not a registered object.' , 1245673367 ) ; } $ object = $ this -> objectManager -> get ( $ slotInformation [ 'class' ] ) ; } if ( $ slotInformation [ 'passSignalInformation' ] === true ) { $ finalSignalArguments [ ] = $ signalClassName . '::' . $ signalName ; } if ( ! method_exists ( $ object , $ slotInformation [ 'method' ] ) ) { throw new Exception \ InvalidSlotException ( 'The slot method ' . get_class ( $ object ) . '->' . $ slotInformation [ 'method' ] . '() does not exist.' , 1245673368 ) ; } call_user_func_array ( [ $ object , $ slotInformation [ 'method' ] ] , $ finalSignalArguments ) ; } }
Dispatches a signal by calling the registered Slot methods

@param string $signalClassName Name of the class containing the signal
@param string $signalName Name of the signal
@param array $signalArguments arguments passed to the signal method
@return void
@throws Exception\InvalidSlotException if the slot is not valid
@api
Dispatches a signal by calling the registered Slot methods