From 5573029485f7ecea806d3c58f6f0204c2e0651ad Mon Sep 17 00:00:00 2001
From: Scrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com>
Date: Fri, 20 Nov 2015 15:42:34 +0000
Subject: [PATCH] Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
---
 apps/dav/lib/caldav/caldavbackend.php                  |  7 +++----
 apps/dav/lib/carddav/carddavbackend.php                |  6 +++---
 apps/dav/lib/connector/sabre/auth.php                  |  2 +-
 apps/dav/lib/connector/sabre/fakelockerplugin.php      |  4 ++--
 apps/dav/lib/connector/sabre/file.php                  | 10 ++++++++--
 apps/dav/lib/connector/sabre/lockplugin.php            |  1 -
 apps/dav/lib/connector/sabre/node.php                  |  6 +++---
 apps/dav/lib/connector/sabre/principal.php             |  2 +-
 apps/dav/tests/unit/connector/sabre/file.php           |  5 ++++-
 apps/dav/tests/unit/connector/sabre/filesplugin.php    |  3 +++
 .../tests/unit/connector/sabre/requesttest/auth.php    |  4 ++--
 11 files changed, 30 insertions(+), 20 deletions(-)

diff --git a/apps/dav/lib/caldav/caldavbackend.php b/apps/dav/lib/caldav/caldavbackend.php
index 08a2a70c56..9933865079 100644
--- a/apps/dav/lib/caldav/caldavbackend.php
+++ b/apps/dav/lib/caldav/caldavbackend.php
@@ -217,7 +217,6 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
 	 *
 	 * Read the PropPatch documentation for more info and examples.
 	 *
-	 * @param string $path
 	 * @param \Sabre\DAV\PropPatch $propPatch
 	 * @return void
 	 */
@@ -375,7 +374,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
 	 * If the backend supports this, it may allow for some speed-ups.
 	 *
 	 * @param mixed $calendarId
