This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
11
{
12
/**
13
* @var string
14
*/
15
private $name;
16
17
/**
18
* @var string
19
*/
20
private $email;
21
22
/**
23
* @param string $name
24
* @param string $email
25
*/
26
private function __construct($name, $email)
27
{
28
$this->name = $name;
29
$this->email = $email;
30
}
31
32
/**
33
* @param array $data
34
*
35
* @return
36
*/
37
public static function createFromArray(array $data)
38
{
39
$data = $data['data'];
40
41
return new self(isset($data['name']) ? $data['name']: '', $data['email']);
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.