Issues (3627)

AssetBundle/Event/RemoteAssetBrowseEvent.php (1 issue)

1
<?php
2
3
/*
4
 * @copyright   2014 Mautic Contributors. All rights reserved
5
 * @author      Mautic
6
 *
7
 * @link        http://mautic.org
8
 *
9
 * @license     GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
10
 */
11
12
namespace Mautic\AssetBundle\Event;
13
14
use Gaufrette\Adapter;
15
use Mautic\CoreBundle\Event\CommonEvent;
16
use Mautic\PluginBundle\Integration\AbstractIntegration;
17
use Mautic\PluginBundle\Integration\UnifiedIntegrationInterface;
18
19
/**
20
 * Class RemoteAssetBrowseEvent.
21
 */
22
class RemoteAssetBrowseEvent extends CommonEvent
23
{
24
    /**
25
     * @var Adapter
26
     */
27
    private $adapter;
28
29
    /**
30
     * @var AbstractIntegration
31
     */
32
    private $integration;
33
34
    public function __construct(UnifiedIntegrationInterface $integration)
35
    {
36
        $this->integration = $integration;
0 ignored issues
show
Documentation Bug introduced by
$integration is of type Mautic\PluginBundle\Inte...iedIntegrationInterface, but the property $integration was declared to be of type Mautic\PluginBundle\Inte...ion\AbstractIntegration. Are you sure that you always receive this specific sub-class here, or does it make sense to add an instanceof check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.

Either this assignment is in error or an instanceof check should be added for that assignment.

class Alien {}

class Dalek extends Alien {}

class Plot
{
    /** @var  Dalek */
    public $villain;
}

$alien = new Alien();
$plot = new Plot();
if ($alien instanceof Dalek) {
    $plot->villain = $alien;
}
Loading history...
37
    }
38
39
    /**
40
     * @return Adapter
41
     */
42
    public function getAdapter()
43
    {
44
        return $this->adapter;
45
    }
46
47
    /**
48
     * @return AbstractIntegration
49
     */
50
    public function getIntegration()
51
    {
52
        return $this->integration;
53
    }
54
55
    /**
56
     * @return $this
57
     */
58
    public function setAdapter(Adapter $adapter)
59
    {
60
        $this->adapter = $adapter;
61
62
        return $this;
63
    }
64
}
65