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

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