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.

testFactoryReturnsInstance()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace MpaFirephpWrapperTest\Controller\Plugin;
4
5
use MpaFirephpWrapper\Controller\Plugin\FirephpPlugin;
6
use MpaFirephpWrapper\Controller\Plugin\FirephpPluginFactory;
7
use MpaFirephpWrapper\Service\FirephpWrapper;
8
use MpaFirephpWrapperTest\Util\ServiceManagerFactory;
9
use PHPUnit\Framework\TestCase;
10
11
class FirephpPluginFactoryTest extends TestCase
12
{
13
    protected $serviceManager;
14
15
    protected function setUp()
16
    {
17
        $this->serviceManager = ServiceManagerFactory::getServiceManager();
18
        $this->serviceManager->setAllowOverride(true);
19
20
        $this->serviceManager->setService(
21
            'firephp',
22
            $this->getMockBuilder(FirephpWrapper::class)
23
                ->disableOriginalConstructor()
24
                ->getMock()
25
        );
26
    }
27
28
    public function testFactoryReturnsInstance()
29
    {
30
        $factory = new FirephpPluginFactory();
31
        $result  = $factory->createService($this->serviceManager->get('ControllerPluginManager'));
0 ignored issues
show
Documentation introduced by
$this->serviceManager->g...ntrollerPluginManager') is of type object|array, but the function expects a object<Zend\ServiceManag...erviceLocatorInterface>.

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...
32
33
        $this->assertInstanceOf(FirephpPlugin::class, $result);
34
    }
35
}
36