Passed
Push — validatereferences ( 6915e1...c33d06 )
by
unknown
07:37
created

CourseValidator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
eloc 6
dl 0
loc 14
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 8 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
use App\Http\Controllers\CourseController;
6
7
8
class CourseValidator
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class CourseValidator
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
            'courses[:template][:id][name]' => [
18
                'required',
19
            ],
20
            'courses[:template][:id][institution]' => [
21
                'required', // If someone declares a course we should require them to say where they completed this course.
22
            ]
23
            
24
        ]);
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...
25
    } 
26
}