User::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Igorsgm\Ghost\Models\Resources;
4
5
/**
6
 * Class User
7
 *
8
 * @property-read string $id
9
 * @property-read string $name
10
 * @property-read string $slug
11
 * @property-read string $email
12
 * @property-read string $profileImage
13
 * @property-read string $coverImage
14
 * @property-read string $bio
15
 * @property-read string $website
16
 * @property-read string $location
17
 * @property-read string $facebook
18
 * @property-read string $twitter
19
 * @property-read string $accessibility
20
 * @property-read string $tour
21
 * @property-read string $lastSeen
22
 * @property-read string $url
23
 * @property-read string $createdAt
24
 * @property-read string $updatedAt
25
 * @property-read \Illuminate\Support\Collection $roles
26
 * @property-read int $postsCount
27
 */
28
class User extends BaseResource
29
{
30
    protected string $resourceName = 'users';
31
32 34
    public function __construct(array $data = [])
33
    {
34 34
        parent::__construct($data);
35 34
        $this->postsCount = data_get($data, 'count.posts');
0 ignored issues
show
Bug introduced by
The property postsCount is declared read-only in Igorsgm\Ghost\Models\Resources\User.
Loading history...
36
    }
37
}
38