Completed
Push — master ( dccc62...4cae74 )
by David
02:31 queued 39s
created

ContactType::customField()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
4
namespace TheCodingMachine\GraphQL\Controllers\Fixtures\Integration\Types;
5
6
use function strtoupper;
7
use TheCodingMachine\GraphQL\Controllers\Annotations\Field;
8
use TheCodingMachine\GraphQL\Controllers\Annotations\SourceField;
9
use TheCodingMachine\GraphQL\Controllers\Annotations\Type;
10
use TheCodingMachine\GraphQL\Controllers\Fixtures\Integration\Models\Contact;
11
12
/**
13
 * @Type(class=Contact::class)
14
 * @SourceField(name="name")
15
 * @SourceField(name="manager")
16
 */
17
class ContactType
18
{
19
    /**
20
     * @Field()
21
     */
22
    public function customField(Contact $contact, string $prefix): string
23
    {
24
        return $prefix.' '.strtoupper($contact->getName());
25
    }
26
}