Total Complexity | 3 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
14 | class ContactController |
||
15 | { |
||
16 | /** |
||
17 | * @Query() |
||
18 | * @return Contact[] |
||
19 | */ |
||
20 | public function getContacts(): array |
||
21 | { |
||
22 | return [ |
||
23 | new Contact('Joe'), |
||
24 | new User('Bill', '[email protected]'), |
||
25 | ]; |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * @Mutation() |
||
30 | * @param Contact $contact |
||
31 | * @return Contact |
||
32 | */ |
||
33 | public function saveContact(Contact $contact): Contact |
||
34 | { |
||
35 | return $contact; |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * @Query() |
||
40 | * @return Contact[] |
||
41 | */ |
||
42 | public function getContactsIterator(): ArrayResult |
||
47 | ]); |
||
48 | } |
||
49 | } |
||
50 |