src/Contao/Dca/Builder/Legacy/LegacyDcaDataDefinitionBuilder.php
protected function parseCallback($dispatcher, $callbacks, $eventName, $arguments, $listener)
    {
        if (!(\is_array($callbacks) || \is_callable($callbacks))) {
            return;
        }

        // If only one callback given, ensure the loop below handles it correctly.
        if (\is_array($callbacks) && (2 === \count($callbacks)) && !\is_array($callbacks[0])) {
            $callbacks = [$callbacks];
        }
        foreach ((array) $callbacks as $callback) {
            if ($this->isCallbackBlacklisted($callback, $listener)) {
                continue;
            }

            $dispatcher->addListener(
                $eventName,
                new $listener($callback, $arguments)
            );
        }
    }
protected function parseCallback($dispatcher, $callbacks, $eventName, $arguments, $listener)
    {
        if (!(\is_array($callbacks) || \is_callable($callbacks))) {
            return;
        }

        // If only one callback given, ensure the loop below handles it correctly.
        if (\is_array($callbacks) && (2 === \count($callbacks)) && !\is_array($callbacks[0])) {
            $callbacks = [$callbacks];
        }
        foreach ((array) $callbacks as $callback) {
            if ($this->isCallbackBlacklisted($callback, $listener)) {
                continue;
            }

            $dispatcher->addListener(
                $eventName,
                new $listener($callback, $arguments)
            );
        }
    }
protected function parseCallback ( $ dispatcher , $ callbacks , $ eventName , $ arguments , $ listener ) { if ( ! ( \ is_array ( $ callbacks ) || \ is_callable ( $ callbacks ) ) ) { return ; } // If only one callback given, ensure the loop below handles it correctly. if ( \ is_array ( $ callbacks ) && ( 2 === \ count ( $ callbacks ) ) && ! \ is_array ( $ callbacks [ 0 ] ) ) { $ callbacks = [ $ callbacks ] ; } foreach ( ( array ) $ callbacks as $ callback ) { if ( $ this -> isCallbackBlacklisted ( $ callback , $ listener ) ) { continue ; } $ dispatcher -> addListener ( $ eventName , new $ listener ( $ callback , $ arguments ) ) ; } }
Register the callback handlers for the given legacy callbacks.

@param EventDispatcherInterface $dispatcher The event dispatcher.
@param array                    $callbacks  The callbacks to be handled.
@param string                   $eventName  The event to be registered to.
@param array                    $arguments  The arguments to pass to the constructor.
@param string                   $listener   The listener class to use.

@return void
Register the callback handlers for the given legacy callbacks .