PayGradeRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
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 34
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 12 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 PayGradeRequest 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 14
    public function rules()
36
    {
37 14
        if ($this->isMethod('post')) {
38
            return [
39 10
                'name'       => 'required|unique:pay_grades',
40 10
                'min_salary' => 'required',
41 10
                'max_salary' => 'required',
42 10
            ];
43
        }
44
45 8
        return [];
46
    }
47
48
    /**
49
     * Determine if the user is authorized to make this request.
50
     *
51
     * @return bool
52
     *
53
     * @author Bertrand Kintanar <[email protected]>
54
     */
55 14
    public function authorize()
56
    {
57 14
        return $this->hasAccess('admin.job.pay-grades');
58
    }
59
}
60