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::resolveNodeType()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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