GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( e7bef7...3cccd4 )
by Šimon
03:07
created

NodeType   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 13
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A resolveNodeType() 0 8 4
1
<?php
2
namespace GraphQL\Examples\Blog\Type;
3
4
use GraphQL\Examples\Blog\Data\Story;
5
use GraphQL\Examples\Blog\Data\User;
6
use GraphQL\Examples\Blog\Data\Image;
7
use GraphQL\Examples\Blog\Types;
8
use GraphQL\Type\Definition\InterfaceType;
9
10
class NodeType extends InterfaceType
11
{
12
    public function __construct()
13
    {
14
        $config = [
15
            'name' => 'Node',
16
            'fields' => [
17
                'id' => Types::id()
18
            ],
19
            'resolveType' => [$this, 'resolveNodeType']
20
        ];
21
        parent::__construct($config);
22
    }
23
24
    public function resolveNodeType($object)
25
    {
26
        if ($object instanceof User) {
27
            return Types::user();
28
        } else if ($object instanceof Image) {
29
            return Types::image();
30
        } else if ($object instanceof Story) {
31
            return Types::story();
32
        }
33
    }
34
}
35