aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorHamid Dehnavi <hamid.dev.pro@gmail.com>2023-07-07 13:50:21 +0330
committerHamid Dehnavi <hamid.dev.pro@gmail.com>2023-09-28 12:18:41 +0330
commitd64bbc8bd3a6a272dd5c550916a6b80222f19e13 (patch)
tree1b56193c101e936e79478448c41af9b1f87521f5 /apps/dav
parent456aea80420d7d4fc8dc853d9953687ed3f89ace (diff)
downloadnextcloud-server-d64bbc8bd3a6a272dd5c550916a6b80222f19e13.tar.gz
nextcloud-server-d64bbc8bd3a6a272dd5c550916a6b80222f19e13.zip
Convert isset ternary to null coalescing operator
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/lib/Avatars/AvatarHome.php4
-rw-r--r--apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php4
2 files changed, 4 insertions, 4 deletions
diff --git a/apps/dav/lib/Avatars/AvatarHome.php b/apps/dav/lib/Avatars/AvatarHome.php
index ba52daeb2b3..097307f452f 100644
--- a/apps/dav/lib/Avatars/AvatarHome.php
+++ b/apps/dav/lib/Avatars/AvatarHome.php
@@ -59,8 +59,8 @@ class AvatarHome implements ICollection {
public function getChild($name) {
$elements = pathinfo($name);
- $ext = isset($elements['extension']) ? $elements['extension'] : '';
- $size = (int)(isset($elements['filename']) ? $elements['filename'] : '64');
+ $ext = $elements['extension'] ?? '';
+ $size = (int)($elements['filename'] ?? '64');
if (!in_array($ext, ['jpeg', 'png'], true)) {
throw new MethodNotAllowed('File format not allowed');
}
diff --git a/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php b/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php
index eb5d7d4661d..6a97cd30d9f 100644
--- a/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php
+++ b/apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php
@@ -62,8 +62,8 @@ class ShareRequest implements XmlDeserializable {
$set[] = [
'href' => $sharee['{DAV:}href'],
- 'commonName' => isset($sharee[$commonName]) ? $sharee[$commonName] : null,
- 'summary' => isset($sharee[$sumElem]) ? $sharee[$sumElem] : null,
+ 'commonName' => $sharee[$commonName] ?? null,
+ 'summary' => $sharee[$sumElem] ?? null,
'readOnly' => !array_key_exists('{' . Plugin::NS_OWNCLOUD . '}read-write', $sharee),
];
break;