| Conditions | 6 |
| Paths | 17 |
| Total Lines | 29 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public function getAnswersByQuestions(array $answers) |
||
| 17 | { |
||
| 18 | if (empty($answers)) { |
||
| 19 | return; |
||
| 20 | } |
||
| 21 | |||
| 22 | $where = ''; |
||
| 23 | foreach ($answers as $key => $value) { |
||
| 24 | $where .= ' OR question_id = :question_id_'.md5($value['id']); |
||
| 25 | } |
||
| 26 | |||
| 27 | $stmt = $this->db->prepare('SELECT * FROM answers WHERE '.trim($where, ' OR ')); |
||
| 28 | foreach ($answers as $key => $value) { |
||
| 29 | $stmt->bindValue(':question_id_'.md5($value['id']), $value['id'], PDO::PARAM_INT); |
||
| 30 | } |
||
| 31 | |||
| 32 | $stmt->execute(); |
||
| 33 | |||
| 34 | $array = []; |
||
| 35 | foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $key => $value) { |
||
| 36 | $array[$value['question_id']][] = $value; |
||
| 37 | } |
||
| 38 | |||
| 39 | if (!isset($array)) { |
||
| 40 | return; |
||
| 41 | } |
||
| 42 | |||
| 43 | return $array; |
||
| 44 | } |
||
| 45 | |||
| 62 |
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.