Skip to content

Commit

Permalink
Merge branch 'devel' of github.com:Klap-in/dokuwiki-plugin-pluginrepo…
Browse files Browse the repository at this point in the history
… into devel
  • Loading branch information
Klap-in committed Jan 31, 2024
2 parents 1811184 + a6c8d3c commit 2ce3281
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
11 changes: 4 additions & 7 deletions classes/Spyc.php
Original file line number Diff line number Diff line change
Expand Up @@ -921,8 +921,7 @@ private function addArray($incoming_data, $incoming_indent)
$this->result[$key] = $value;
} else {
$this->result[] = $value;
end($this->result);
$key = key($this->result);
$key = array_key_last($this->result);
}
$this->path[$incoming_indent] = $key;
return;
Expand Down Expand Up @@ -960,8 +959,7 @@ private function addArray($incoming_data, $incoming_indent)
$key = 0;
} else {
$_arr[] = $value;
end($_arr);
$key = key($_arr);
$key = array_key_last($_arr);
}

$reverse_path = array_reverse($this->path);
Expand Down Expand Up @@ -1070,8 +1068,7 @@ private function getParentPathByIndent($indent)
}
$linePath = $this->path;
do {
end($linePath);
$lastIndentInParentPath = key($linePath);
$lastIndentInParentPath = array_key_last($linePath);
if ($indent <= $lastIndentInParentPath) {
array_pop($linePath);
}
Expand Down Expand Up @@ -1145,7 +1142,7 @@ private function returnMappedSequence($line)
$array = [];
$key = self::unquote(trim(substr($line, 1, -1)));
$array[$key] = [];
$this->delayedPath = [strpos($line, $key) + $this->indent => $key];
$this->delayedPath = [strpos($line, (string) $key) + $this->indent => $key];
return [$array];
}

Expand Down
4 changes: 1 addition & 3 deletions syntax/query.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,7 @@ public function render($format, Doku_Renderer $renderer, $data)
$values = explode(",", $data['values']);
$values = array_map('trim', $values);
$values = array_filter($values);
$values = array_map(function ($value) use ($datePlaceholders, $recentDates) {
return str_replace($datePlaceholders, $recentDates, $value);
}, $values);
$values = array_map(static fn($value) => str_replace($datePlaceholders, $recentDates, $value), $values);
if (!$values && array_key_exists('values', $data)) {
$values = [''];
}
Expand Down

0 comments on commit 2ce3281

Please sign in to comment.