diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-01-25 23:06:53 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2018-01-26 11:35:42 +0100 |
commit | c1e4f9f30563d5eda1718d716d631d6092cd4e28 (patch) | |
tree | 3bb7b6ef891cd80895d4c2c92252a4ccbc0c0cee /apps/dav | |
parent | fe7e726ab228e6ddde7cf1442de9d0db193334a1 (diff) | |
download | nextcloud-server-c1e4f9f30563d5eda1718d716d631d6092cd4e28.tar.gz nextcloud-server-c1e4f9f30563d5eda1718d716d631d6092cd4e28.zip |
Use type casting instead of *val() method
It should be up to 6x faster
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/dav')
5 files changed, 7 insertions, 7 deletions
diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php index 5fc38315438..bac661b6722 100644 --- a/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php +++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php @@ -40,6 +40,6 @@ class LimitFilter implements XmlDeserializable { throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}limit has illegal value'); } - return intval($value); + return (int)$value; } }
\ No newline at end of file diff --git a/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php b/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php index 7aac59809a2..8ced850bbc0 100644 --- a/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php +++ b/apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php @@ -40,6 +40,6 @@ class OffsetFilter implements XmlDeserializable { throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}offset has illegal value'); } - return intval($value); + return (int)$value; } }
\ No newline at end of file diff --git a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php index ac625c3a9a4..58469d27205 100644 --- a/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php @@ -97,7 +97,7 @@ class CommentPropertiesPlugin extends ServerPlugin { } $propFind->handle(self::PROPERTY_NAME_COUNT, function() use ($node) { - return $this->commentsManager->getNumberOfCommentsForObject('files', strval($node->getId())); + return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId()); }); $propFind->handle(self::PROPERTY_NAME_HREF, function() use ($node) { @@ -153,9 +153,9 @@ class CommentPropertiesPlugin extends ServerPlugin { return null; } - $lastRead = $this->commentsManager->getReadMark('files', strval($node->getId()), $user); + $lastRead = $this->commentsManager->getReadMark('files', (string)$node->getId(), $user); - return $this->commentsManager->getNumberOfCommentsForObject('files', strval($node->getId()), $lastRead); + return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId(), $lastRead); } } diff --git a/apps/dav/lib/Connector/Sabre/Node.php b/apps/dav/lib/Connector/Sabre/Node.php index b8a8209129c..fd237b604a9 100644 --- a/apps/dav/lib/Connector/Sabre/Node.php +++ b/apps/dav/lib/Connector/Sabre/Node.php @@ -369,7 +369,7 @@ abstract class Node implements \Sabre\DAV\INode { throw new \InvalidArgumentException('X-OC-MTime header must be an integer (unix timestamp).'); } - return intval($mtimeFromRequest); + return (int)$mtimeFromRequest; } } diff --git a/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php b/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php index c76ab832b14..eb4b3a7c9e6 100644 --- a/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php +++ b/apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php @@ -60,7 +60,7 @@ class SystemTagsRelationsCollection extends SimpleCollection { $userSession, $groupManager, function($name) { - $nodes = \OC::$server->getUserFolder()->getById(intval($name)); + $nodes = \OC::$server->getUserFolder()->getById((int)$name); return !empty($nodes); } ), |