Code Duplication    Length = 16-16 lines in 2 locations

src/EventStore/DBALEventStore/DBALEventStore.php 1 location

@@ 60-75 (lines=16) @@
57
     * @param string $key
58
     * @param array  $events
59
     */
60
    public function store($key, array $events)
61
    {
62
        try {
63
            $this->startTransaction();
64
65
            foreach ($events as $event) {
66
                $this->persistEvent($key, $event);
67
            }
68
        } catch (InvalidEventException $invalidEventException) {
69
            $this->abortTransaction();
70
71
            throw $invalidEventException;
72
        }
73
74
        $this->completeTransaction();
75
    }
76
77
    /**
78
     * @param string $key

src/EventStore/InMemoryEventStore/InMemoryEventStore.php 1 location

@@ 85-100 (lines=16) @@
82
     * @throws TransactionAlreadyInProgressException
83
     * @throws InvalidEventException
84
     */
85
    public function store($key, array $events)
86
    {
87
        try {
88
            $this->startTransaction();
89
90
            foreach ($events as $event) {
91
                $this->persistEvent($key, $event);
92
            }
93
        } catch (InvalidEventException $invalidEventException) {
94
            $this->abortTransaction();
95
96
            throw $invalidEventException;
97
        }
98
99
        $this->completeTransaction();
100
    }
101
102
    /**
103
     * @throws TransactionAlreadyInProgressException