Code Duplication    Length = 13-13 lines in 4 locations

src/Channel/ChannelComposite.php 2 locations

@@ 339-351 (lines=13) @@
336
     * @override
337
     * @inheritDoc
338
     */
339
    public function sendAsync($name, $message, $flags = Channel::MODE_DEFAULT)
340
    {
341
        $message = $this->createMessageProtocol($message);
342
343
        $names = (array) $name;
344
        $status = [];
345
        foreach ($names as $name)
346
        {
347
            $status[] = $this->handleSendAsync($name, $message, $flags);
348
        }
349
350
        return !isset($status[0]) || isset($status[1]) ? $status : $status[0];
351
    }
352
353
    /**
354
     * @override
@@ 357-369 (lines=13) @@
354
     * @override
355
     * @inheritDoc
356
     */
357
    public function pushAsync($name, $message, $flags = Channel::MODE_DEFAULT)
358
    {
359
        $message = $this->createMessageProtocol($message);
360
361
        $names = (array) $name;
362
        $status = [];
363
        foreach ($names as $name)
364
        {
365
            $status[] = $this->handlePushAsync($name, $message, $flags);
366
        }
367
368
        return !isset($status[0]) || isset($status[1]) ? $status : $status[0];
369
    }
370
371
    /**
372
     * @override

src/Channel/Channel.php 2 locations

@@ 354-366 (lines=13) @@
351
     * @override
352
     * @inheritDoc
353
     */
354
    public function sendAsync($name, $message, $flags = Channel::MODE_DEFAULT)
355
    {
356
        $protocol = $this->createMessageProtocol($message);
357
        $names = (array) $name;
358
        $handlers = [];
359
360
        foreach ($names as $name)
361
        {
362
            $handlers[] = $this->handleSendAsync($name, $protocol, $flags);
363
        }
364
365
        return !isset($handlers[0]) || isset($handlers[1]) ? $handlers : $handlers[0];
366
    }
367
368
    /**
369
     * @override
@@ 372-384 (lines=13) @@
369
     * @override
370
     * @inheritDoc
371
     */
372
    public function pushAsync($name, $message, $flags = Channel::MODE_DEFAULT)
373
    {
374
        $protocol = $this->createMessageProtocol($message);
375
        $names = (array) $name;
376
        $handlers = [];
377
378
        foreach ($names as $name)
379
        {
380
            $handlers[] = $this->handlePushAsync($name, $protocol, $flags);
381
        }
382
383
        return !isset($handlers[0]) || isset($handlers[1]) ? $handlers : $handlers[0];
384
    }
385
386
    /**
387
     * @override