User   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 26
c 1
b 0
f 0
dl 0
loc 37
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A casts() 0 12 1
1
<?php
2
3
namespace TestSetup\Models;
4
5
use LaravelFreelancerNL\Aranguent\Eloquent\Casts\AsArrayObject;
6
use LaravelFreelancerNL\Aranguent\Eloquent\Casts\AsCollection;
7
use LaravelFreelancerNL\Aranguent\Eloquent\Casts\AsEnumArrayObject;
8
use LaravelFreelancerNL\Aranguent\Eloquent\Casts\AsEnumCollection;
9
use TestSetup\Enums\UserStatus;
10
11
class User extends \LaravelFreelancerNL\Aranguent\Auth\User
12
{
13
    protected $table = 'users';
14
15
    protected $fillable = [
16
        'email',
17
        'password',
18
        'username',
19
        'uuid',
20
        'is_admin',
21
        'profileAsArray',
22
        'profileAsArrayObjectCast',
23
        'profileAsObject',
24
        'profileAsJson',
25
        'favoritesCollection',
26
        'favoritesAsCollectionCast',
27
        'statusesAsEnumArrayObject',
28
        'statusesAsEnumCollection',
29
    ];
30
31
    /**
32
     * Get the attributes that should be cast.
33
     *
34
     * @return array<string, string>
35
     */
36
    protected function casts(): array
37
    {
38
        return [
39
            'is_admin' => 'boolean',
40
            'profileAsArray' => 'array',
41
            'profileAsArrayObjectCast' => AsArrayObject::class,
42
            'profileAsObject' => 'object',
43
            'profileAsJson' => 'json',
44
            'favoritesCollection' => 'collection',
45
            'favoritesAsCollectionCast' => AsCollection::class,
46
            'statusesAsEnumArrayObject' => AsEnumArrayObject::of(UserStatus::class),
47
            'statusesAsEnumCollection' => AsEnumCollection::of(UserStatus::class),
48
        ];
49
    }
50
}
51