Code Duplication    Length = 12-12 lines in 5 locations

PHPDaemon/Clients/AMQP/Driver/Protocol/v091/Parser/MethodFrameParserTrait.php 5 locations

@@ 93-104 (lines=12) @@
90
91
                // method "connection.open-ok"
92
            }
93
            if ($method === 41) {
94
                $frame = new Connection\ConnectionOpenOkFrame();
95
96
                // consume "known-hosts" (shortstr)
97
                $length = \ord($this->buffer);
98
                $frame->knownHosts = mb_orig_substr($this->buffer, 1, $length);
99
                $this->buffer = mb_orig_substr($this->buffer, 1 + $length);
100
101
                return $frame;
102
103
                // method "connection.close"
104
            }
105
            if ($method === 50) {
106
                $frame = new Connection\ConnectionCloseFrame();
107
@@ 133-144 (lines=12) @@
130
131
                // method "connection.blocked"
132
            }
133
            if ($method === 60) {
134
                $frame = new Connection\ConnectionBlockedFrame();
135
136
                // consume "reason" (shortstr)
137
                $length = \ord($this->buffer);
138
                $frame->reason = mb_orig_substr($this->buffer, 1, $length);
139
                $this->buffer = mb_orig_substr($this->buffer, 1 + $length);
140
141
                return $frame;
142
143
                // method "connection.unblocked"
144
            }
145
            if ($method === 61) {
146
                return new Connection\ConnectionUnblockedFrame();
147
            }
@@ 334-345 (lines=12) @@
331
332
                // method "basic.consume-ok"
333
            }
334
            if ($method === 21) {
335
                $frame = new Basic\BasicConsumeOkFrame();
336
337
                // consume "consumer-tag" (shortstr)
338
                $length = \ord($this->buffer);
339
                $frame->consumerTag = mb_orig_substr($this->buffer, 1, $length);
340
                $this->buffer = mb_orig_substr($this->buffer, 1 + $length);
341
342
                return $frame;
343
344
                // method "basic.cancel-ok"
345
            }
346
            if ($method === 31) {
347
                $frame = new Basic\BasicCancelOkFrame();
348
@@ 346-357 (lines=12) @@
343
344
                // method "basic.cancel-ok"
345
            }
346
            if ($method === 31) {
347
                $frame = new Basic\BasicCancelOkFrame();
348
349
                // consume "consumer-tag" (shortstr)
350
                $length = \ord($this->buffer);
351
                $frame->consumerTag = mb_orig_substr($this->buffer, 1, $length);
352
                $this->buffer = mb_orig_substr($this->buffer, 1 + $length);
353
354
                return $frame;
355
356
                // method "basic.return"
357
            }
358
            if ($method === 50) {
359
                $frame = new Basic\BasicReturnFrame();
360
@@ 443-454 (lines=12) @@
440
441
                // method "basic.get-empty"
442
            }
443
            if ($method === 72) {
444
                $frame = new Basic\BasicGetEmptyFrame();
445
446
                // consume "cluster-id" (shortstr)
447
                $length = \ord($this->buffer);
448
                $frame->clusterId = mb_orig_substr($this->buffer, 1, $length);
449
                $this->buffer = mb_orig_substr($this->buffer, 1 + $length);
450
451
                return $frame;
452
453
                // method "basic.ack"
454
            }
455
            if ($method === 80) {
456
                $frame = new Basic\BasicAckFrame();
457