EmploymentStatusRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 30
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 8 2
A authorize() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the HRis Software package.
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * Licensed under the 3-clause BSD License.
9
 *
10
 * This source file is subject to the 3-clause BSD License that is
11
 * bundled with this package in the LICENSE file.
12
 *
13
 * @version    alpha
14
 *
15
 * @author     Bertrand Kintanar <[email protected]>
16
 * @license    BSD License (3-clause)
17
 * @copyright  (c) 2014-2016, b8 Studios, Ltd
18
 *
19
 * @link       http://github.com/HB-Co/HRis
20
 */
21
22
namespace HRis\Api\Requests\Admin\Job;
23
24
use Irradiate\Api\Requests\Request;
25
26
class EmploymentStatusRequest extends Request
27
{
28
    /**
29
     * Get the validation rules that apply to the request.
30
     *
31
     * @return array
32
     *
33
     * @author Bertrand Kintanar <[email protected]>
34
     */
35 12
    public function rules()
36
    {
37 12
        if ($this->isMethod('post')) {
38 8
            return ['name' => 'required|unique:employment_statuses'];
39
        }
40
41 8
        return [];
42
    }
43
44
    /**
45
     * Determine if the user is authorized to make this request.
46
     *
47
     * @return bool
48
     *
49
     * @author Bertrand Kintanar <[email protected]>
50
     */
51 12
    public function authorize()
52
    {
53 12
        return $this->hasAccess('admin.job.employment-status');
54
    }
55
}
56