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

SearchResultType   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 13
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 19 3
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\Types;
7
use GraphQL\Type\Definition\UnionType;
8
9
class SearchResultType extends UnionType
10
{
11
    public function __construct()
12
    {
13
        $config = [
14
            'name' => 'SearchResultType',
15
            'types' => function() {
16
                return [
17
                    Types::story(),
18
                    Types::user()
19
                ];
20
            },
21
            'resolveType' => function($value) {
22
                if ($value instanceof Story) {
23
                    return Types::story();
24
                } else if ($value instanceof User) {
25
                    return Types::user();
26
                }
27
            }
28
        ];
29
        parent::__construct($config);
30
    }
31
}
32