ConsumeConfig::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Kunnu\RabbitMQ;
4
5
use Illuminate\Support\Collection;
6
7
class ConsumeConfig extends Collection
8
{
9
    /**
10
     * Connection Configuration.
11
     *
12
     * @var ConnectionConfig|null
13
     */
14
    protected ?ConnectionConfig $connectionConfig;
15
16
    /**
17
     * Create a new ConsumeConfig instance.
18
     *
19
     * @param  array  $config
20
     * @param  ConnectionConfig|null  $connectionConfig
21
     */
22
    public function __construct(array $config = [], ?ConnectionConfig $connectionConfig = null)
23
    {
24
        parent::__construct($config);
0 ignored issues
show
Bug introduced by
$config of type array is incompatible with the type Illuminate\Contracts\Support\Arrayable expected by parameter $items of Illuminate\Support\Collection::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

24
        parent::__construct(/** @scrutinizer ignore-type */ $config);
Loading history...
25
        $this->connectionConfig = $connectionConfig;
26
    }
27
28
    /**
29
     * Get connection config.
30
     *
31
     * @return ConnectionConfig|null
32
     */
33
    public function getConnectionConfig(): ?ConnectionConfig
34
    {
35
        return $this->connectionConfig;
36
    }
37
}
38