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
Pull Request — master (#5)
by Jérémiah
07:11
created

AbstractSimpleResolverTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 28
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getResolverSolutionsMapping() 0 9 1
A testResolveKnownArg() 0 7 1
A testResolveUnknownArg() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the OverblogGraphQLBundle 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\GraphQLBundle\Tests\Resolver;
13
14
abstract class AbstractSimpleResolverTest extends AbstractResolverTest
15
{
16
    protected function getResolverSolutionsMapping()
17
    {
18
        $totoSolution = new \stdClass();
19
        $totoSolution->name = 'Toto';
20
21
        return $mapping = [
0 ignored issues
show
Unused Code introduced by
$mapping is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
22
            'Toto' => ['solution' => $totoSolution],
23
        ];
24
    }
25
26
    public function testResolveKnownArg()
27
    {
28
        $arg = $this->resolver->resolve('Toto');
29
30
        $this->assertInstanceOf('stdClass', $arg);
31
        $this->assertEquals('Toto', $arg->name);
32
    }
33
34
    /**
35
     * @expectedException \Overblog\GraphQLBundle\Resolver\UnresolvableException
36
     */
37
    public function testResolveUnknownArg()
38
    {
39
        $this->resolver->resolve('Fake');
40
    }
41
}
42