ContactType::customField()   A
last analyzed

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="birthDate")
16
 * @SourceField(name="manager")
17
 * @SourceField(name="relations")
18
 */
19
class ContactType
20
{
21
    /**
22
     * @Field()
23
     */
24
    public function customField(Contact $contact, string $prefix): string
25
    {
26
        return $prefix.' '.strtoupper($contact->getName());
27
    }
28
}