Conditions | 1 |
Paths | 1 |
Total Lines | 37 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
22 | public static function validate(string $newPassword, string $verifyPassword): bool |
||
23 | { |
||
24 | $data = [ |
||
25 | 'new_password' => $newPassword, |
||
26 | 'verify_password' => $verifyPassword, |
||
27 | ]; |
||
28 | |||
29 | //Ok let validate user password |
||
30 | $validation = new CanvasValidation(); |
||
31 | |||
32 | $validation->add( |
||
33 | 'new_password', |
||
34 | new PresenceOf([ |
||
35 | 'message' => 'The password is required.' |
||
36 | ]) |
||
37 | ); |
||
38 | |||
39 | $validation->add( |
||
40 | 'new_password', |
||
41 | new StringLength([ |
||
42 | 'min' => 8, |
||
43 | 'messageMinimum' => 'Password is too short. Minimum 8 characters.', |
||
44 | ]) |
||
45 | ); |
||
46 | |||
47 | $validation->add( |
||
48 | 'new_password', |
||
49 | new Confirmation([ |
||
50 | 'message' => 'New password and confirmation do not match.', |
||
51 | 'with' => 'verify_password', |
||
52 | ]) |
||
53 | ); |
||
54 | |||
55 | //validate this form for password |
||
56 | $validation->validate($data); |
||
57 | |||
58 | return true; |
||
59 | } |
||
61 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths