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

Group::addTutor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 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
 * @ORM\Table(name="student_group")
29
 * @UniqueEntity(fields={"name"})
30
 */
31
class Group
32
{
33
    /**
34
     * @ORM\Id
35
     * @ORM\Column(type="integer")
36
     * @ORM\GeneratedValue
37
     * @var int
38
     */
39
    protected $id;
40
41
    /**
42
     * @ORM\Column(type="string")
43
     * @var string
44
     */
45
    protected $name;
46
47
    /**
48
     * @ORM\ManyToOne(targetEntity="Training", inversedBy="groups")
49
     * @var Training
50
     */
51
    protected $training;
52
53
    /**
54
     * @ORM\ManyToMany(targetEntity="Teacher", inversedBy="tutorizedGroups")
55
     * @var Teacher[]
56
     */
57
    protected $tutors;
58
59
    /**
60
     * @ORM\OneToMany(targetEntity="Student", mappedBy="group")
61
     * @var Student[]
62
     */
63
    protected $students;
64
    /**
65
     * Constructor
66
     */
67
    public function __construct()
68
    {
69
        $this->tutors = 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\Teacher>> of property $tutors.

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->students = 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\Student>> of property $students.

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 Group
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
     * Set training
109
     *
110
     * @param \AppBundle\Entity\Training $training
111
     *
112
     * @return Group
113
     */
114
    public function setTraining(\AppBundle\Entity\Training $training = null)
115
    {
116
        $this->training = $training;
117
118
        return $this;
119
    }
120
121
    /**
122
     * Get training
123
     *
124
     * @return \AppBundle\Entity\Training
125
     */
126
    public function getTraining()
127
    {
128
        return $this->training;
129
    }
130
131
    /**
132
     * Add tutor
133
     *
134
     * @param \AppBundle\Entity\Teacher $tutor
135
     *
136
     * @return Group
137
     */
138
    public function addTutor(\AppBundle\Entity\Teacher $tutor)
139
    {
140
        $this->tutors[] = $tutor;
141
142
        return $this;
143
    }
144
145
    /**
146
     * Remove tutor
147
     *
148
     * @param \AppBundle\Entity\Teacher $tutor
149
     */
150
    public function removeTutor(\AppBundle\Entity\Teacher $tutor)
151
    {
152
        $this->tutors->removeElement($tutor);
0 ignored issues
show
Bug introduced by
The method removeElement cannot be called on $this->tutors (of type array<integer,object<AppBundle\Entity\Teacher>>).

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...
153
    }
154
155
    /**
156
     * Get tutors
157
     *
158
     * @return \Doctrine\Common\Collections\Collection
159
     */
160
    public function getTutors()
161
    {
162
        return $this->tutors;
163
    }
164
165
    /**
166
     * Add student
167
     *
168
     * @param \AppBundle\Entity\Student $student
169
     *
170
     * @return Group
171
     */
172
    public function addStudent(\AppBundle\Entity\Student $student)
173
    {
174
        $this->students[] = $student;
175
176
        return $this;
177
    }
178
179
    /**
180
     * Remove student
181
     *
182
     * @param \AppBundle\Entity\Student $student
183
     */
184
    public function removeStudent(\AppBundle\Entity\Student $student)
185
    {
186
        $this->students->removeElement($student);
0 ignored issues
show
Bug introduced by
The method removeElement cannot be called on $this->students (of type array<integer,object<AppBundle\Entity\Student>>).

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 students
191
     *
192
     * @return \Doctrine\Common\Collections\Collection
193
     */
194
    public function getStudents()
195
    {
196
        return $this->students;
197
    }
198
}
199