Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 2 |
CRAP Score | 1.512 |
Changes | 0 |
1 | <?php |
||
36 | 1 | public function getComments($sql, $params) |
|
37 | { |
||
38 | 1 | $comments = $this->findAllWhere("$sql", $params); |
|
39 | |||
40 | return array_map(function ($comment) { |
||
41 | $user = new User($this->db); |
||
42 | $comment->img = $user->getGravatar($comment->user); |
||
43 | $comment->markdown = $this->getMD($comment->text); |
||
44 | |||
45 | // Get votes for Post |
||
46 | $vote = new Vote($this->db); |
||
47 | $comment->vote = $vote->getVote("parentId = ? AND parentType = ?", [$comment->id, "comment"]); |
||
48 | |||
49 | return $comment; |
||
50 | }, $comments); |
||
51 | } |
||
52 | } |
||
53 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.