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

WorkSamplesValidator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 17 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 WorkSamplesValidator
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class WorkSamplesValidator
Loading history...
6
{
7
/* 
8
 *
9
 */
10
11
12
public function validate(Request $request, Applicant $applicant)
0 ignored issues
show
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...
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

12
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...
Coding Style introduced by
You must use "/**" style comments for a function comment
Loading history...
13
  {
0 ignored issues
show
Coding Style introduced by
Opening brace indented incorrectly; expected 0 spaces, found 2
Loading history...
14
15
        $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...
16
            'work_samples[:template][:id][name]' => [
17
                'required', // Project must have a name.
18
             ],   
19
            'work_samples[:template][:id][file_type_id] ' => [
20
                'required', // Project type should be required.
21
            ],
22
            'work_samples[:template][:id][url]' => [
23
                'url:required', //  The work might not be hosted online depending on the nature of it. i.e. senstiive data/international work/NDA's etc. Maybe revise the required URL rule? Consider making it nullable.
24
            ],
25
            'work_samples[:template][:id][description]' => [
26
                'nullable',
27
                'string',
28
                '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. 
29
            ]
30
           
31
        ]);
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...
32
       }
0 ignored issues
show
Coding Style introduced by
Closing brace indented incorrectly; expected 0 spaces, found 7
Loading history...
33
34
}