38% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have
checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that
someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.
Loading history...
26
* @param \stdClass[] $values
27
* @return OrderElement[]
28
*/
29
public static function fromList(array $values)
30
{
31
$elements = array();
32
33
foreach ($values as $key => $value) {
34
$elements[$key] = self::fromValue($value);
35
}
36
37
return $elements;
38
}
39
40
/**
41
* @param \stdClass $value
42
* @return OrderElement
43
*/
44
public static function fromValue(\stdClass $value)
45
{
46
return new self($value);
47
}
48
49
/**
50
* @var \stdClass
51
*/
52
private $source;
53
54
/**
55
* @var \DateTimeInterface|null
56
*/
57
private $created;
58
59
/**
60
* @param \stdClass $source
61
*/
62
public function __construct(\stdClass $source)
63
{
64
$this->source = $source;
65
}
66
67
/**
68
* @return int
69
*/
70
public function getId()
71
{
72
return (int) $this->source->id;
73
}
74
75
/**
76
* @return \DateTime
77
*/
78
public function getCreated()
79
{
80
return $this->created ?: $this->created = new \DateTime($this->source->created);
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.