Completed
Push — master ( 74e530...fcb171 )
by Daniel
10:06
created

Job::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1
Metric Value
dl 0
loc 20
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 18
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Jobles\Core\Job;
4
5
use Jobles\Core\Index\Index;
6
7
final class Job
8
{
9
10
    /**
11
     * @var string
12
     */
13
    private $key;
14
15
    /**
16
     * @var Index
17
     */
18
    private $index;
19
20
    /**
21
     * @var string
22
     */
23
    private $title;
24
25
    /**
26
     * @var string
27
     */
28
    private $company;
29
30
    /**
31
     * @var string
32
     */
33
    private $salaryCurrencyCode;
34
35
    /**
36
     * @var float
37
     */
38
    private $salaryMin;
39
40
    /**
41
     * @var float
42
     */
43
    private $salaryMax;
44
45
    /**
46
     * @var string
47
     */
48
    private $city;
49
50
    /**
51
     * @var string
52
     */
53
    private $state;
54
55
    /**
56
     * @var string
57
     */
58
    private $country;
59
60
    /**
61
     * @var string
62
     */
63
    private $source;
64
65
    /**
66
     * @var \DateTime
67
     */
68
    private $date;
69
70
    /**
71
     * @var string
72
     */
73
    private $snippet;
74
75
    /**
76
     * @var string
77
     */
78
    private $description;
79
80
    /**
81
     * @var string
82
     */
83
    private $viewUrl;
84
85
    /**
86
     * @var string
87
     */
88
    private $applyUrl;
89
90
    /**
91
     * @var bool
92
     */
93
    private $featured;
94
95
    public function __construct()
96
    {
97
        $this->key = '';
98 1
        $this->index = new Index('', '', '', '');
99
        $this->title = '';
100 1
        $this->company = '';
101
        $this->salaryCurrencyCode = '';
102
        $this->salaryMin = 0;
0 ignored issues
show
Documentation Bug introduced by
The property $salaryMin was declared of type double, but 0 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...
103
        $this->salaryMax = 0;
0 ignored issues
show
Documentation Bug introduced by
The property $salaryMax was declared of type double, but 0 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...
104
        $this->city = '';
105
        $this->state = '';
106
        $this->country = '';
107
        $this->source = '';
108 17
        $this->date = new \DateTime;
109
        $this->snippet = '';
110 17
        $this->description = '';
111
        $this->viewUrl = '';
112 17
        $this->applyUrl = '';
113
        $this->featured = false;
114
    }
115
116
    /**
117
     * @return string
118 1
     */
119
    public function getKey() : string
120 1
    {
121
        return $this->key;
122
    }
123
124
    /**
125
     * @param string $key
126
     *
127
     * @return Job
128 17
     */
129
    public function setKey(string $key)
130 17
    {
131
        $this->key = $key;
132 17
133
        return $this;
134
    }
135
136
    /**
137
     * @return Index
138 3
     */
139
    public function getIndex() : Index
140 3
    {
141
        return $this->index;
142
    }
143
144
    /**
145
     * @param Index $index
146
     *
147
     * @return Job
148 26
     */
149
    public function setIndex(Index $index) : Job
150 26
    {
151
        $this->index = $index;
152 26
153
        return $this;
154
    }
155
156
    /**
157
     * @return string
158 1
     */
159
    public function getTitle() : string
160 1
    {
161
        return $this->title;
162
    }
163
164
    /**
165
     * @param string $title
166
     *
167
     * @return Job
168 17
     */
169
    public function setTitle(string $title) : Job
170 17
    {
171
        $this->title = $title;
172 17
173
        return $this;
174
    }
175
176
    /**
177
     * @return string
178 1
     */
179
    public function getCompany() : string
180 1
    {
181
        return $this->company;
182
    }
183
184
    /**
185
     * @param string $company
186
     *
187
     * @return Job
188 17
     */
189
    public function setCompany(string $company) : Job
190 17
    {
191
        $this->company = $company;
192 17
193
        return $this;
194
    }
195
196
    /**
197
     * @return string
198 1
     */
199
    public function getSalaryCurrencyCode() : string
200 1
    {
201
        return $this->salaryCurrencyCode;
202
    }
203
204
    /**
205
     * @param string $salaryCurrencyCode
206
     *
207
     * @return Job
208 17
     */
209
    public function setSalaryCurrencyCode(string $salaryCurrencyCode) : Job
210 17
    {
211
        $this->salaryCurrencyCode = $salaryCurrencyCode;
212 17
213
        return $this;
214
    }
215
216
    /**
217
     * @return string
218 1
     */
219
    public function getSalaryMin() : string
220 1
    {
221
        return $this->salaryMin;
222
    }
223
224
    /**
225
     * @param string $salaryMin
226
     *
227
     * @return Job
228 17
     */
229
    public function setSalaryMin(string $salaryMin) : Job
230 17
    {
231
        $this->salaryMin = $salaryMin;
0 ignored issues
show
Documentation Bug introduced by
The property $salaryMin was declared of type double, but $salaryMin is of type string. 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...
232 17
233
        return $this;
234
    }
235
236
    /**
237
     * @return string
238 1
     */
239
    public function getSalaryMax() : string
240 1
    {
241
        return $this->salaryMax;
242
    }
243
244
    /**
245
     * @param string $salaryMax
246
     *
247
     * @return Job
248 17
     */
249
    public function setSalaryMax(string $salaryMax) : Job
250 17
    {
251
        $this->salaryMax = $salaryMax;
0 ignored issues
show
Documentation Bug introduced by
The property $salaryMax was declared of type double, but $salaryMax is of type string. 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...
252 17
253
        return $this;
254
    }
255
256
    /**
257
     * @return string
258 1
     */
259
    public function getCity() : string
260 1
    {
261
        return $this->city;
262
    }
263
264
    /**
265
     * @param string $city
266
     *
267
     * @return Job
268 17
     */
269
    public function setCity(string $city) : Job
270 17
    {
271
        $this->city = $city;
272 17
273
        return $this;
274
    }
275
276
    /**
277
     * @return string
278 1
     */
279
    public function getState() : string
280 1
    {
281
        return $this->state;
282
    }
283
284
    /**
285
     * @param string $state
286
     *
287
     * @return Job
288 17
     */
289
    public function setState(string $state) : Job
290 17
    {
291
        $this->state = $state;
292 17
293
        return $this;
294
    }
295
296
    /**
297
     * @return string
298 1
     */
299
    public function getCountry() : string
300 1
    {
301
        return $this->country;
302
    }
303
304
    /**
305
     * @param string $country
306
     *
307
     * @return Job
308 17
     */
309
    public function setCountry(string $country) : Job
310 17
    {
311
        $this->country = $country;
312 17
313
        return $this;
314
    }
315
316
    /**
317
     * @return string
318 1
     */
319
    public function getSource() : string
320 1
    {
321
        return $this->source;
322
    }
323
324
    /**
325
     * @param string $source
326
     *
327
     * @return Job
328 17
     */
329
    public function setSource(string $source) : Job
330 17
    {
331
        $this->source = $source;
332 17
333
        return $this;
334
    }
335
336
    /**
337
     * @return \DateTime
338 1
     */
339
    public function getDate() : \DateTime
340 1
    {
341
        return $this->date;
342
    }
343
344
    /**
345
     * @param \DateTime $date
346
     *
347
     * @return Job
348 17
     */
349
    public function setDate(\DateTime $date) : Job
350 17
    {
351
        $this->date = $date;
352 17
353
        return $this;
354
    }
355
356
    /**
357
     * @return string
358 1
     */
359
    public function getSnippet() : string
360 1
    {
361
        return $this->snippet;
362
    }
363
364
    /**
365
     * @param string $snippet
366
     *
367
     * @return Job
368 17
     */
369
    public function setSnippet(string $snippet) : Job
370 17
    {
371
        $this->snippet = $snippet;
372 17
373
        return $this;
374
    }
375
376
    /**
377
     * @return string
378 1
     */
379
    public function getDescription() : string
380 1
    {
381
        return $this->description;
382
    }
383
384
    /**
385
     * @param string $description
386
     *
387
     * @return Job
388 17
     */
389
    public function setDescription(string $description) : Job
390 17
    {
391
        $this->description = $description;
392 17
393
        return $this;
394
    }
395
396
    /**
397
     * @return string
398 1
     */
399
    public function getViewUrl() : string
400 1
    {
401
        return $this->viewUrl;
402
    }
403
404
    /**
405
     * @param string $viewUrl
406
     *
407
     * @return Job
408 17
     */
409
    public function setViewUrl(string $viewUrl) : Job
410 17
    {
411
        $this->viewUrl = $viewUrl;
412 17
413
        return $this;
414
    }
415
416
    /**
417
     * @return string
418 1
     */
419
    public function getApplyUrl() : string
420 1
    {
421
        return $this->applyUrl;
422
    }
423
424
    /**
425
     * @param string $applyUrl
426
     *
427
     * @return Job
428 17
     */
429
    public function setApplyUrl(string $applyUrl) : Job
430 17
    {
431
        $this->applyUrl = $applyUrl;
432 17
433
        return $this;
434
    }
435
436
    /**
437
     * @return boolean
438
     */
439
    public function isFeatured() : bool
440
    {
441
        return $this->featured;
442
    }
443
444
    /**
445
     * @param bool $featured
446
     *
447
     * @return Job
448
     */
449
    public function setFeatured(bool $featured) : Job
450
    {
451
        $this->featured = $featured;
452
453
        return $this;
454
    }
455
}
456