Passed
Push — validatereferences ( 92eb92...fd929d )
by
unknown
06:14
created

ReferencesValidator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 12
dl 0
loc 22
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 16 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace App\Services\Validation;
4
5
class ReferencesValidator 
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class ReferencesValidator
Loading history...
6
{
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces before opening brace; 1 found
Loading history...
7
/* 
8
*
9
*/
10
11
  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

11
  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...
12
    {
0 ignored issues
show
Coding Style introduced by
Opening brace indented incorrectly; expected 2 spaces, found 4
Loading history...
13
        $request->validate([
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
14
            'references[:template][:id][name]' => [
15
                'required',      // Name of Reference shoud be required.
16
            ],
17
            'references[:template][:id][relationship_id]' => [
18
                'required', // Your Relationship should be required. 
19
            ],
20
            'references[:template][:id][email]' => [
21
                'email:required', // Maybe don't make email required incase applicant only has another form of contact info for this reference (Like phone number?) Potentially open this up for more forms of contacting the reference.
22
            ],
23
            'references[:template][:id][description]' => [
24
                'nullable',
25
                'string',
26
                'max:4000' // Allows the applicant to be descriptive with a rather generous paragraph but not so descriptive that the hiring manager will have to contend with a page of text. 
27
            ]
28
            
29
        ]);            
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...
30
        
31
    }
0 ignored issues
show
Coding Style introduced by
Closing brace indented incorrectly; expected 2 spaces, found 4
Loading history...
32
}