SomeQueryField   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Importance

Changes 5
Bugs 2 Features 0
Metric Value
eloc 8
c 5
b 2
f 0
dl 0
loc 49
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getArgs() 0 5 1
A getDescription() 0 3 1
A getName() 0 3 1
A resolve() 0 3 1
A getType() 0 3 1
1
<?php declare(strict_types = 1);
2
3
namespace Portiny\GraphQL\Tests\Source\Provider;
4
5
use GraphQL\Type\Definition\Type;
6
use Portiny\GraphQL\Contract\Field\QueryFieldInterface;
7
8
final class SomeQueryField implements QueryFieldInterface
9
{
10
11
	/**
12
	 * {@inheritdoc}
13
	 */
14
	public function getName(): string
15
	{
16
		return 'someQueryName';
17
	}
18
19
20
	/**
21
	 * {@inheritdoc}
22
	 */
23
	public function getDescription(): string
24
	{
25
		return 'Some description';
26
	}
27
28
29
	/**
30
	 * {@inheritdoc}
31
	 */
32
	public function getArgs(): array
33
	{
34
		return [
35
			'someArg' => [
36
				'type' => Type::string(),
37
			],
38
		];
39
	}
40
41
42
	/**
43
	 * {@inheritdoc}
44
	 */
45
	public function getType(): Type
46
	{
47
		return Type::string();
48
	}
49
50
51
	/**
52
	 * {@inheritdoc}
53
	 */
54
	public function resolve(array $root, array $args, $context = null)
55
	{
56
		return 'resolved ' . $args['someArg'];
57
	}
58
59
}
60