-	 * @param array $uris
+	 * @param string[] $uris
 	 * @return array
 	 */
 	function getMultipleCalendarObjects($calendarId, array $uris) {
@@ -422,7 +421,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
 	 * @param mixed $calendarId
 	 * @param string $objectUri
 	 * @param string $calendarData
-	 * @return string|null
+	 * @return string
 	 */
 	function createCalendarObject($calendarId, $objectUri, $calendarData) {
 		$extraData = $this->getDenormalizedData($calendarData);
@@ -464,7 +463,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
 	 * @param mixed $calendarId
 	 * @param string $objectUri
 	 * @param string $calendarData
-	 * @return string|null
+	 * @return string
 	 */
 	function updateCalendarObject($calendarId, $objectUri, $calendarData) {
 		$extraData = $this->getDenormalizedData($calendarData);
diff --git a/apps/dav/lib/carddav/carddavbackend.php b/apps/dav/lib/carddav/carddavbackend.php
index 348c166a53..daa31725fa 100644
--- a/apps/dav/lib/carddav/carddavbackend.php
+++ b/apps/dav/lib/carddav/carddavbackend.php
@@ -343,7 +343,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
 	 * If the backend supports this, it may allow for some speed-ups.
 	 *
 	 * @param mixed $addressBookId
-	 * @param array $uris
+	 * @param string[] $uris
 	 * @return array
 	 */
 	function getMultipleCards($addressBookId, array $uris) {
@@ -390,7 +390,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
 	 * @param mixed $addressBookId
 	 * @param string $cardUri
 	 * @param string $cardData
-	 * @return string|null
+	 * @return string
 	 */
 	function createCard($addressBookId, $cardUri, $cardData) {
 		$etag = md5($cardData);
@@ -435,7 +435,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
 	 * @param mixed $addressBookId
 	 * @param string $cardUri
 	 * @param string $cardData
-	 * @return string|null
+	 * @return string
 	 */
 	function updateCard($addressBookId, $cardUri, $cardData) {
 
diff --git a/apps/dav/lib/connector/sabre/auth.php b/apps/dav/lib/connector/sabre/auth.php
index 0394bfd677..f9a3979904 100644
--- a/apps/dav/lib/connector/sabre/auth.php
+++ b/apps/dav/lib/connector/sabre/auth.php
@@ -150,7 +150,7 @@ class Auth extends AbstractBasic {
 
 	/**
 	 * @param \Sabre\DAV\Server $server
-	 * @param $realm
+	 * @param string $realm
 	 * @return bool
 	 */
 	private function auth(\Sabre\DAV\Server $server, $realm) {
diff --git a/apps/dav/lib/connector/sabre/fakelockerplugin.php b/apps/dav/lib/connector/sabre/fakelockerplugin.php
index 493d3b0ade..b9d1a30a04 100644
--- a/apps/dav/lib/connector/sabre/fakelockerplugin.php
+++ b/apps/dav/lib/connector/sabre/fakelockerplugin.php
@@ -59,7 +59,7 @@ class FakeLockerPlugin extends ServerPlugin {
 	 * Indicate that we support LOCK and UNLOCK
 	 *
 	 * @param string $path
-	 * @return array
+	 * @return string[]
 	 */
 	public function getHTTPMethods($path) {
 		return [
@@ -71,7 +71,7 @@ class FakeLockerPlugin extends ServerPlugin {
 	/**
 	 * Indicate that we support locking
 	 *
-	 * @return array
+	 * @return integer[]
 	 */
 	function getFeatures() {
 		return [2];
diff --git a/apps/dav/lib/connector/sabre/file.php b/apps/dav/lib/connector/sabre/file.php
index a0c35fb2ba..ef7b9891dc 100644
--- a/apps/dav/lib/connector/sabre/file.php
+++ b/apps/dav/lib/connector/sabre/file.php
@@ -213,6 +213,9 @@ class File extends Node implements IFile {
 		return '"' . $this->info->getEtag() . '"';
 	}
 
+	/**
+	 * @param string $path
+	 */
 	private function emitPreHooks($exists, $path = null) {
 		if (is_null($path)) {
 			$path = $this->path;
@@ -238,6 +241,9 @@ class File extends Node implements IFile {
 		return $run;
 	}
 
+	/**
+	 * @param string $path
+	 */
 	private function emitPostHooks($exists, $path = null) {
 		if (is_null($path)) {
 			$path = $this->path;
@@ -260,7 +266,7 @@ class File extends Node implements IFile {
 	/**
 	 * Returns the data
 	 *
-	 * @return string|resource
+	 * @return resource
 	 * @throws Forbidden
 	 * @throws ServiceUnavailable
 	 */
@@ -314,7 +320,7 @@ class File extends Node implements IFile {
 	 *
 	 * If null is returned, we'll assume application/octet-stream
 	 *
-	 * @return mixed
+	 * @return string
 	 */
 	public function getContentType() {
 		$mimeType = $this->info->getMimetype();
diff --git a/apps/dav/lib/connector/sabre/lockplugin.php b/apps/dav/lib/connector/sabre/lockplugin.php
index 8032d2b3fb..d770b141eb 100644
--- a/apps/dav/lib/connector/sabre/lockplugin.php
+++ b/apps/dav/lib/connector/sabre/lockplugin.php
@@ -27,7 +27,6 @@ use OCP\Lock\ILockingProvider;
 use OCP\Lock\LockedException;
 use Sabre\DAV\Exception\NotFound;
 use Sabre\DAV\ServerPlugin;
-use Sabre\DAV\Tree;
 use Sabre\HTTP\RequestInterface;
 
 class LockPlugin extends ServerPlugin {
diff --git a/apps/dav/lib/connector/sabre/node.php b/apps/dav/lib/connector/sabre/node.php
index daf82ba6f0..c4e0614077 100644
--- a/apps/dav/lib/connector/sabre/node.php
+++ b/apps/dav/lib/connector/sabre/node.php
@@ -178,7 +178,7 @@ abstract class Node implements \Sabre\DAV\INode {
 	/**
 	 * Returns the size of the node, in bytes
 	 *
-	 * @return int|float
+	 * @return integer
 	 */
 	public function getSize() {
 		return $this->info->getSize();
@@ -207,14 +207,14 @@ abstract class Node implements \Sabre\DAV\INode {
 	}
 
 	/**
-	 * @return string
+	 * @return integer
 	 */
 	public function getInternalFileId() {
 		return $this->info->getId();
 	}
 
 	/**
-	 * @return string|null
+	 * @return string
 	 */
 	public function getDavPermissions() {
 		$p = '';
diff --git a/apps/dav/lib/connector/sabre/principal.php b/apps/dav/lib/connector/sabre/principal.php
index 35215e1f63..7fb14c031f 100644
--- a/apps/dav/lib/connector/sabre/principal.php
+++ b/apps/dav/lib/connector/sabre/principal.php
@@ -168,7 +168,7 @@ class Principal implements \Sabre\DAVACL\PrincipalBackend\BackendInterface {
 	 * The principals should be passed as a list of uri's.
 	 *
 	 * @param string $principal
-	 * @param array $members
+	 * @param string[] $members
 	 * @throws \Sabre\DAV\Exception
 	 */
 	public function setGroupMemberSet($principal, array $members) {
diff --git a/apps/dav/tests/unit/connector/sabre/file.php b/apps/dav/tests/unit/connector/sabre/file.php
index 399634f8be..0a52299cec 100644
--- a/apps/dav/tests/unit/connector/sabre/file.php
+++ b/apps/dav/tests/unit/connector/sabre/file.php
@@ -41,6 +41,9 @@ class File extends \Test\TestCase {
 		parent::tearDown();
 	}
 
+	/**
+	 * @param string $string
+	 */
 	private function getStream($string) {
 		$stream = fopen('php://temp', 'r+');
 		fwrite($stream, $string);
@@ -239,7 +242,7 @@ class File extends \Test\TestCase {
 	 * @param string $path path to put the file into
 	 * @param string $viewRoot root to use for the view
 	 *
-	 * @return result of the PUT operaiton which is usually the etag
+	 * @return null|string of the PUT operaiton which is usually the etag
 	 */
 	private function doPut($path, $viewRoot = null) {
 		$view = \OC\Files\Filesystem::getView();
diff --git a/apps/dav/tests/unit/connector/sabre/filesplugin.php b/apps/dav/tests/unit/connector/sabre/filesplugin.php
index 2e3338fefa..b33c8340f7 100644
--- a/apps/dav/tests/unit/connector/sabre/filesplugin.php
+++ b/apps/dav/tests/unit/connector/sabre/filesplugin.php
@@ -55,6 +55,9 @@ class FilesPlugin extends \Test\TestCase {
 		$this->plugin->initialize($this->server);
 	}
 
+	/**
+	 * @param string $class
+	 */
 	private function createTestNode($class) {
 		$node = $this->getMockBuilder($class)
 			->disableOriginalConstructor()
diff --git a/apps/dav/tests/unit/connector/sabre/requesttest/auth.php b/apps/dav/tests/unit/connector/sabre/requesttest/auth.php
index 41b554d11d..02b64ab070 100644
--- a/apps/dav/tests/unit/connector/sabre/requesttest/auth.php
+++ b/apps/dav/tests/unit/connector/sabre/requesttest/auth.php
@@ -41,7 +41,7 @@ class Auth implements BackendInterface {
 	 *
 	 * @param \Sabre\DAV\Server $server
 	 * @param string $realm
-	 * @return bool
+	 * @return boolean|null
 	 */
 	function authenticate(\Sabre\DAV\Server $server, $realm) {
 		$userSession = \OC::$server->getUserSession();
@@ -61,7 +61,7 @@ class Auth implements BackendInterface {
 	 *
 	 * If nobody is currently logged in, this method should return null.
 	 *
-	 * @return string|null
+	 * @return string
 	 */
 	function getCurrentUser() {
 		return $this->user;
-- 
GitLab