1 | <?php |
||
15 | class FormRequest |
||
16 | { |
||
17 | use ORMBehaviors\Timestampable\Timestampable; |
||
18 | |||
19 | const STATUS = ['pending', 'approved', 'rejected']; |
||
20 | const TYPE = ['personal day', 'overnight guest', 'sick day']; |
||
21 | |||
22 | /** |
||
23 | * @var int |
||
24 | * |
||
25 | * @ORM\Column(name="id", type="integer") |
||
26 | * @ORM\Id |
||
27 | * @ORM\GeneratedValue(strategy="AUTO") |
||
28 | */ |
||
29 | private $id; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | * @Assert\NotBlank() |
||
34 | * @Assert\Choice(FormRequest::TYPE) |
||
35 | * @ORM\Column(type="string", length=25) |
||
36 | * @Groups({"Detail"}) |
||
37 | */ |
||
38 | private $type; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | * @Assert\NotBlank() |
||
43 | * @Assert\Type("string") |
||
44 | * @Assert\Length( |
||
45 | * max = 255 |
||
46 | * ) |
||
47 | * @ORM\Column(type="string", length=255) |
||
48 | * @Groups({"Detail"}) |
||
49 | */ |
||
50 | private $status; |
||
51 | |||
52 | /** |
||
53 | * @var User |
||
54 | * @Assert\Type("object") |
||
55 | * @Assert\Valid |
||
56 | * @ORM\ManyToOne(targetEntity="User", inversedBy="formRequests") |
||
57 | */ |
||
58 | private $user; |
||
59 | |||
60 | /** |
||
61 | * @var \DateTime |
||
62 | * @Assert\DateTime() |
||
63 | * @ORM\Column(type="datetime") |
||
64 | * @Assert\GreaterThan("+2 days") |
||
65 | * @Groups({"Detail"}) |
||
66 | */ |
||
67 | private $date; |
||
68 | |||
69 | /** |
||
70 | * @var string |
||
71 | * |
||
72 | * @ORM\Column(type="string", nullable=true) |
||
73 | * @Assert\Length(min="5", max="100") |
||
74 | * @Groups({"Detail"}) |
||
75 | */ |
||
76 | private $reason; |
||
77 | |||
78 | public function __construct() |
||
82 | |||
83 | /** |
||
84 | * Get id. |
||
85 | * |
||
86 | * @return int |
||
87 | */ |
||
88 | 1 | public function getId() |
|
92 | |||
93 | /** |
||
94 | * Set type. |
||
95 | * |
||
96 | * @param $type |
||
97 | * |
||
98 | * @return FormRequest |
||
99 | */ |
||
100 | public function setType($type) |
||
108 | |||
109 | /** |
||
110 | * Get type. |
||
111 | * |
||
112 | * @return string |
||
113 | */ |
||
114 | 1 | public function getType() |
|
118 | |||
119 | /** |
||
120 | * Set status. |
||
121 | * |
||
122 | * @param string $status |
||
123 | * |
||
124 | * @return FormRequest |
||
125 | */ |
||
126 | public function setStatus($status) |
||
134 | |||
135 | /** |
||
136 | * Get status. |
||
137 | * |
||
138 | * @return string |
||
139 | */ |
||
140 | 1 | public function getStatus() |
|
144 | |||
145 | /** |
||
146 | * Set user. |
||
147 | * |
||
148 | * @param User $user |
||
149 | * |
||
150 | * @return FormRequest |
||
151 | */ |
||
152 | public function setUser(User $user) |
||
158 | |||
159 | /** |
||
160 | * Get user. |
||
161 | * |
||
162 | * @return User |
||
163 | */ |
||
164 | public function getUser() |
||
168 | |||
169 | /** |
||
170 | * Set date. |
||
171 | * |
||
172 | * @param \DateTime $date |
||
173 | * |
||
174 | * @return FormRequest |
||
175 | */ |
||
176 | public function setDate($date) |
||
186 | /** |
||
187 | * Get date. |
||
188 | * |
||
189 | * @return \DateTime |
||
190 | */ |
||
191 | 1 | public function getDate() |
|
195 | |||
196 | /** |
||
197 | * @return string |
||
198 | */ |
||
199 | 1 | public function getReason() |
|
203 | |||
204 | /** |
||
205 | * @param string $reason |
||
206 | * |
||
207 | * @return $this |
||
208 | */ |
||
209 | public function setReason($reason) |
||
215 | } |
||
216 |
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..