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 ( 91663a...1fc670 )
by Luis Ramón
16:26
created

Attendance::getEndTime2()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/*
3
  GESTCONV - Aplicación web para la gestión de la convivencia en centros educativos
4
5
  Copyright (C) 2015: 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\Form\Model;
22
23
use Symfony\Component\Validator\Constraints as Assert;
24
use Symfony\Component\Validator\Context\ExecutionContextInterface;
25
26
class Attendance
27
{
28
    /**
29
     * @Assert\NotBlank()
30
     * @var string
31
     */
32
    protected $startTime1;
33
34
    /**
35
     * @Assert\NotBlank()
36
     * @var string
37
     */
38
    protected $endTime1;
39
40
    /**
41
     * @var string
42
     */
43
    protected $startTime2;
44
45
    /**
46
     * @var string
47
     */
48
    protected $endTime2;
49
50
    /**
51
     * @var string
52
     */
53
    protected $startTime3;
54
55
    /**
56
     * @var string
57
     */
58
    protected $endTime3;
59
60
    /**
61
     * @var \DateTime
62
     */
63
    protected $signDate;
64
65
66
    public function __construct()
67
    {
68
        $this->signDate = new \DateTime();
69
    }
70
71
    /**
72
     * @return string
73
     */
74
    public function getStartTime1()
75
    {
76
        return $this->startTime1;
77
    }
78
79
    /**
80
     * @param string $startTime1
81
     * @return Attendance
82
     */
83
    public function setStartTime1($startTime1)
84
    {
85
        $this->startTime1 = $startTime1;
86
        return $this;
87
    }
88
89
    /**
90
     * @return string
91
     */
92
    public function getEndTime1()
93
    {
94
        return $this->endTime1;
95
    }
96
97
    /**
98
     * @param string $endTime1
99
     * @return Attendance
100
     */
101
    public function setEndTime1($endTime1)
102
    {
103
        $this->endTime1 = $endTime1;
104
        return $this;
105
    }
106
107
    /**
108
     * @return string
109
     */
110
    public function getStartTime2()
111
    {
112
        return $this->startTime2;
113
    }
114
115
    /**
116
     * @param string $startTime2
117
     * @return Attendance
118
     */
119
    public function setStartTime2($startTime2)
120
    {
121
        $this->startTime2 = $startTime2;
122
        return $this;
123
    }
124
125
    /**
126
     * @return string
127
     */
128
    public function getEndTime2()
129
    {
130
        return $this->endTime2;
131
    }
132
133
    /**
134
     * @param string $endTime2
135
     * @return Attendance
136
     */
137
    public function setEndTime2($endTime2)
138
    {
139
        $this->endTime2 = $endTime2;
140
        return $this;
141
    }
142
143
    /**
144
     * @return string
145
     */
146
    public function getStartTime3()
147
    {
148
        return $this->startTime3;
149
    }
150
151
    /**
152
     * @param string $startTime3
153
     * @return Attendance
154
     */
155
    public function setStartTime3($startTime3)
156
    {
157
        $this->startTime3 = $startTime3;
158
        return $this;
159
    }
160
161
    /**
162
     * @return string
163
     */
164
    public function getEndTime3()
165
    {
166
        return $this->endTime3;
167
    }
168
169
    /**
170
     * @param string $endTime3
171
     * @return Attendance
172
     */
173
    public function setEndTime3($endTime3)
174
    {
175
        $this->endTime3 = $endTime3;
176
        return $this;
177
    }
178
179
    /**
180
     * @return \DateTime
181
     */
182
    public function getSignDate()
183
    {
184
        return $this->signDate;
185
    }
186
187
    /**
188
     * @param \DateTime $signDate
189
     * @return Attendance
190
     */
191
    public function setSignDate($signDate)
192
    {
193
        $this->signDate = $signDate;
194
        return $this;
195
    }
196
197
    /**
198
     * @Assert\Callback
199
     */
200
    public function validate(ExecutionContextInterface $context)
201
    {
202
        if ($this->getEndTime1() <= $this->getStartTime1()) {
203
            $context->buildViolation('attendance.end_before_start')
204
                ->atPath('endTime1')
205
                ->addViolation();
206
        }
207
        if ($this->getStartTime2() && $this->getEndTime2() <= $this->getStartTime2()) {
208
            $context->buildViolation('attendance.end_before_start')
209
                ->atPath('endTime2')
210
                ->addViolation();
211
        }
212
        if ($this->getStartTime2() && $this->getStartTime2() <= $this->getEndTime1()) {
213
            $context->buildViolation('attendance.late_before_initial')
214
                ->atPath('startTime2')
215
                ->addViolation();
216
        }
217
        if ($this->getStartTime3() && $this->getEndTime3() <= $this->getStartTime3()) {
218
            $context->buildViolation('attendance.end_before_start')
219
                ->atPath('endTime3')
220
                ->addViolation();
221
        }
222
223
    }
224
225
}
226