diff options
author | Faraz Samapoor <f.samapoor@gmail.com> | 2023-06-02 15:38:19 +0330 |
---|---|---|
committer | Simon L <szaimen@e.mail.de> | 2023-06-12 09:46:07 +0200 |
commit | 0bae21b1d1709e136a580b4ef2dc3cc725ca27b8 (patch) | |
tree | d86d68c9c2a7f70260863d62d7cd9c6af270e7ca /apps/dav/lib/Comments | |
parent | c93be182dc0172eed377ba70ce54cd7c83689764 (diff) | |
download | nextcloud-server-0bae21b1d1709e136a580b4ef2dc3cc725ca27b8.tar.gz nextcloud-server-0bae21b1d1709e136a580b4ef2dc3cc725ca27b8.zip |
Refactors "strpos" calls in /apps/dav to improve code readability.
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
Diffstat (limited to 'apps/dav/lib/Comments')
-rw-r--r-- | apps/dav/lib/Comments/CommentNode.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/Comments/CommentsPlugin.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/apps/dav/lib/Comments/CommentNode.php b/apps/dav/lib/Comments/CommentNode.php index b41dbc276e8..332c0e2d4d8 100644 --- a/apps/dav/lib/Comments/CommentNode.php +++ b/apps/dav/lib/Comments/CommentNode.php @@ -79,7 +79,7 @@ class CommentNode implements \Sabre\DAV\INode, \Sabre\DAV\IProperties { $methods = get_class_methods($this->comment); $methods = array_filter($methods, function ($name) { - return strpos($name, 'get') === 0; + return str_starts_with($name, 'get'); }); foreach ($methods as $getter) { if ($getter === 'getMentions') { diff --git a/apps/dav/lib/Comments/CommentsPlugin.php b/apps/dav/lib/Comments/CommentsPlugin.php index f31e479c212..bb07217a0ab 100644 --- a/apps/dav/lib/Comments/CommentsPlugin.php +++ b/apps/dav/lib/Comments/CommentsPlugin.php @@ -85,7 +85,7 @@ class CommentsPlugin extends ServerPlugin { */ public function initialize(Server $server) { $this->server = $server; - if (strpos($this->server->getRequestUri(), 'comments/') !== 0) { + if (!str_starts_with($this->server->getRequestUri(), 'comments/')) { return; } |