Conditions | 1 |
Paths | 1 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
49 | 5 | public function getComments($sql, $params) |
|
50 | 5 | { |
|
51 | $posts = $this->findAllWhere("$sql", $params); |
||
52 | |||
53 | return array_map(function ($post) { |
||
54 | $user = new User(); |
||
55 | $user->setDb($this->di->get("db")); |
||
56 | $user->find("name", $post->user); |
||
57 | |||
58 | 4 | ||
59 | $post->comments = $this->getPosts("parentId = ? AND type = ?", [$post->id, "comment"]); |
||
60 | 4 | $post->tags = explode(',', $post->tags); |
|
61 | |||
62 | 4 | $post->img = $this->gravatar($user->email); |
|
63 | 4 | $post->markdown = $this->getMD($post->text); |
|
64 | 4 | ||
65 | 4 | return $post; |
|
66 | }, $posts); |
||
67 | } |
||
68 | } |
||
69 |
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.