diff options
author | Faraz Samapoor <fsamapoor@gmail.com> | 2023-05-15 15:17:19 +0330 |
---|---|---|
committer | Faraz Samapoor <fsamapoor@gmail.com> | 2023-05-15 15:17:19 +0330 |
commit | e7cc7653b885c49b1b3f0a78f91ea05a53e102d8 (patch) | |
tree | 42da61d5c6e988d7c9eff7e081327a73f661dc89 /lib/private/Comments | |
parent | 8bdb50fd507bfe68161ab98eba903872083ea4f3 (diff) | |
download | nextcloud-server-e7cc7653b885c49b1b3f0a78f91ea05a53e102d8.tar.gz nextcloud-server-e7cc7653b885c49b1b3f0a78f91ea05a53e102d8.zip |
Refactors "strpos" calls in lib/private to improve code readability.
Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
Diffstat (limited to 'lib/private/Comments')
-rw-r--r-- | lib/private/Comments/Comment.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Comments/Comment.php b/lib/private/Comments/Comment.php index f9e5c166872..4284beb3fcc 100644 --- a/lib/private/Comments/Comment.php +++ b/lib/private/Comments/Comment.php @@ -240,9 +240,9 @@ class Comment implements IComment { $result = []; foreach ($mentionIds as $mentionId) { $cleanId = trim(substr($mentionId, 1), '"'); - if (strpos($cleanId, 'guest/') === 0) { + if (str_starts_with($cleanId, 'guest/')) { $result[] = ['type' => 'guest', 'id' => $cleanId]; - } elseif (strpos($cleanId, 'group/') === 0) { + } elseif (str_starts_with($cleanId, 'group/')) { $result[] = ['type' => 'group', 'id' => substr($cleanId, 6)]; } else { $result[] = ['type' => 'user', 'id' => $cleanId]; |