Both the $myVar assignment in line 1 and the $higher assignment in line 2
are dead. The first because $myVar is never used and the second because
$higher is always overwritten for every possible time line.
Loading history...
13
}
14
15
16
/**
17
* @param $user
18
* @param $survey_id
19
* @param $survey_vote_id
20
* @param $user_name_safe
21
*/
22
public static function db_survey_vote_insert(&$user, $survey_id, $survey_vote_id, $user_name_safe) {
23
doquery("INSERT INTO {{survey_votes}} SET `survey_parent_id` = {$survey_id}, `survey_parent_answer_id` = {$survey_vote_id}, `survey_vote_user_id` = {$user['id']}, `survey_vote_user_name` = '{$user_name_safe}';");
24
}
25
26
27
/**
28
* @param $user
29
* @param $survey_id
30
*
31
* @return array|bool|mysqli_result|null
32
*/
33
public static function db_survey_vote_get(&$user, $survey_id) {
34
$is_voted = doquery("SELECT `survey_vote_id` FROM `{{survey_votes}}` WHERE survey_parent_id = {$survey_id} AND survey_vote_user_id = {$user['id']} FOR UPDATE;", true);
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: