Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Push — annotations ( a85f92...4ec00b )
by Jérémiah
24:35 queued 10s
created

Resolver::getHuman()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 2
1
<?php
2
3
/*
4
 * This file is part of the OverblogGraphQLPhpGenerator package.
5
 *
6
 * (c) Overblog <http://github.com/overblog/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Overblog\GraphQLGenerator\Tests;
13
14
use GraphQL\Type\Definition\Type;
15
16
abstract class Resolver
17
{
18
    /** @var Type */
19
    private static $humanType;
20
21
    /** @var Type */
22
    private static $droidType;
23
24
    private function __construct()
25
    {
26
    }
27
28
    public static function getHumanType()
29
    {
30
        return self::$humanType;
31
    }
32
33
    public static function getDroidType()
34
    {
35
        return self::$droidType;
36
    }
37
38
    /**
39
     * @param Type $humanType
40
     */
41
    public static function setHumanType($humanType)
42
    {
43
        self::$humanType = $humanType;
44
    }
45
46
    /**
47
     * @param Type $droidType
48
     */
49
    public static function setDroidType($droidType)
50
    {
51
        self::$droidType = $droidType;
52
    }
53
54
    public static function resolveType($obj)
55
    {
56
        $humans = StarWarsData::humans();
57
        $droids = StarWarsData::droids();
58
        if (isset($humans[$obj['id']])) {
59
            return static::getHumanType();
60
        }
61
        if (isset($droids[$obj['id']])) {
62
            return static::getDroidType();
63
        }
64
        return null;
65
    }
66
67
    public static function getFriends($droidOrHuman)
68
    {
69
        return StarWarsData::getFriends($droidOrHuman);
70
    }
71
72
    public static function getHero($root, $args)
0 ignored issues
show
Unused Code introduced by
The parameter $root is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

72
    public static function getHero(/** @scrutinizer ignore-unused */ $root, $args)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
73
    {
74
        return StarWarsData::getHero(isset($args['episode']['name']) ? $args['episode']['name'] : null);
75
    }
76
77
    public static function getHuman($root, $args)
0 ignored issues
show
Unused Code introduced by
The parameter $root is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

77
    public static function getHuman(/** @scrutinizer ignore-unused */ $root, $args)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
78
    {
79
        $humans = StarWarsData::humans();
80
        return isset($humans[$args['id']]) ? $humans[$args['id']] : null;
81
    }
82
83
    public static function getDroid($root, $args)
0 ignored issues
show
Unused Code introduced by
The parameter $root is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

83
    public static function getDroid(/** @scrutinizer ignore-unused */ $root, $args)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
84
    {
85
        $droids = StarWarsData::droids();
86
        return isset($droids[$args['id']]) ? $droids[$args['id']] : null;
87
    }
88
89
    public static function getDateTime($root, $args)
0 ignored issues
show
Unused Code introduced by
The parameter $root is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

89
    public static function getDateTime(/** @scrutinizer ignore-unused */ $root, $args)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
90
    {
91
        return isset($args['dateTime']) ? $args['dateTime'] : new \DateTime('2016-11-28 12:00:00');
92
    }
93
}
94