Completed
Branch 1.x (2c7718)
by Akihito
01:38
created

src/Module/ResourceModule.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * This file is part of the BEAR.Resource package.
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
namespace BEAR\Resource\Module;
8
9
use BEAR\Resource\Annotation\AppName;
10
use Ray\Di\AbstractModule;
11
12
class ResourceModule extends AbstractModule
13
{
14
    /**
15
     * @var string
16
     */
17
    private $appName;
18
19
    /**
20
     * @param string $appName
21
     */
22 47
    public function __construct($appName)
23
    {
24 47
        $this->appName = $appName;
25 47
        parent::__construct();
26 47
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31 47
    protected function configure()
32
    {
33 47
        $this->bind()->annotatedWith(AppName::class)->toInstance($this->appName);
34 47
        $this->install(new ResourceClientModule);
0 ignored issues
show
new \BEAR\Resource\Module\ResourceClientModule() is of type object<BEAR\Resource\Module\ResourceClientModule>, but the function expects a object<self>.

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...
35 47
        $this->install(new EmbedResourceModule);
0 ignored issues
show
new \BEAR\Resource\Module\EmbedResourceModule() is of type object<BEAR\Resource\Module\EmbedResourceModule>, but the function expects a object<self>.

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...
36 47
    }
37
}
38