Passed
Push — validatereferences ( fd929d...7b9a35 )
by
unknown
05:49
created

ExperienceValidator::validate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 29
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 29
rs 9.7
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace App\Services\Validation;
4
5
use App\Http\Controllers\ExperienceController;
6
7
8
class ExperienceValidator
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class ExperienceValidator
Loading history...
9
{
10
/* 
11
 * Requires error message implementation and proper namespace usage. 
12
 */
13
14
    public function validate(Request $request, Applicant $applicant)
0 ignored issues
show
Unused Code introduced by
The parameter $applicant is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

14
    public function validate(Request $request, /** @scrutinizer ignore-unused */ Applicant $applicant)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Bug introduced by
The type App\Services\Validation\Request was not found. Did you mean Request? If so, make sure to prefix the type with \.
Loading history...
Coding Style introduced by
You must use "/**" style comments for a function comment
Loading history...
15
    {
16
       $request->validate([
0 ignored issues
show
Coding Style introduced by
Opening statement of multi-line function call not indented correctly; expected 4 spaces but found 7
Loading history...
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
17
            'degrees[:template][:id][area_of_study]' => [
18
                'required',
19
                
20
            ],
21
            'degrees[:template][:id][institution]' => [
22
                'nullable', // Institution is nullable because applicant might have acquired the skills/knowledge on their own or some other way.
23
                'max:255',
24
                
25
           ],
26
            'courses[:template][:id][name]' => [
27
                'required',
28
            ],
29
            'courses[:template][:id][institution]' => [
30
                'required', // If someone declares a course we should require them to say where they completed this course.
31
            ],
32
            'work_experiences[:template][:id][role]' => [
33
                'required', // If they decide to fill out Equivalent Experience, a Role should be well defined,
34
                
35
            ], 
36
            'work_experiences[:template][:id][company]' => [
37
                'nullable', // Not every role belongs to a Company or Group. Someone could be a Hobbyist and as such might be hesistant to put something else down here. So nullable.
38
                
39
            ],
40
            'work_experiences[:template][:id][description]' => [
41
                'required',
42
                'min:2500' // Hiring managers will probably like atleast a paragraph's worth of information here. Since you tend to have to back up Equivalent Experience more often than other forms of "Experience".
43
            ]
44
            
45
        ]);
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
46
    } 
47
}