Completed
Pull Request — master (#50)
by David
01:59
created

ContactType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 1
dl 0
loc 8
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A customField() 0 3 1
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
}