Passed
Pull Request — 1.11.x (#4350)
by Angel Fernando Quiroz
09:23
created

validate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
use Chamilo\UserBundle\Entity\User;
6
7
class HTML_QuickForm_Rule_NoSameCurrentPassword extends HTML_QuickForm_Rule
8
{
9
    public function validate($value, $options)
10
    {
11
        /** @var User $user */
12
        $user = $options;
13
14
        return !UserManager::isPasswordValid($user->getPassword(), $value, $user->getSalt());
15
    }
16
}
17