summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-07-19 19:44:10 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-08-01 08:20:16 +0200
commitdfd8125aeb4a95df20041890dcffd50ba2592fee (patch)
treec9c9aaf0b7c4e2244b0d5752576453080acddf7e /lib/public
parent10414d2e7d9f5605057d7432e899829bc5ba1dcd (diff)
downloadnextcloud-server-dfd8125aeb4a95df20041890dcffd50ba2592fee.tar.gz
nextcloud-server-dfd8125aeb4a95df20041890dcffd50ba2592fee.zip
Replace wrong PHPDocs
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/App/ManagerEvent.php4
-rw-r--r--lib/public/AppFramework/ApiController.php2
-rw-r--r--lib/public/AppFramework/Http/OCSResponse.php1
-rw-r--r--lib/public/AppFramework/Http/Response.php2
-rw-r--r--lib/public/Comments/ICommentsManager.php4
-rw-r--r--lib/public/DB.php2
-rw-r--r--lib/public/Diagnostics/IQueryLogger.php4
-rw-r--r--lib/public/Encryption/Exceptions/GenericEncryptionException.php2
-rw-r--r--lib/public/Files/ForbiddenException.php2
-rw-r--r--lib/public/Files/Storage.php8
-rw-r--r--lib/public/Files/Storage/IStorage.php8
-rw-r--r--lib/public/Files/StorageAuthException.php5
-rw-r--r--lib/public/Files/StorageBadConfigException.php5
-rw-r--r--lib/public/Files/StorageConnectionException.php5
-rw-r--r--lib/public/Files/StorageNotAvailableException.php2
-rw-r--r--lib/public/Files/StorageTimeoutException.php5
-rw-r--r--lib/public/IDateTimeFormatter.php30
-rw-r--r--lib/public/Lock/LockedException.php2
-rw-r--r--lib/public/Response.php1
-rw-r--r--lib/public/Search/PagedProvider.php2
-rw-r--r--lib/public/Share.php4
-rw-r--r--lib/public/Share/Exceptions/GenericShareException.php2
-rw-r--r--lib/public/SystemTag/ManagerEvent.php2
-rw-r--r--lib/public/SystemTag/TagNotFoundException.php2
24 files changed, 51 insertions, 55 deletions
diff --git a/lib/public/App/ManagerEvent.php b/lib/public/App/ManagerEvent.php
index b25ea55aee6..c983114fe75 100644
--- a/lib/public/App/ManagerEvent.php
+++ b/lib/public/App/ManagerEvent.php
@@ -45,7 +45,7 @@ class ManagerEvent extends Event {
protected $event;
/** @var string */
protected $appID;
- /** @var \OCP\IGroup[] */
+ /** @var \OCP\IGroup[]|null */
protected $groups;
/**
@@ -53,7 +53,7 @@ class ManagerEvent extends Event {
*
* @param string $event
* @param $appID
- * @param \OCP\IGroup[] $groups
+ * @param \OCP\IGroup[]|null $groups
* @since 9.0.0
*/
public function __construct($event, $appID, array $groups = null) {
diff --git a/lib/public/AppFramework/ApiController.php b/lib/public/AppFramework/ApiController.php
index 857cb19101a..243ab1846ba 100644
--- a/lib/public/AppFramework/ApiController.php
+++ b/lib/public/AppFramework/ApiController.php
@@ -88,7 +88,7 @@ abstract class ApiController extends Controller {
$response = new Response();
$response->addHeader('Access-Control-Allow-Origin', $origin);
$response->addHeader('Access-Control-Allow-Methods', $this->corsMethods);
- $response->addHeader('Access-Control-Max-Age', $this->corsMaxAge);
+ $response->addHeader('Access-Control-Max-Age', (string)$this->corsMaxAge);
$response->addHeader('Access-Control-Allow-Headers', $this->corsAllowedHeaders);
$response->addHeader('Access-Control-Allow-Credentials', 'false');
return $response;
diff --git a/lib/public/AppFramework/Http/OCSResponse.php b/lib/public/AppFramework/Http/OCSResponse.php
index cfda8ea4f75..8614e76805f 100644
--- a/lib/public/AppFramework/Http/OCSResponse.php
+++ b/lib/public/AppFramework/Http/OCSResponse.php
@@ -80,6 +80,7 @@ class OCSResponse extends Response {
* @return string
* @since 8.1.0
* @deprecated 9.2.0 To implement an OCS endpoint extend the OCSController
+ * @suppress PhanDeprecatedClass
*/
public function render() {
$r = new \OC_OCS_Result($this->data, $this->statuscode, $this->message);
diff --git a/lib/public/AppFramework/Http/Response.php b/lib/public/AppFramework/Http/Response.php
index 087522386be..c3b81d2baf7 100644
--- a/lib/public/AppFramework/Http/Response.php
+++ b/lib/public/AppFramework/Http/Response.php
@@ -228,7 +228,7 @@ class Response {
/**
* By default renders no output
- * @return null
+ * @return string|null
* @since 6.0.0
*/
public function render() {
diff --git a/lib/public/Comments/ICommentsManager.php b/lib/public/Comments/ICommentsManager.php
index f088ad9f70d..61633af95cd 100644
--- a/lib/public/Comments/ICommentsManager.php
+++ b/lib/public/Comments/ICommentsManager.php
@@ -104,7 +104,7 @@ interface ICommentsManager {
* @param int $limit optional, number of maximum comments to be returned. if
* not specified, all comments are returned.
* @param int $offset optional, starting point
- * @param \DateTime $notOlderThan optional, timestamp of the oldest comments
+ * @param \DateTime|null $notOlderThan optional, timestamp of the oldest comments
* that may be returned
* @return IComment[]
* @since 9.0.0
@@ -120,7 +120,7 @@ interface ICommentsManager {
/**
* @param $objectType string the object type, e.g. 'files'
* @param $objectId string the id of the object
- * @param \DateTime $notOlderThan optional, timestamp of the oldest comments
+ * @param \DateTime|null $notOlderThan optional, timestamp of the oldest comments
* that may be returned
* @return Int
* @since 9.0.0
diff --git a/lib/public/DB.php b/lib/public/DB.php
index 5018392f650..645f77076db 100644
--- a/lib/public/DB.php
+++ b/lib/public/DB.php
@@ -90,7 +90,7 @@ class DB {
* @since 4.5.0
*/
public static function insertid($table=null) {
- return \OC::$server->getDatabaseConnection()->lastInsertId($table);
+ return (string)\OC::$server->getDatabaseConnection()->lastInsertId($table);
}
/**
diff --git a/lib/public/Diagnostics/IQueryLogger.php b/lib/public/Diagnostics/IQueryLogger.php
index 32723a56cb9..4e45fa33d9d 100644
--- a/lib/public/Diagnostics/IQueryLogger.php
+++ b/lib/public/Diagnostics/IQueryLogger.php
@@ -39,8 +39,8 @@ interface IQueryLogger extends SQLLogger {
* query is finished finalized with stopQuery() method.
*
* @param string $sql
- * @param array $params
- * @param array $types
+ * @param array|null $params
+ * @param array|null $types
* @since 8.0.0
*/
public function startQuery($sql, array $params = null, array $types = null);
diff --git a/lib/public/Encryption/Exceptions/GenericEncryptionException.php b/lib/public/Encryption/Exceptions/GenericEncryptionException.php
index ac880c43067..7515d9c368d 100644
--- a/lib/public/Encryption/Exceptions/GenericEncryptionException.php
+++ b/lib/public/Encryption/Exceptions/GenericEncryptionException.php
@@ -39,7 +39,7 @@ class GenericEncryptionException extends HintException {
* @param string $message
* @param string $hint
* @param int $code
- * @param \Exception $previous
+ * @param \Exception|null $previous
* @since 8.1.0
*/
public function __construct($message = '', $hint = '', $code = 0, \Exception $previous = null) {
diff --git a/lib/public/Files/ForbiddenException.php b/lib/public/Files/ForbiddenException.php
index 5492b8538b4..7a7c011691b 100644
--- a/lib/public/Files/ForbiddenException.php
+++ b/lib/public/Files/ForbiddenException.php
@@ -38,7 +38,7 @@ class ForbiddenException extends \Exception {
/**
* @param string $message
* @param bool $retry
- * @param \Exception $previous previous exception for cascading
+ * @param \Exception|null $previous previous exception for cascading
* @since 9.0.0
*/
public function __construct($message, $retry, \Exception $previous = null) {
diff --git a/lib/public/Files/Storage.php b/lib/public/Files/Storage.php
index 213bbc0e549..ee89b9fd205 100644
--- a/lib/public/Files/Storage.php
+++ b/lib/public/Files/Storage.php
@@ -395,22 +395,22 @@ interface Storage extends IStorage {
public function verifyPath($path, $fileName);
/**
- * @param \OCP\Files\Storage $sourceStorage
+ * @param IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @return bool
* @since 8.1.0
*/
- public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath);
+ public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath);
/**
- * @param \OCP\Files\Storage $sourceStorage
+ * @param IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @return bool
* @since 8.1.0
*/
- public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath);
+ public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath);
/**
* @param string $path The path of the file to acquire the lock for
diff --git a/lib/public/Files/Storage/IStorage.php b/lib/public/Files/Storage/IStorage.php
index 27b8f1d0697..d5176aab463 100644
--- a/lib/public/Files/Storage/IStorage.php
+++ b/lib/public/Files/Storage/IStorage.php
@@ -383,22 +383,22 @@ interface IStorage {
public function verifyPath($path, $fileName);
/**
- * @param \OCP\Files\Storage|\OCP\Files\Storage\IStorage $sourceStorage
+ * @param IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @return bool
* @since 9.0.0
*/
- public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath);
+ public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath);
/**
- * @param \OCP\Files\Storage|\OCP\Files\Storage\IStorage $sourceStorage
+ * @param IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @return bool
* @since 9.0.0
*/
- public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath);
+ public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath);
/**
* Test a storage for availability
diff --git a/lib/public/Files/StorageAuthException.php b/lib/public/Files/StorageAuthException.php
index f73915df9d9..8a04a2c70f4 100644
--- a/lib/public/Files/StorageAuthException.php
+++ b/lib/public/Files/StorageAuthException.php
@@ -31,12 +31,11 @@ class StorageAuthException extends StorageNotAvailableException {
* StorageAuthException constructor.
*
* @param string $message
- * @param int $code
- * @param \Exception $previous
+ * @param \Exception|null $previous
* @since 9.0.0
*/
public function __construct($message = '', \Exception $previous = null) {
$l = \OC::$server->getL10N('core');
- parent::__construct($l->t('Storage unauthorized. %s', $message), self::STATUS_UNAUTHORIZED, $previous);
+ parent::__construct($l->t('Storage unauthorized. %s', [$message]), self::STATUS_UNAUTHORIZED, $previous);
}
}
diff --git a/lib/public/Files/StorageBadConfigException.php b/lib/public/Files/StorageBadConfigException.php
index a3a96a80dc1..d6ee6a267e7 100644
--- a/lib/public/Files/StorageBadConfigException.php
+++ b/lib/public/Files/StorageBadConfigException.php
@@ -31,13 +31,12 @@ class StorageBadConfigException extends StorageNotAvailableException {
* ExtStorageBadConfigException constructor.
*
* @param string $message
- * @param int $code
- * @param \Exception $previous
+ * @param \Exception|null $previous
* @since 9.0.0
*/
public function __construct($message = '', \Exception $previous = null) {
$l = \OC::$server->getL10N('core');
- parent::__construct($l->t('Storage incomplete configuration. %s', $message), self::STATUS_INCOMPLETE_CONF, $previous);
+ parent::__construct($l->t('Storage incomplete configuration. %s', [$message]), self::STATUS_INCOMPLETE_CONF, $previous);
}
}
diff --git a/lib/public/Files/StorageConnectionException.php b/lib/public/Files/StorageConnectionException.php
index 7a5381aef73..f12c84653b7 100644
--- a/lib/public/Files/StorageConnectionException.php
+++ b/lib/public/Files/StorageConnectionException.php
@@ -31,12 +31,11 @@ class StorageConnectionException extends StorageNotAvailableException {
* StorageConnectionException constructor.
*
* @param string $message
- * @param int $code
- * @param \Exception $previous
+ * @param \Exception|null $previous
* @since 9.0.0
*/
public function __construct($message = '', \Exception $previous = null) {
$l = \OC::$server->getL10N('core');
- parent::__construct($l->t('Storage connection error. %s', $message), self::STATUS_NETWORK_ERROR, $previous);
+ parent::__construct($l->t('Storage connection error. %s', [$message]), self::STATUS_NETWORK_ERROR, $previous);
}
}
diff --git a/lib/public/Files/StorageNotAvailableException.php b/lib/public/Files/StorageNotAvailableException.php
index b6a5a70718a..b3f6e1a6b76 100644
--- a/lib/public/Files/StorageNotAvailableException.php
+++ b/lib/public/Files/StorageNotAvailableException.php
@@ -53,7 +53,7 @@ class StorageNotAvailableException extends HintException {
*
* @param string $message
* @param int $code
- * @param \Exception $previous
+ * @param \Exception|null $previous
* @since 6.0.0
*/
public function __construct($message = '', $code = self::STATUS_ERROR, \Exception $previous = null) {
diff --git a/lib/public/Files/StorageTimeoutException.php b/lib/public/Files/StorageTimeoutException.php
index 16675710dff..b5566ada9b5 100644
--- a/lib/public/Files/StorageTimeoutException.php
+++ b/lib/public/Files/StorageTimeoutException.php
@@ -31,12 +31,11 @@ class StorageTimeoutException extends StorageNotAvailableException {
* StorageTimeoutException constructor.
*
* @param string $message
- * @param int $code
- * @param \Exception $previous
+ * @param \Exception|null $previous
* @since 9.0.0
*/
public function __construct($message = '', \Exception $previous = null) {
$l = \OC::$server->getL10N('core');
- parent::__construct($l->t('Storage connection timeout. %s', $message), self::STATUS_TIMEOUT, $previous);
+ parent::__construct($l->t('Storage connection timeout. %s', [$message]), self::STATUS_TIMEOUT, $previous);
}
}
diff --git a/lib/public/IDateTimeFormatter.php b/lib/public/IDateTimeFormatter.php
index 20b01467e29..a97eca2860e 100644
--- a/lib/public/IDateTimeFormatter.php
+++ b/lib/public/IDateTimeFormatter.php
@@ -40,8 +40,8 @@ interface IDateTimeFormatter {
* medium: e.g. 'MMM d, y' => 'Aug 20, 2014'
* short: e.g. 'M/d/yy' => '8/20/14'
* The exact format is dependent on the language
- * @param \DateTimeZone $timeZone The timezone to use
- * @param \OCP\IL10N $l The locale to use
+ * @param \DateTimeZone|null $timeZone The timezone to use
+ * @param \OCP\IL10N|null $l The locale to use
* @return string Formatted date string
* @since 8.0.0
*/
@@ -58,8 +58,8 @@ interface IDateTimeFormatter {
* short: e.g. 'M/d/yy' => '8/20/14'
* The exact format is dependent on the language
* Uses 'Today', 'Yesterday' and 'Tomorrow' when applicable
- * @param \DateTimeZone $timeZone The timezone to use
- * @param \OCP\IL10N $l The locale to use
+ * @param \DateTimeZone|null $timeZone The timezone to use
+ * @param \OCP\IL10N|null $l The locale to use
* @return string Formatted relative date string
* @since 8.0.0
*/
@@ -70,13 +70,12 @@ interface IDateTimeFormatter {
* Only works for past dates
*
* @param int|\DateTime $timestamp
- * @param int|\DateTime $baseTimestamp Timestamp to compare $timestamp against, defaults to current time
+ * @param int|\DateTime|null $baseTimestamp Timestamp to compare $timestamp against, defaults to current time
+ * @param \OCP\IL10N|null $l The locale to use
* @return string Dates returned are:
* < 1 month => Today, Yesterday, n days ago
* < 13 month => last month, n months ago
* >= 13 month => last year, n years ago
- * @param \OCP\IL10N $l The locale to use
- * @return string Formatted date span
* @since 8.0.0
*/
public function formatDateSpan($timestamp, $baseTimestamp = null, \OCP\IL10N $l = null);
@@ -91,8 +90,8 @@ interface IDateTimeFormatter {
* medium: e.g. 'h:mm:ss a' => '11:42:13 AM'
* short: e.g. 'h:mm a' => '11:42 AM'
* The exact format is dependent on the language
- * @param \DateTimeZone $timeZone The timezone to use
- * @param \OCP\IL10N $l The locale to use
+ * @param \DateTimeZone|null $timeZone The timezone to use
+ * @param \OCP\IL10N|null $l The locale to use
* @return string Formatted time string
* @since 8.0.0
*/
@@ -102,7 +101,8 @@ interface IDateTimeFormatter {
* Gives the relative past time of the timestamp
*
* @param int|\DateTime $timestamp
- * @param int|\DateTime $baseTimestamp Timestamp to compare $timestamp against, defaults to current time
+ * @param int|\DateTime|null $baseTimestamp Timestamp to compare $timestamp against, defaults to current time
+ * @param \OCP\IL10N|null $l The locale to use
* @return string Dates returned are:
* < 60 sec => seconds ago
* < 1 hour => n minutes ago
@@ -110,8 +110,6 @@ interface IDateTimeFormatter {
* < 1 month => Yesterday, n days ago
* < 13 month => last month, n months ago
* >= 13 month => last year, n years ago
- * @param \OCP\IL10N $l The locale to use
- * @return string Formatted time span
* @since 8.0.0
*/
public function formatTimeSpan($timestamp, $baseTimestamp = null, \OCP\IL10N $l = null);
@@ -122,8 +120,8 @@ interface IDateTimeFormatter {
* @param int|\DateTime $timestamp
* @param string $formatDate See formatDate() for description
* @param string $formatTime See formatTime() for description
- * @param \DateTimeZone $timeZone The timezone to use
- * @param \OCP\IL10N $l The locale to use
+ * @param \DateTimeZone|null $timeZone The timezone to use
+ * @param \OCP\IL10N|null $l The locale to use
* @return string Formatted date and time string
* @since 8.0.0
*/
@@ -136,8 +134,8 @@ interface IDateTimeFormatter {
* @param string $formatDate See formatDate() for description
* Uses 'Today', 'Yesterday' and 'Tomorrow' when applicable
* @param string $formatTime See formatTime() for description
- * @param \DateTimeZone $timeZone The timezone to use
- * @param \OCP\IL10N $l The locale to use
+ * @param \DateTimeZone|null $timeZone The timezone to use
+ * @param \OCP\IL10N|null $l The locale to use
* @return string Formatted relative date and time string
* @since 8.0.0
*/
diff --git a/lib/public/Lock/LockedException.php b/lib/public/Lock/LockedException.php
index 87ae4511ac9..c371c6c56b0 100644
--- a/lib/public/Lock/LockedException.php
+++ b/lib/public/Lock/LockedException.php
@@ -43,7 +43,7 @@ class LockedException extends \Exception {
* LockedException constructor.
*
* @param string $path locked path
- * @param \Exception $previous previous exception for cascading
+ * @param \Exception|null $previous previous exception for cascading
*
* @since 8.1.0
*/
diff --git a/lib/public/Response.php b/lib/public/Response.php
index b68da644352..dd029e12dbf 100644
--- a/lib/public/Response.php
+++ b/lib/public/Response.php
@@ -109,6 +109,7 @@ class Response {
* @param string $filepath of file to send
* @since 4.0.0
* @deprecated 8.1.0 - Use \OCP\AppFramework\Http\StreamResponse or another AppFramework controller instead
+ * @suppress PhanDeprecatedFunction
*/
static public function sendFile( $filepath ) {
\OC_Response::sendFile( $filepath );
diff --git a/lib/public/Search/PagedProvider.php b/lib/public/Search/PagedProvider.php
index 3bd5b75cc2d..b1294fa6dc4 100644
--- a/lib/public/Search/PagedProvider.php
+++ b/lib/public/Search/PagedProvider.php
@@ -53,7 +53,7 @@ abstract class PagedProvider extends Provider {
*/
public function search($query) {
// old apps might assume they get all results, so we use SIZE_ALL
- $this->searchPaged($query, 1, self::SIZE_ALL);
+ return $this->searchPaged($query, 1, self::SIZE_ALL);
}
/**
diff --git a/lib/public/Share.php b/lib/public/Share.php
index ec3a7c8db1b..f3a0b53efec 100644
--- a/lib/public/Share.php
+++ b/lib/public/Share.php
@@ -265,8 +265,8 @@ class Share extends \OC\Share\Constants {
* @param string $shareWith User or group the item is being shared with
* @param int $permissions CRUDS
* @param string $itemSourceName
- * @param \DateTime $expirationDate
- * @param bool $passwordChanged
+ * @param \DateTime|null $expirationDate
+ * @param bool|null $passwordChanged
* @return bool|string Returns true on success or false on failure, Returns token on success for links
* @throws \OC\HintException when the share type is remote and the shareWith is invalid
* @throws \Exception
diff --git a/lib/public/Share/Exceptions/GenericShareException.php b/lib/public/Share/Exceptions/GenericShareException.php
index 8410a2d0037..21a3b2caa5b 100644
--- a/lib/public/Share/Exceptions/GenericShareException.php
+++ b/lib/public/Share/Exceptions/GenericShareException.php
@@ -35,7 +35,7 @@ class GenericShareException extends HintException {
* @param string $message
* @param string $hint
* @param int $code
- * @param \Exception $previous
+ * @param \Exception|null $previous
* @since 9.0.0
*/
public function __construct($message = '', $hint = '', $code = 0, \Exception $previous = null) {
diff --git a/lib/public/SystemTag/ManagerEvent.php b/lib/public/SystemTag/ManagerEvent.php
index 85e7863492e..f7a9b8d6da7 100644
--- a/lib/public/SystemTag/ManagerEvent.php
+++ b/lib/public/SystemTag/ManagerEvent.php
@@ -48,7 +48,7 @@ class ManagerEvent extends Event {
*
* @param string $event
* @param ISystemTag $tag
- * @param ISystemTag $beforeTag
+ * @param ISystemTag|null $beforeTag
* @since 9.0.0
*/
public function __construct($event, ISystemTag $tag, ISystemTag $beforeTag = null) {
diff --git a/lib/public/SystemTag/TagNotFoundException.php b/lib/public/SystemTag/TagNotFoundException.php
index c983e2afc80..49008d1adde 100644
--- a/lib/public/SystemTag/TagNotFoundException.php
+++ b/lib/public/SystemTag/TagNotFoundException.php
@@ -38,7 +38,7 @@ class TagNotFoundException extends \RuntimeException {
*
* @param string $message
* @param int $code
- * @param \Exception $previous
+ * @param \Exception|null $previous
* @param string[] $tags
* @since 9.0.0
*/