Completed
Branch v2.0.0 (f654ea)
by Alexander
01:15
created

UserPresenter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A singleUserObject() 0 11 1
1
<?php
2
3
namespace Domain\User;
4
5
use stdClass;
6
7
class UserPresenter
8
{
9
    public static function singleUserObject(User $user): stdClass
10
    {
11
        $object = new stdClass();
12
13
        $object->id = $user->getId();
14
        $object->email = $user->getEmail();
15
        $object->name = $user->getName();
0 ignored issues
show
Bug introduced by
Consider using $user->name. There is an issue with getName() and APC-enabled PHP versions.
Loading history...
16
        $object->role = $user->getRole();
17
18
        return $object;
19
    }
20
}
21