ClientListResult::jsonSerialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Module\Client\List\Data;
4
5
use App\Module\Client\Data\ClientData;
6
7
/**
8
 * Aggregate DTO to store ClientData combined with
9
 * client status and assigned user privileges.
10
 */
11
class ClientListResult extends ClientData
12
{
13
    public ?string $clientStatusPrivilege = null;
14
    public ?string $assignedUserPrivilege = null;
15
16 13
    public function __construct(array $clientResultData = [])
17
    {
18 13
        parent::__construct($clientResultData);
19
    }
20
21
    /**
22
     * Output for json_encode.
23
     */
24 12
    public function jsonSerialize(): array
25
    {
26 12
        return array_merge(parent::jsonSerialize(), [
27 12
            'clientStatusPrivilege' => $this->clientStatusPrivilege,
28 12
            'assignedUserPrivilege' => $this->assignedUserPrivilege,
29 12
        ]);
30
    }
31
}
32