ShopAccountForm_PasswordValidator   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A clean_password() 0 10 4
1
<?php
2
3
/***
4
 * extra checks to make sure the password is valid....
5
 *
6
 *
7
 *
8
 *
9
 */
10
11
class ShopAccountForm_PasswordValidator extends Object
12
{
13
    /**
14
     * returns a valid, mysql safe password OR an empty string.
15
     *
16
     * @param data (data from form)
17
     *
18
     * @return string
0 ignored issues
show
Documentation introduced by
Should the return type not be array|string?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
19
     */
20
    public static function clean_password($data)
21
    {
22
        if (isset($data['PasswordCheck1']) && isset($data['PasswordCheck2'])) {
23
            if ($data['PasswordCheck1'] == $data['PasswordCheck2']) {
24
                return Convert::raw2sql($data['PasswordCheck1']);
25
            }
26
        }
27
28
        return '';
29
    }
30
}
31