Total Complexity | 7 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | #[ObjectType] |
||
14 | class User implements UserInterface, InterfacesAwareInterface, FieldsAwareInterface |
||
15 | { |
||
16 | public function __construct( |
||
17 | private readonly string $lastname, |
||
18 | private readonly string $firstname, |
||
19 | #[ObjectField] |
||
20 | private readonly string $middlename, |
||
21 | ) { |
||
22 | } |
||
23 | |||
24 | #[ObjectField] |
||
25 | public function getLastname(): string |
||
26 | { |
||
27 | return $this->lastname; |
||
28 | } |
||
29 | |||
30 | #[ObjectField] |
||
34 | } |
||
35 | |||
36 | #[ObjectField] |
||
37 | public function getDisplayName(): string |
||
38 | { |
||
39 | return sprintf('%1$s %2$.1s. %3$s', |
||
40 | $this->firstname, |
||
41 | $this->middlename, |
||
42 | $this->lastname, |
||
43 | ); |
||
44 | } |
||
45 | |||
46 | #[ObjectField(type: Pet::class)] |
||
47 | public function getPet(): string |
||
48 | { |
||
49 | return 'Cerberus'; |
||
50 | } |
||
51 | |||
52 | public function getInterfaces(): iterable |
||
56 | } |
||
57 | |||
58 | public function getFields(): iterable |
||
59 | { |
||
61 | } |
||
62 | } |
||
63 |