Code Duplication    Length = 9-10 lines in 4 locations

PHPDaemon/Clients/AMQP/Driver/Protocol/v091/Serializer/FrameSerializerTrait.php 4 locations

@@ 152-161 (lines=10) @@
149
150
                return $this->packX01Payload($frame, $payload);
151
152
            case $frame instanceof Exchange\ExchangeBindFrame:
153
                $payload = "\x00\x28\x00\x1e"
154
                    . \pack('n', $frame->reserved1)
155
                    . $this->serializeShortString($frame->destination)
156
                    . $this->serializeShortString($frame->source)
157
                    . $this->serializeShortString($frame->routingKey)
158
                    . ($frame->nowait ? "\x01" : "\x00")
159
                    . $this->tableSerializer->serialize($frame->arguments);
160
161
                return $this->packX01Payload($frame, $payload);
162
163
            case $frame instanceof Exchange\ExchangeUnbindFrame:
164
                $payload = "\x00\x28\x00\x28"
@@ 163-172 (lines=10) @@
160
161
                return $this->packX01Payload($frame, $payload);
162
163
            case $frame instanceof Exchange\ExchangeUnbindFrame:
164
                $payload = "\x00\x28\x00\x28"
165
                    . \pack('n', $frame->reserved1)
166
                    . $this->serializeShortString($frame->destination)
167
                    . $this->serializeShortString($frame->source)
168
                    . $this->serializeShortString($frame->routingKey)
169
                    . ($frame->nowait ? "\x01" : "\x00")
170
                    . $this->tableSerializer->serialize($frame->arguments);
171
172
                return $this->packX01Payload($frame, $payload);
173
174
            case $frame instanceof Queue\QueueDeclareFrame:
175
                $payload = "\x00\x32\x00\x0a"
@@ 189-198 (lines=10) @@
186
187
                return $this->packX01Payload($frame, $payload);
188
189
            case $frame instanceof Queue\QueueBindFrame:
190
                $payload = "\x00\x32\x00\x14"
191
                    . \pack('n', $frame->reserved1)
192
                    . $this->serializeShortString($frame->queue)
193
                    . $this->serializeShortString($frame->exchange)
194
                    . $this->serializeShortString($frame->routingKey)
195
                    . ($frame->nowait ? "\x01" : "\x00")
196
                    . $this->tableSerializer->serialize($frame->arguments);
197
198
                return $this->packX01Payload($frame, $payload);
199
200
            case $frame instanceof Queue\QueuePurgeFrame:
201
                $payload = "\x00\x32\x00\x1e"
@@ 220-228 (lines=9) @@
217
218
                return $this->packX01Payload($frame, $payload);
219
220
            case $frame instanceof Queue\QueueUnbindFrame:
221
                $payload = "\x00\x32\x00\x32"
222
                    . \pack('n', $frame->reserved1)
223
                    . $this->serializeShortString($frame->queue)
224
                    . $this->serializeShortString($frame->exchange)
225
                    . $this->serializeShortString($frame->routingKey)
226
                    . $this->tableSerializer->serialize($frame->arguments);
227
228
                return $this->packX01Payload($frame, $payload);
229
230
            case $frame instanceof Basic\BasicHeaderFrame:
231
                $flags = 0;