FakeResolveInfo::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 17
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 8
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 17
rs 10
1
<?php
2
3
namespace DNADesign\Elemental\Tests\GraphQL;
4
5
use GraphQL\Type\Definition\FieldDefinition;
6
use GraphQL\Type\Definition\ResolveInfo;
7
use GraphQL\Type\Definition\ObjectType;
8
use GraphQL\Type\Definition\Type;
9
use GraphQL\Type\Schema;
10
11
class FakeResolveInfo extends ResolveInfo
12
{
13
    public function __construct()
14
    {
15
        // webonyx/graphql-php v0.12
16
        if (!property_exists(__CLASS__, 'fieldDefinition')) {
17
            return;
18
        }
19
        // webonyx/graphql-php v14
20
        parent::__construct(
21
            FieldDefinition::create(['name' => 'fake', 'type' => Type::string()]),
22
            [],
23
            new ObjectType(['name' => 'fake']),
24
            [],
25
            new Schema([]),
26
            [],
27
            '',
28
            null,
29
            []
30
        );
31
    }
32
}
33