SomeQueryField::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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