| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | 10 | public function getComments($sql, $params) |
|
| 37 | { |
||
| 38 | 10 | $comments = $this->findAllWhere("$sql", $params); |
|
| 39 | |||
| 40 | 10 | return array_map(function ($comment) { |
|
| 41 | 9 | $user = new User($this->db); |
|
| 42 | 9 | $comment->img = $user->getGravatar($comment->user); |
|
| 43 | 9 | $comment->markdown = $this->getMD($comment->text); |
|
| 44 | |||
| 45 | // Get votes for Post |
||
| 46 | 9 | $vote = new Vote($this->db); |
|
| 47 | 9 | $comment->vote = $vote->getVote("parentId = ? AND parentType = ?", [$comment->id, "comment"]); |
|
| 48 | |||
| 49 | 9 | return $comment; |
|
| 50 | 10 | }, $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
$irelandis not defined by the methodfinale(...).The most likely cause is that the parameter was changed, but the annotation was not.