Apply suggestions from code review

Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
This commit is contained in:
Michael Vogel 2021-08-12 18:04:01 +02:00 committed by GitHub
parent 81d9fc677f
commit fa65c436f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,7 +65,7 @@ class Item
$folders = []; $folders = [];
$first = true; $first = true;
$uid = ($item['uid'] != 0) ? $item['uid'] : $uid; $uid = $item['uid'] ?: $uid;
foreach (Post\Category::getArrayByURIId($item['uri-id'], $uid, Post\Category::CATEGORY) as $savedFolderName) { foreach (Post\Category::getArrayByURIId($item['uri-id'], $uid, Post\Category::CATEGORY) as $savedFolderName) {
if (!empty($item['author-link'])) { if (!empty($item['author-link'])) {
@ -76,7 +76,7 @@ class Item
$categories[] = [ $categories[] = [
'name' => $savedFolderName, 'name' => $savedFolderName,
'url' => $url, 'url' => $url,
'removeurl' => ((local_user() == $uid) ? 'filerm/' . $item['id'] . '?cat=' . rawurlencode($savedFolderName) : ""), 'removeurl' => local_user() == $uid ? 'filerm/' . $item['id'] . '?cat=' . rawurlencode($savedFolderName) : '',
'first' => $first, 'first' => $first,
'last' => false 'last' => false
]; ];
@ -92,7 +92,7 @@ class Item
$folders[] = [ $folders[] = [
'name' => $savedFolderName, 'name' => $savedFolderName,
'url' => "#", 'url' => "#",
'removeurl' => ((local_user() == $uid) ? 'filerm/' . $item['id'] . '?term=' . rawurlencode($savedFolderName) : ""), 'removeurl' => local_user() == $uid ? 'filerm/' . $item['id'] . '?term=' . rawurlencode($savedFolderName) : '',
'first' => $first, 'first' => $first,
'last' => false 'last' => false
]; ];