private function eventIsFound(DomainEvent $targetEvent, DomainEvents $realEvents)
    {
        $found = $realEvents->filter(function ($realEvent) use ($targetEvent) {
            try {
                $eventsAreEqual = $this->eventsAreEqual($realEvent, $targetEvent);
            } catch (FailureException $e) {
                $eventsAreEqual = false;
            }
            return $eventsAreEqual;
        });

        return $found->count() != 0;
    }
private function eventIsFound(DomainEvent $targetEvent, DomainEvents $realEvents)
    {
        $found = $realEvents->filter(function ($realEvent) use ($targetEvent) {
            try {
                $eventsAreEqual = $this->eventsAreEqual($realEvent, $targetEvent);
            } catch (FailureException $e) {
                $eventsAreEqual = false;
            }
            return $eventsAreEqual;
        });

        return $found->count() != 0;
    }
private function eventIsFound ( DomainEvent $ targetEvent , DomainEvents $ realEvents ) { $ found = $ realEvents -> filter ( function ( $ realEvent ) use ( $ targetEvent ) { try { $ eventsAreEqual = $ this -> eventsAreEqual ( $ realEvent , $ targetEvent ) ; } catch ( FailureException $ e ) { $ eventsAreEqual = false ; } return $ eventsAreEqual ; } ) ; return $ found -> count ( ) != 0 ; }
returns true if an event is found
returns true if an event is found