Completed
Push — master ( 37a451...0fec48 )
by Artem
01:36
created

BroadcastCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 30
rs 10
c 0
b 0
f 0
1
<?php
2
/*
3
 * This file is part of the FreshCentrifugoBundle.
4
 *
5
 * (c) Artem Henvald <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace Fresh\CentrifugoBundle\Model;
14
15
/**
16
 * BroadcastCommand.
17
 *
18
 * @author Artem Henvald <[email protected]>
19
 */
20
final class BroadcastCommand extends AbstractCommand
21
{
22
    /** @var string[] */
23
    private array $channels;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_ARRAY, expecting T_FUNCTION or T_CONST
Loading history...
24
25
    /**
26
     * @param array    $data
27
     * @param string[] $channels
28
     */
29
    public function __construct(array $data, array $channels)
30
    {
31
        $this->channels = $channels;
32
33
        parent::__construct(
34
            Method::BROADCAST,
35
            [
36
                'channels' => $channels,
37
                'data' => $data,
38
            ]
39
        );
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function getChannels(): iterable
46
    {
47
        return $this->channels;
48
    }
49
}
50