Completed
Push — master ( 3977d8...7ec8b3 )
by David
15s queued 11s
created

ContactController::getContactsIterator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
4
namespace TheCodingMachine\GraphQL\Controllers\Fixtures\Integration\Controllers;
5
6
7
use Porpaginas\Arrays\ArrayResult;
8
use Psr\Http\Message\UploadedFileInterface;
9
use TheCodingMachine\GraphQL\Controllers\Annotations\Mutation;
10
use TheCodingMachine\GraphQL\Controllers\Annotations\Query;
11
use TheCodingMachine\GraphQL\Controllers\Fixtures\Integration\Models\Contact;
12
use TheCodingMachine\GraphQL\Controllers\Fixtures\Integration\Models\User;
13
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
43
    {
44
        return new ArrayResult([
0 ignored issues
show
Bug Best Practice introduced by
The expression return new Porpaginas\Ar..., '[email protected]'))) returns the type Porpaginas\Arrays\ArrayResult which is incompatible with the documented return type TheCodingMachine\GraphQL...ration\Models\Contact[].
Loading history...
45
            new Contact('Joe'),
46
            new User('Bill', '[email protected]'),
47
        ]);
48
    }
49
}
50