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.

BaseModel   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 61
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A getRepository() 0 4 1
A getManager() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the CCDNForum ForumBundle
5
 *
6
 * (c) CCDN (c) CodeConsortium <http://www.codeconsortium.com/>
7
 *
8
 * Available on github <http://www.github.com/codeconsortium/>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace CCDNForum\ForumBundle\Model\FrontModel;
15
16
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
17
use CCDNForum\ForumBundle\Model\Component\Manager\ManagerInterface;
18
use CCDNForum\ForumBundle\Model\Component\Repository\RepositoryInterface;
19
20
/**
21
 *
22
 * @category CCDNForum
23
 * @package  ForumBundle
24
 *
25
 * @author   Reece Fowell <[email protected]>
26
 * @license  http://opensource.org/licenses/MIT MIT
27
 * @version  Release: 2.0
28
 * @link     https://github.com/codeconsortium/CCDNForumForumBundle
29
 *
30
 * @abstract
31
 */
32
abstract class BaseModel
33
{
34
    /**
35
     *
36
     * @access protected
37
     * @var \CCDNForum\ForumBundle\Model\Component\Repository\RepositoryInterface
38
     */
39
    protected $repository;
40
41
    /**
42
     *
43
     * @access protected
44
     * @var \CCDNForum\ForumBundle\Model\Component\Manager\ManagerInterface
45
     */
46
    protected $manager;
47
48
    /**
49
     *
50
     * @access protected
51
     * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher
52
     */
53
    protected $dispatcher;
54
55
    /**
56
     *
57
     * @access public
58
     * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface           $dispatcher
59
     * @param \CCDNForum\ForumBundle\Model\Component\Repository\RepositoryInterface $repository
60
     * @param \CCDNForum\ForumBundle\Model\Component\Manager\ManagerInterface       $manager
61
     */
62
    public function __construct(EventDispatcherInterface $dispatcher, RepositoryInterface $repository, ManagerInterface $manager)
63
    {
64
        $this->dispatcher = $dispatcher;
65
66
        $repository->setModel($this);
0 ignored issues
show
Documentation introduced by
$this is of type this<CCDNForum\ForumBund...l\FrontModel\BaseModel>, but the function expects a object<CCDNForum\ForumBu...ntModel\ModelInterface>.

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...
67
        $this->repository = $repository;
68
69
        $manager->setModel($this);
0 ignored issues
show
Documentation introduced by
$this is of type this<CCDNForum\ForumBund...l\FrontModel\BaseModel>, but the function expects a object<CCDNForum\ForumBu...ntModel\ModelInterface>.

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...
70
        $this->manager = $manager;
71
    }
72
73
    /**
74
     *
75
     * @access public
76
     * @return \CCDNForum\ForumBundle\Model\Component\Repository\RepositoryInterface
77
     */
78
    public function getRepository()
79
    {
80
        return $this->repository;
81
    }
82
83
    /**
84
     *
85
     * @access public
86
     * @return \CCDNForum\ForumBundle\Model\Component\Manager\ManagerInterface
87
     */
88
    public function getManager()
89
    {
90
        return $this->manager;
91
    }
92
}
93