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.
Completed
Pull Request — master (#9)
by Mario
07:30
created

NetgenOpenGraphRuntimeLoaderTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Netgen\Bundle\OpenGraphBundle\Tests\Templating\Twig\Extension;
4
5
use Netgen\Bundle\OpenGraphBundle\Templating\Twig\Extension\NetgenOpenGraphRuntime;
6
use Netgen\Bundle\OpenGraphBundle\Templating\Twig\Extension\NetgenOpenGraphRuntimeLoader;
7
use PHPUnit\Framework\TestCase;
8
9
class NetgenOpenGraphRuntimeLoaderTest extends TestCase
10
{
11
    /**
12
     * @var NetgenOpenGraphRuntimeLoader
13
     */
14
    protected $loader;
15
16
    /**
17
     * @var \PHPUnit_Framework_MockObject_MockObject
18
     */
19
    protected $runtime;
20
21
    public function setUp()
22
    {
23
        $this->runtime = $this->createMock(NetgenOpenGraphRuntime::class);
24
        $this->loader = new NetgenOpenGraphRuntimeLoader($this->runtime);
0 ignored issues
show
Documentation introduced by
$this->runtime is of type object<PHPUnit\Framework\MockObject\MockObject>, but the function expects a object<Netgen\Bundle\Ope...NetgenOpenGraphRuntime>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
25
    }
26
27
    public function testLoad()
28
    {
29
        $runtime = $this->loader->load(NetgenOpenGraphRuntime::class);
30
        $this->assertSame($this->runtime, $runtime);
31
    }
32
33
    public function testLoadWithStdClass()
34
    {
35
        $this->assertNull($this->loader->load(\stdClass::class));
36
    }
37
}
38