Code Duplication    Length = 6-8 lines in 2 locations

src/EventSourcing/Common/EventSourcedAggregateRoot.php 2 locations

@@ 73-78 (lines=6) @@
70
        $reflectedClass = new \ReflectionClass(get_class($this));
71
        foreach ($reflectedClass->getProperties() as $property) {
72
            $propertyValue = $this->{$property->getName()};
73
            if (is_object($propertyValue)) {
74
                if (method_exists($propertyValue, $eventHandlerName)) {
75
                    $this->executeEventHandler($propertyValue, $eventHandlerName, $domainEventData);
76
                    $applied = true;
77
                }
78
            }
79
            if (is_array($propertyValue)) {
80
                foreach ($propertyValue as $item) {
81
                    if (method_exists($item, $eventHandlerName)) {
@@ 79-86 (lines=8) @@
76
                    $applied = true;
77
                }
78
            }
79
            if (is_array($propertyValue)) {
80
                foreach ($propertyValue as $item) {
81
                    if (method_exists($item, $eventHandlerName)) {
82
                        $this->executeEventHandler($item, $eventHandlerName, $domainEventData);
83
                        $applied = true;
84
                    }
85
                }
86
            }
87
        }
88
        if (!$applied) {
89
            throw DomainEventNotUnderstandableException::fromAggreagteAndEventTypes(