Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/Comments/CommentsPlugin.php')
-rw-r--r--apps/dav/lib/Comments/CommentsPlugin.php24
1 files changed, 10 insertions, 14 deletions
diff --git a/apps/dav/lib/Comments/CommentsPlugin.php b/apps/dav/lib/Comments/CommentsPlugin.php
index 55b0bdd4b40..ebdf3fde318 100644
--- a/apps/dav/lib/Comments/CommentsPlugin.php
+++ b/apps/dav/lib/Comments/CommentsPlugin.php
@@ -85,7 +85,7 @@ class CommentsPlugin extends ServerPlugin {
*/
function initialize(Server $server) {
$this->server = $server;
- if(strpos($this->server->getRequestUri(), 'comments/') !== 0) {
+ if (strpos($this->server->getRequestUri(), 'comments/') !== 0) {
return;
}
@@ -158,7 +158,7 @@ class CommentsPlugin extends ServerPlugin {
*/
public function onReport($reportName, $report, $uri) {
$node = $this->server->tree->getNodeForPath($uri);
- if(!$node instanceof EntityCollection || $reportName !== self::REPORT_NAME) {
+ if (!$node instanceof EntityCollection || $reportName !== self::REPORT_NAME) {
throw new ReportNotSupported();
}
$args = ['limit' => 0, 'offset' => 0, 'datetime' => null];
@@ -168,31 +168,30 @@ class CommentsPlugin extends ServerPlugin {
$this::REPORT_PARAM_TIMESTAMP
];
$ns = '{' . $this::NS_OWNCLOUD . '}';
- foreach($report as $parameter) {
- if(!in_array($parameter['name'], $acceptableParameters) || empty($parameter['value'])) {
+ foreach ($report as $parameter) {
+ if (!in_array($parameter['name'], $acceptableParameters) || empty($parameter['value'])) {
continue;
}
$args[str_replace($ns, '', $parameter['name'])] = $parameter['value'];
}
- if(!is_null($args['datetime'])) {
+ if (!is_null($args['datetime'])) {
$args['datetime'] = new \DateTime($args['datetime']);
}
$results = $node->findChildren($args['limit'], $args['offset'], $args['datetime']);
$responses = [];
- foreach($results as $node) {
+ foreach ($results as $node) {
$nodePath = $this->server->getRequestUri() . '/' . $node->comment->getId();
$resultSet = $this->server->getPropertiesForPath($nodePath, CommentNode::getPropertyNames());
- if(isset($resultSet[0]) && isset($resultSet[0][200])) {
+ if (isset($resultSet[0]) && isset($resultSet[0][200])) {
$responses[] = new Response(
$this->server->getBaseUri() . $nodePath,
[200 => $resultSet[0][200]],
200
);
}
-
}
$xml = $this->server->xml->write(
@@ -228,13 +227,13 @@ class CommentsPlugin extends ServerPlugin {
$actorType = $data['actorType'];
$actorId = null;
- if($actorType === 'users') {
+ if ($actorType === 'users') {
$user = $this->userSession->getUser();
- if(!is_null($user)) {
+ if (!is_null($user)) {
$actorId = $user->getUID();
}
}
- if(is_null($actorId)) {
+ if (is_null($actorId)) {
throw new BadRequest('Invalid actor "' . $actorType .'"');
}
@@ -251,7 +250,4 @@ class CommentsPlugin extends ServerPlugin {
throw new BadRequest($msg . \OCP\Comments\IComment::MAX_MESSAGE_LENGTH, 0, $e);
}
}
-
-
-
}