protected function mergeEvents($events) {
        $result = array();
        foreach ($events as $event) {
            /* @var $event \ManiaScript\Builder\Event\Custom */
            if ($event->getInline()) {
                $code = $event->getCode() . PHP_EOL;
            } else {
                $code = $this->buildHandlerFunctionCall($event) . PHP_EOL;
            }
            if (!isset($result[$event->getName()])) {
                 $result[$event->getName()] = '';
            }
            $result[$event->getName()] .= $code;
        }
        return $result;
    }
protected function mergeEvents($events) {
        $result = array();
        foreach ($events as $event) {
            /* @var $event \ManiaScript\Builder\Event\Custom */
            if ($event->getInline()) {
                $code = $event->getCode() . PHP_EOL;
            } else {
                $code = $this->buildHandlerFunctionCall($event) . PHP_EOL;
            }
            if (!isset($result[$event->getName()])) {
                 $result[$event->getName()] = '';
            }
            $result[$event->getName()] .= $code;
        }
        return $result;
    }
protected function mergeEvents ( $ events ) { $ result = array ( ) ; foreach ( $ events as $ event ) { /* @var $event \ManiaScript\Builder\Event\Custom */ if ( $ event -> getInline ( ) ) { $ code = $ event -> getCode ( ) . PHP_EOL ; } else { $ code = $ this -> buildHandlerFunctionCall ( $ event ) . PHP_EOL ; } if ( ! isset ( $ result [ $ event -> getName ( ) ] ) ) { $ result [ $ event -> getName ( ) ] = '' ; } $ result [ $ event -> getName ( ) ] .= $ code ; } return $ result ; }
Merges the handling codes of events with the same name.
@param \Traversable|array $events The events to merge.
@return array The merged events.
Merges the handling codes of events with the same name .