Completed
Pull Request — master (#13)
by
unknown
07:15
created

ChangePassword   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 1
c 2
b 1
f 0
lcom 1
cbo 0
dl 0
loc 25
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A forUser() 0 7 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