Total Complexity | 7 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
22 | final class DocRefsArray { |
||
23 | use Extension\TProperty; |
||
24 | |||
25 | private $id; |
||
26 | private $revs; |
||
27 | |||
28 | |||
29 | /** |
||
30 | * @brief Adds a document revision reference. |
||
31 | * @param string $value A document revision. |
||
32 | */ |
||
33 | public function addRev($value) { |
||
34 | $this->revs[] = $value; |
||
35 | } |
||
36 | |||
37 | |||
38 | /** |
||
39 | * @brief Returns a document reference. |
||
40 | * @retval array An associative array |
||
41 | */ |
||
42 | public function asArray() { |
||
43 | $ref = []; |
||
44 | $ref[$this->id] = $this->revs; |
||
45 | return $ref; |
||
46 | } |
||
47 | |||
48 | |||
49 | //! @cond HIDDEN_SYMBOLS |
||
50 | |||
51 | public function getId() { |
||
52 | return $this->id; |
||
53 | } |
||
54 | |||
55 | |||
56 | public function issetId() { |
||
58 | } |
||
59 | |||
60 | |||
61 | public function setId($value) { |
||
62 | if (!empty($value)) |
||
63 | $this->id = (string)$value; |
||
64 | else |
||
65 | throw new \Exception("\$id must be a non-empty string."); |
||
66 | } |
||
67 | |||
68 | |||
69 | public function unsetId() { |
||
71 | } |
||
72 | |||
73 | //! @endcond |
||
|
|||
74 | |||
75 | } |
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.