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...
10
{
11
/**
12
* @var Id
13
*/
14
private $id;
15
16
/**
17
* @var DateTimeInterface
18
*/
19
private $created;
20
21
/**
22
* @var DateTimeInterface
23
*/
24
private $updated;
25
26
/**
27
* @var string
28
*/
29
private $certificate;
30
31
/**
32
* @string
33
*/
34
private function __construct(string $certificate)
35
{
36
$this->certificate = $certificate;
37
}
38
39
/**
40
* @param string $certificate
41
* @return Certificate
42
*/
43
public static function fromString(string $certificate)
44
{
45
return new self($certificate);
46
}
47
48
/**
49
* @param array $value
50
* @return Certificate
51
*/
52
public static function fromArray($value)
53
{
54
$timezone = new DateTimeZone('UTC');
55
$cert = new Certificate($value['certificate_chain']);
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.