Completed
Pull Request — master (#13)
by
unknown
03:06
created

ChangePassword::forUser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
namespace SumoCoders\FrameworkMultiUserBundle\DataTransferObject\Form;
4
5
use SumoCoders\FrameworkMultiUserBundle\User\UserInterface as UserEntityInterface;
6
use Symfony\Component\Validator\Constraints as Assert;
7
8
class ChangePassword
9
{
10
    /**
11
     * @var string
12
     *
13
     * @Assert\Length(
14
     *     min = 6,
15
     *     minMessage = "sumocoders.multiuserbundle.form.length"
16
     * )
17
     */
18
    public $newPassword;
19
20
    /**
21
     * @var UserInterface
22
     */
23
    public $user;
24
25
    public static function forUser(UserEntityInterface $user)
26
    {
27
        $dataTransferObject = new self();
28
        $dataTransferObject->user = $user;
0 ignored issues
show
Documentation Bug introduced by
It seems like $user of type object<SumoCoders\Framew...dle\User\UserInterface> is incompatible with the declared type object<SumoCoders\Framew...ect\Form\UserInterface> of property $user.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
29
30
        return $dataTransferObject;
31
    }
32
}
33