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
Push — master ( bca039...62b974 )
by Luis Ramón
03:29
created

Training   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 169
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 12
c 2
b 0
f 0
lcom 2
cbo 1
dl 0
loc 169
rs 10

12 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getId() 0 4 1
A setName() 0 6 1
A getName() 0 4 1
A addGroup() 0 6 1
A removeGroup() 0 4 1
A getGroups() 0 4 1
A setDepartment() 0 6 1
A getDepartment() 0 4 1
A addActivity() 0 6 1
A removeActivity() 0 4 1
A getActivities() 0 4 1
1
<?php
2
/*
3
  ÁTICA - Aplicación web para la gestión documental de centros educativos
4
5
  Copyright (C) 2015-2016: Luis Ramón López López
6
7
  This program is free software: you can redistribute it and/or modify
8
  it under the terms of the GNU Affero General Public License as published by
9
  the Free Software Foundation, either version 3 of the License, or
10
  (at your option) any later version.
11
12
  This program is distributed in the hope that it will be useful,
13
  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
  GNU Affero General Public License for more details.
16
17
  You should have received a copy of the GNU Affero General Public License
18
  along with this program.  If not, see [http://www.gnu.org/licenses/].
19
*/
20
21
namespace AppBundle\Entity;
22
23
use Doctrine\ORM\Mapping as ORM;
24
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
25
26
/**
27
 * @ORM\Entity
28
 * @UniqueEntity(fields={"name"})
29
 */
30
class Training
31
{
32
    /**
33
     * @ORM\Id
34
     * @ORM\Column(type="integer")
35
     * @ORM\GeneratedValue
36
     * @var int
37
     */
38
    protected $id;
39
40
    /**
41
     * @ORM\Column(type="string")
42
     * @var string
43
     */
44
    protected $name;
45
46
    /**
47
     * @ORM\OneToMany(targetEntity="Group", mappedBy="training")
48
     * @var Group[]
49
     */
50
    protected $groups;
51
52
    /**
53
     * @ORM\ManyToOne(targetEntity="Department", inversedBy="trainings")
54
     * @ORM\JoinColumn(nullable=false)
55
     * @var Department
56
     */
57
    protected $department;
58
59
    /**
60
     * @ORM\OneToMany(targetEntity="Activity", mappedBy="training")
61
     * @var Activity[]
62
     */
63
    protected $activities;
64
    /**
65
     * Constructor
66
     */
67
    public function __construct()
68
    {
69
        $this->groups = new \Doctrine\Common\Collections\ArrayCollection();
0 ignored issues
show
Documentation Bug introduced by
It seems like new \Doctrine\Common\Collections\ArrayCollection() of type object<Doctrine\Common\C...ctions\ArrayCollection> is incompatible with the declared type array<integer,object<AppBundle\Entity\Group>> of property $groups.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
70
        $this->activities = new \Doctrine\Common\Collections\ArrayCollection();
0 ignored issues
show
Documentation Bug introduced by
It seems like new \Doctrine\Common\Collections\ArrayCollection() of type object<Doctrine\Common\C...ctions\ArrayCollection> is incompatible with the declared type array<integer,object<AppBundle\Entity\Activity>> of property $activities.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
71
    }
72
73
    /**
74
     * Get id
75
     *
76
     * @return integer
77
     */
78
    public function getId()
79
    {
80
        return $this->id;
81
    }
82
83
    /**
84
     * Set name
85
     *
86
     * @param string $name
87
     *
88
     * @return Training
89
     */
90
    public function setName($name)
91
    {
92
        $this->name = $name;
93
94
        return $this;
95
    }
96
97
    /**
98
     * Get name
99
     *
100
     * @return string
101
     */
102
    public function getName()
103
    {
104
        return $this->name;
105
    }
106
107
    /**
108
     * Add group
109
     *
110
     * @param \AppBundle\Entity\Group $group
111
     *
112
     * @return Training
113
     */
114
    public function addGroup(\AppBundle\Entity\Group $group)
115
    {
116
        $this->groups[] = $group;
117
118
        return $this;
119
    }
120
121
    /**
122
     * Remove group
123
     *
124
     * @param \AppBundle\Entity\Group $group
125
     */
126
    public function removeGroup(\AppBundle\Entity\Group $group)
127
    {
128
        $this->groups->removeElement($group);
0 ignored issues
show
Bug introduced by
The method removeElement cannot be called on $this->groups (of type array<integer,object<AppBundle\Entity\Group>>).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
129
    }
130
131
    /**
132
     * Get groups
133
     *
134
     * @return \Doctrine\Common\Collections\Collection
135
     */
136
    public function getGroups()
137
    {
138
        return $this->groups;
139
    }
140
141
    /**
142
     * Set department
143
     *
144
     * @param \AppBundle\Entity\Department $department
145
     *
146
     * @return Training
147
     */
148
    public function setDepartment(\AppBundle\Entity\Department $department)
149
    {
150
        $this->department = $department;
151
152
        return $this;
153
    }
154
155
    /**
156
     * Get department
157
     *
158
     * @return \AppBundle\Entity\Department
159
     */
160
    public function getDepartment()
161
    {
162
        return $this->department;
163
    }
164
165
    /**
166
     * Add activity
167
     *
168
     * @param \AppBundle\Entity\Activity $activity
169
     *
170
     * @return Training
171
     */
172
    public function addActivity(\AppBundle\Entity\Activity $activity)
173
    {
174
        $this->activities[] = $activity;
175
176
        return $this;
177
    }
178
179
    /**
180
     * Remove activity
181
     *
182
     * @param \AppBundle\Entity\Activity $activity
183
     */
184
    public function removeActivity(\AppBundle\Entity\Activity $activity)
185
    {
186
        $this->activities->removeElement($activity);
0 ignored issues
show
Bug introduced by
The method removeElement cannot be called on $this->activities (of type array<integer,object<AppBundle\Entity\Activity>>).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
187
    }
188
189
    /**
190
     * Get activities
191
     *
192
     * @return \Doctrine\Common\Collections\Collection
193
     */
194
    public function getActivities()
195
    {
196
        return $this->activities;
197
    }
198
}
199