public function persist(array $events)
    {
        $factory = new EventFactory();
        $events = array_map(
            function ($event) use ($factory) {
                return is_array($event) ? $factory->create($event) : $event;
            },
            $events
        );
        $this->persister()->logEvents($events);
    }
public function persist(array $events)
    {
        $factory = new EventFactory();
        $events = array_map(
            function ($event) use ($factory) {
                return is_array($event) ? $factory->create($event) : $event;
            },
            $events
        );
        $this->persister()->logEvents($events);
    }
public function persist ( array $ events ) { $ factory = new EventFactory ( ) ; $ events = array_map ( function ( $ event ) use ( $ factory ) { return is_array ( $ event ) ? $ factory -> create ( $ event ) : $ event ; } , $ events ) ; $ this -> persister ( ) -> logEvents ( $ events ) ; }
Persists a list of event logs represented in arrays
or that actually are instances of EventInterface.

@param array $events The events to persist
@return void
Persists a list of event logs represented in arrays or that actually are instances of EventInterface .