Code Duplication    Length = 6-8 lines in 2 locations

src/EventSourcing/Common/EventSourcedAggregateRoot.php 2 locations

@@ 85-90 (lines=6) @@
82
        $reflectedClass = new \ReflectionClass(get_class($this));
83
        foreach ($reflectedClass->getProperties() as $property) {
84
            $propertyValue = $this->{$property->getName()};
85
            if (is_object($propertyValue)) {
86
                if (method_exists($propertyValue, $eventHandlerName)) {
87
                    $this->executeEventHandler($propertyValue, $eventHandlerName, $domainEventData);
88
                    $applied = true;
89
                }
90
            }
91
            if (is_array($propertyValue)) {
92
                foreach ($propertyValue as $item) {
93
                    if (method_exists($item, $eventHandlerName)) {
@@ 91-98 (lines=8) @@
88
                    $applied = true;
89
                }
90
            }
91
            if (is_array($propertyValue)) {
92
                foreach ($propertyValue as $item) {
93
                    if (method_exists($item, $eventHandlerName)) {
94
                        $this->executeEventHandler($item, $eventHandlerName, $domainEventData);
95
                        $applied = true;
96
                    }
97
                }
98
            }
99
        }
100
        if (!$applied) {
101
            throw DomainEventNotUnderstandableException::fromAggreagteAndEventTypes(