Skip to content
Snippets Groups Projects
Commit 20caa6fd authored by Hoop, Bert Jan de's avatar Hoop, Bert Jan de
Browse files

L05DOCBST-38 use assigment when appending to array

parent 4ae4baa1
No related branches found
No related tags found
No related merge requests found
......@@ -142,7 +142,7 @@ trait LoggerTrait {
*/
public function ndc_push(string $message){
array_push($this->ndc_context, $message);
$this->ndc_context[] = $message;
return $this;
}
......
......@@ -228,10 +228,10 @@ class Webquery {
if (is_array($query)) {
$result = [];
if (isset($wq_ofs)) {
array_push($result, "wq_ofs=$wq_ofs");
$result[] = "wq_ofs=$wq_ofs";
}
if (isset($wq_max)) {
array_push($result, "wq_max=$wq_max");
$result[] = "wq_max=$wq_max";
}
foreach ($query as $key => $value) {
# check for 'and not' exclamation mark before key
......@@ -239,7 +239,7 @@ class Webquery {
if ($is_wqnot) {
# remove exclamation mark from key
$key = substr($key, 1);
array_push($result, "wq_rel=AND+NOT");
$result[] = "wq_rel=AND+NOT";
}
# tread a single value as an array with one value
# one value is special case of key=val1&key=val2
......@@ -248,13 +248,13 @@ class Webquery {
# surround multiple OR values with parentheses if rel = and not
$use_open_close = $is_wqnot && count($values) > 1;
if ($use_open_close) {
array_push($result, "wq_par=open");
$result[] = "wq_par=open";
}
foreach ($values as $v) {
array_push($result, "$key=".rawurlencode($v));
$result[] = "$key=" . rawurlencode($v);
}
if ($use_open_close) {
array_push($result, "wq_par=close");
$result[] = "wq_par=close";
}
}
return implode("&", $result);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment