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

Student   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 140
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

10 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setCode() 0 6 1
A getCode() 0 4 1
A setId() 0 6 1
A getId() 0 4 1
A setGroup() 0 6 1
A getGroup() 0 4 1
A addAgreement() 0 6 1
A removeAgreement() 0 4 1
A getAgreements() 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={"code"})
29
 */
30
class Student
31
{
32
    /**
33
     * @ORM\Id
34
     * @ORM\OneToOne(targetEntity="Person")
35
     * @ORM\JoinColumn(name="id")
36
     * @var int
37
     */
38
    protected $id;
39
40
    /**
41
     * @ORM\Column(type="string")
42
     * @var string
43
     */
44
    protected $code;
45
46
    /**
47
     * @ORM\ManyToOne(targetEntity="Group", inversedBy="students")
48
     * @ORM\JoinColumn(nullable=false)
49
     */
50
    protected $group;
51
52
    /**
53
     * @ORM\OneToMany(targetEntity="Agreement", mappedBy="student")
54
     */
55
    protected $agreements;
56
    /**
57
     * Constructor
58
     */
59
    public function __construct()
60
    {
61
        $this->agreements = new \Doctrine\Common\Collections\ArrayCollection();
62
    }
63
64
    /**
65
     * Set code
66
     *
67
     * @param string $code
68
     *
69
     * @return Student
70
     */
71
    public function setCode($code)
72
    {
73
        $this->code = $code;
74
75
        return $this;
76
    }
77
78
    /**
79
     * Get code
80
     *
81
     * @return string
82
     */
83
    public function getCode()
84
    {
85
        return $this->code;
86
    }
87
88
    /**
89
     * Set id
90
     *
91
     * @param \AppBundle\Entity\Person $id
92
     *
93
     * @return Student
94
     */
95
    public function setId(\AppBundle\Entity\Person $id)
96
    {
97
        $this->id = $id;
0 ignored issues
show
Documentation Bug introduced by
It seems like $id of type object<AppBundle\Entity\Person> is incompatible with the declared type integer of property $id.

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...
98
99
        return $this;
100
    }
101
102
    /**
103
     * Get id
104
     *
105
     * @return \AppBundle\Entity\Person
106
     */
107
    public function getId()
108
    {
109
        return $this->id;
110
    }
111
112
    /**
113
     * Set group
114
     *
115
     * @param \AppBundle\Entity\Group $group
116
     *
117
     * @return Student
118
     */
119
    public function setGroup(\AppBundle\Entity\Group $group)
120
    {
121
        $this->group = $group;
122
123
        return $this;
124
    }
125
126
    /**
127
     * Get group
128
     *
129
     * @return \AppBundle\Entity\Group
130
     */
131
    public function getGroup()
132
    {
133
        return $this->group;
134
    }
135
136
    /**
137
     * Add agreement
138
     *
139
     * @param \AppBundle\Entity\Agreement $agreement
140
     *
141
     * @return Student
142
     */
143
    public function addAgreement(\AppBundle\Entity\Agreement $agreement)
144
    {
145
        $this->agreements[] = $agreement;
146
147
        return $this;
148
    }
149
150
    /**
151
     * Remove agreement
152
     *
153
     * @param \AppBundle\Entity\Agreement $agreement
154
     */
155
    public function removeAgreement(\AppBundle\Entity\Agreement $agreement)
156
    {
157
        $this->agreements->removeElement($agreement);
158
    }
159
160
    /**
161
     * Get agreements
162
     *
163
     * @return \Doctrine\Common\Collections\Collection
164
     */
165
    public function getAgreements()
166
    {
167
        return $this->agreements;
168
    }
169
}
170