Code Duplication    Length = 17-17 lines in 2 locations

src/Governor/Framework/Saga/Repository/Mongo/MongoSagaRepository.php 2 locations

@@ 157-173 (lines=17) @@
154
     * @param string $sagaType Type type of saga the association value belongs to
155
     * @param string $sagaIdentifier The saga related to the association value
156
     */
157
    protected function storeAssociationValue(
158
        AssociationValue $associationValue,
159
        $sagaType,
160
        $sagaIdentifier
161
    ) {
162
        $this->mongoTemplate->sagaCollection()->update(
163
            ['sagaIdentifier' => $sagaIdentifier, 'sagaType' => $sagaType],
164
            [
165
                '$push' => [
166
                    'associations' => [
167
                        'key' => $associationValue->getPropertyKey(),
168
                        'value' => $associationValue->getPropertyValue()
169
                    ]
170
                ]
171
            ]
172
        );
173
    }
174
175
    /**
176
     * Removes the association value that has been associated with Saga, identified with the given
@@ 183-199 (lines=17) @@
180
     * @param string $sagaType The type of the Saga to remove the association from
181
     * @param string $sagaIdentifier The identifier of the Saga to remove the association from
182
     */
183
    protected function removeAssociationValue(
184
        AssociationValue $associationValue,
185
        $sagaType,
186
        $sagaIdentifier
187
    ) {
188
        $this->mongoTemplate->sagaCollection()->update(
189
            ['sagaIdentifier' => $sagaIdentifier, 'sagaType' => $sagaType],
190
            [
191
                '$pull' => [
192
                    'associations' => [
193
                        'key' => $associationValue->getPropertyKey(),
194
                        'value' => $associationValue->getPropertyValue()
195
                    ]
196
                ]
197
            ]
198
        );
199
    }
200
201
    /**
202
     * Loads a known Saga instance by its unique identifier. Returned Sagas must be {@link #commit(Saga) committed}