Completed
Push — master ( 20de55...87a0a5 )
by Tomas Norre
05:25
created

GolfRound::getScore()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace TNM\GolfCourses\Domain\Model;
3
4
/***************************************************************
5
 *  Copyright notice
6
 *
7
 *  (c) 2016 Tomas Norre Mikkelsen <[email protected]>
8
 *
9
 *  All rights reserved
10
 *
11
 *  This script is part of the TYPO3 project. The TYPO3 project is
12
 *  free software; you can redistribute it and/or modify
13
 *  it under the terms of the GNU General Public License as published by
14
 *  the Free Software Foundation; either version 3 of the License, or
15
 *  (at your option) any later version.
16
 *
17
 *  The GNU General Public License can be found at
18
 *  http://www.gnu.org/copyleft/gpl.html.
19
 *
20
 *  This script is distributed in the hope that it will be useful,
21
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
22
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
 *  GNU General Public License for more details.
24
 *
25
 *  This copyright notice MUST APPEAR in all copies of the script!
26
 ***************************************************************/
27
28
/**
29
 * Class GolfRound
30
 *
31
 * @package TNM\GolfCourses\Domain\Model
32
 */
33
class GolfRound extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
34
{
35
36
    /**
37
     * @var int
38
     */
39
    protected $date;
40
41
    /**
42
     * @var int
43
     */
44
    protected $course;
45
46
    /**
47
     * @var int
48
     */
49
    protected $par;
50
51
    /**
52
     * @var int
53
     */
54
    protected $strokes;
55
56
    /**
57
     * @var string
58
     */
59
    protected $score;
60
61
    /**
62
     * @var boolean
63
     */
64
    protected $regulation;
65
66
    /**
67
     * @return int
68
     */
69
    public function getDate()
70
    {
71
        return $this->date;
72
    }
73
74
    /**
75
     * @param int $date
76
     */
77
    public function setDate($date)
78
    {
79
        $this->date = $date;
80
    }
81
82
    /**
83
     * @return GolfCourse
84
     */
85
    public function getCourse()
86
    {
87
        return $this->course;
88
    }
89
90
    /**
91
     * @param GolfCourse $course
92
     */
93
    public function setCourse($course)
94
    {
95
        $this->course = $course;
0 ignored issues
show
Documentation Bug introduced by
It seems like $course of type object<TNM\GolfCourses\Domain\Model\GolfCourse> is incompatible with the declared type integer of property $course.

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...
96
    }
97
98
    /**
99
     * @return int
100
     */
101
    public function getPar()
102
    {
103
        return $this->par;
104
    }
105
106
    /**
107
     * @param int $par
108
     */
109
    public function setPar($par)
110
    {
111
        $this->par = $par;
112
    }
113
114
    /**
115
     * @return int
116
     */
117
    public function getStrokes()
118
    {
119
        return $this->strokes;
120
    }
121
122
    /**
123
     * @param int $strokes
124
     */
125
    public function setStrokes($strokes)
126
    {
127
        $this->strokes = $strokes;
128
    }
129
130
    /**
131
     * @return int
132
     */
133
    public function getScore()
134
    {
135
        return $this->score;
136
    }
137
138
    /**
139
     * @param int $score
140
     */
141
    public function setScore($score)
142
    {
143
        $this->score = $score;
0 ignored issues
show
Documentation Bug introduced by
The property $score was declared of type string, but $score is of type integer. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
144
    }
145
146
    /**
147
     * @return boolean
148
     */
149
    public function isRegulation()
150
    {
151
        return $this->regulation;
152
    }
153
154
    /**
155
     * @param boolean $regulation
156
     */
157
    public function setRegulation($regulation)
158
    {
159
        $this->regulation = $regulation;
160
    }
161
162
163
}