FilterData::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 7
ccs 6
cts 6
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Module\FilterSetting\Find\Data;
4
5
/**
6
 * Filter chip data.
7
 */
8
class FilterData
9
{
10
    public string $name;
11
    public string $paramName;
12
    public ?string $paramValue;
13
    // Category is the title of the group of filters, e.g. "Status" or "User"
14
    public ?string $category;
15
    public bool $authorized;
16
17 2
    public function __construct(array $data)
18
    {
19 2
        $this->name = $data['name'] ?? null;
20 2
        $this->paramName = $data['paramName'] ?? null;
21 2
        $this->paramValue = $data['paramValue'] ?? null;
22 2
        $this->category = $data['category'] ?? null;
23 2
        $this->authorized = $data['authorized'] ?? null;
24
    }
25
}
26