Completed
Push — validateaboutme ( a2d323...3e8b62 )
by
unknown
16:28 queued 08:01
created

PasswordValidation::message()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace App\Rules;
4
5
class PasswordValidation implements Rule
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class PasswordValidation
Loading history...
6
{
7
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $password should have a doc-comment as per coding-style.
Loading history...
8
     * This Password Validation rule should be referenced wherever we need the user input their password on the site.
9
     * The rules used on their passwords are;
10
     * 1) Password is required. 
11
     * 2) Must be at least 8 characters
12
     * 3) The password must contain at least one character from the following categories: 
13
     * lower-case characters (a-z), upper-case characters (A-Z), 
14
     * digits (0-9), and non-alphanumeric symbols (%, $, !, etc.).
15
     * Guide used by Polivas Korop
16
     * https://laraveldaily.com/how-to-create-custom-validation-rules-laravel/
17
     */
0 ignored issues
show
Coding Style introduced by
There must be no blank lines after the function comment
Loading history...
Coding Style introduced by
Missing @return tag in function comment
Loading history...
18
19
 public function PasswordCheck ($password) {
0 ignored issues
show
Coding Style introduced by
Public method name "PasswordValidation::PasswordCheck" is not in camel caps format
Loading history...
Coding Style introduced by
Expected 0 spaces before opening parenthesis; 1 found
Loading history...
20
     return $password  
0 ignored issues
show
Coding Style introduced by
Opening statement of multi-line function call not indented correctly; expected 4 spaces but found 5
Loading history...
Coding Style introduced by
Space before opening parenthesis of function call prohibited
Loading history...
21
           (
22
            'required',
23
            ' min:8' ,
0 ignored issues
show
Coding Style introduced by
Space found before comma in function call
Loading history...
24
            'regex:/^.*(?=.{3,})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*]).*$/'
25
            );
26
             
27
 }
28
29
public function message() {
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function message()
Loading history...
30
    
31
    return 'Password must be at least 8 characters, and contain at least one character from the following categories: 
32
     lower-case characters (a-z), upper-case characters (A-Z), 
33
     digits (0-9), and non-alphanumeric symbols (%, $, !, etc.).';
34
}
35
   
36
}
37
38