Code Duplication    Length = 16-16 lines in 4 locations

src/TreeHouse/Queue/Amqp/Driver/Amqp/Exchange.php 2 locations

@@ 199-214 (lines=16) @@
196
     *
197
     * @return int
198
     */
199
    public static function convertToDelegateFlags($flags = null)
200
    {
201
        if (null === $flags) {
202
            return AMQP_NOPARAM;
203
        }
204
205
        $converted = 0;
206
207
        foreach (self::$flagMap as $from => $to) {
208
            if ($flags & $from) {
209
                $converted |= $to;
210
            }
211
        }
212
213
        return $converted;
214
    }
215
216
    /**
217
     * @param int|null $flags
@@ 221-236 (lines=16) @@
218
     *
219
     * @return int
220
     */
221
    public static function convertFromDelegateFlags($flags = null)
222
    {
223
        if (null === $flags) {
224
            return self::NOPARAM;
225
        }
226
227
        $converted = 0;
228
229
        foreach (self::$flagMap as $from => $to) {
230
            if ($flags & $to) {
231
                $converted |= $from;
232
            }
233
        }
234
235
        return $converted;
236
    }
237
}
238

src/TreeHouse/Queue/Amqp/Driver/Amqp/Queue.php 2 locations

@@ 249-264 (lines=16) @@
246
     *
247
     * @return int
248
     */
249
    public static function convertToDelegateFlags($flags = null)
250
    {
251
        if (null === $flags) {
252
            return AMQP_NOPARAM;
253
        }
254
255
        $converted = 0;
256
257
        foreach (self::$flagMap as $from => $to) {
258
            if ($flags & $from) {
259
                $converted |= $to;
260
            }
261
        }
262
263
        return $converted;
264
    }
265
266
    /**
267
     * @param int|null $flags
@@ 271-286 (lines=16) @@
268
     *
269
     * @return int
270
     */
271
    public static function convertFromDelegateFlags($flags = null)
272
    {
273
        if (null === $flags) {
274
            return self::NOPARAM;
275
        }
276
277
        $converted = 0;
278
279
        foreach (self::$flagMap as $from => $to) {
280
            if ($flags & $to) {
281
                $converted |= $from;
282
            }
283
        }
284
285
        return $converted;
286
    }
287
}
288