Replace wrong PHPDocs

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
pull/5847/head
Lukas Reschke 7 years ago committed by Roeland Jago Douma
parent 10414d2e7d
commit dfd8125aeb
No known key found for this signature in database
GPG Key ID: F941078878347C0C

@ -34,7 +34,7 @@ class InsufficientDataForMeaningfulAnswerException extends StorageNotAvailableEx
*
* @param string $message
* @param int $code
* @param \Exception $previous
* @param \Exception|null $previous
* @since 6.0.0
*/
public function __construct($message = '', $code = self::STATUS_INDETERMINATE, \Exception $previous = null) {

@ -52,6 +52,7 @@ use OCP\Files\InvalidDirectoryException;
use OCP\Files\InvalidPathException;
use OCP\Files\ReservedWordException;
use OCP\Files\Storage\ILockingStorage;
use OCP\Files\Storage\IStorage;
use OCP\Lock\ILockingProvider;
use OCP\Lock\LockedException;
@ -578,13 +579,13 @@ abstract class Common implements Storage, ILockingStorage {
}
/**
* @param \OCP\Files\Storage $sourceStorage
* @param IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @param bool $preserveMtime
* @return bool
*/
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
if ($sourceStorage === $this) {
return $this->copy($sourceInternalPath, $targetInternalPath);
}
@ -625,12 +626,12 @@ abstract class Common implements Storage, ILockingStorage {
}
/**
* @param \OCP\Files\Storage $sourceStorage
* @param IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @return bool
*/
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
if ($sourceStorage === $this) {
return $this->rename($sourceInternalPath, $targetInternalPath);
}

@ -25,6 +25,7 @@
namespace OC\Files\Storage;
use OC\Files\Cache\FailedCache;
use OCP\Files\Storage\IStorage;
use \OCP\Lock\ILockingProvider;
use \OCP\Files\StorageNotAvailableException;
@ -183,11 +184,11 @@ class FailedStorage extends Common {
return true;
}
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
throw new StorageNotAvailableException($this->e->getMessage(), $this->e->getCode(), $this->e);
}
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
throw new StorageNotAvailableException($this->e->getMessage(), $this->e->getCode(), $this->e);
}

@ -37,6 +37,7 @@ namespace OC\Files\Storage;
use OC\Files\Storage\Wrapper\Jail;
use OCP\Files\ForbiddenException;
use OCP\Files\Storage\IStorage;
/**
* for local filestore, we only have to map the paths
@ -404,12 +405,12 @@ class Local extends \OC\Files\Storage\Common {
}
/**
* @param \OCP\Files\Storage $sourceStorage
* @param IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @return bool
*/
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
if ($sourceStorage->instanceOfStorage('\OC\Files\Storage\Local')) {
/**
* @var \OC\Files\Storage\Local $sourceStorage
@ -422,12 +423,12 @@ class Local extends \OC\Files\Storage\Common {
}
/**
* @param \OCP\Files\Storage $sourceStorage
* @param IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @return bool
*/
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
if ($sourceStorage->instanceOfStorage(Local::class)) {
if ($sourceStorage->instanceOfStorage(Jail::class)) {
/**

@ -22,6 +22,8 @@
*/
namespace OC\Files\Storage\Wrapper;
use OCP\Files\Storage\IStorage;
/**
* Availability checker for storages
*
@ -432,7 +434,7 @@ class Availability extends Wrapper {
}
/** {@inheritdoc} */
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
$this->checkAvailability();
try {
return parent::copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
@ -443,7 +445,7 @@ class Availability extends Wrapper {
}
/** {@inheritdoc} */
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
$this->checkAvailability();
try {
return parent::moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);

@ -22,6 +22,7 @@
namespace OC\Files\Storage\Wrapper;
use OCP\Files\Storage\IStorage;
use OCP\ICache;
use OC\Cache\CappedMemoryCache;
@ -483,12 +484,12 @@ class Encoding extends Wrapper {
}
/**
* @param \OCP\Files\Storage $sourceStorage
* @param IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @return bool
*/
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
if ($sourceStorage === $this) {
return $this->copy($sourceInternalPath, $this->findPathToUse($targetInternalPath));
}
@ -501,12 +502,12 @@ class Encoding extends Wrapper {
}
/**
* @param \OCP\Files\Storage $sourceStorage
* @param IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @return bool
*/
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
if ($sourceStorage === $this) {
$result = $this->rename($sourceInternalPath, $this->findPathToUse($targetInternalPath));
if ($result) {

@ -590,13 +590,13 @@ class Encryption extends Wrapper {
}
/**
* @param Storage $sourceStorage
* @param Storage\IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @param bool $preserveMtime
* @return bool
*/
public function moveFromStorage(Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = true) {
public function moveFromStorage(Storage\IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = true) {
if ($sourceStorage === $this) {
return $this->rename($sourceInternalPath, $targetInternalPath);
}
@ -624,14 +624,14 @@ class Encryption extends Wrapper {
/**
* @param Storage $sourceStorage
* @param Storage\IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @param bool $preserveMtime
* @param bool $isRename
* @return bool
*/
public function copyFromStorage(Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false, $isRename = false) {
public function copyFromStorage(Storage\IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false, $isRename = false) {
// TODO clean this up once the underlying moveFromStorage in OC\Files\Storage\Wrapper\Common is fixed:
// - call $this->storage->copyFromStorage() instead of $this->copyBetweenStorage
@ -645,12 +645,12 @@ class Encryption extends Wrapper {
/**
* Update the encrypted cache version in the database
*
* @param Storage $sourceStorage
* @param Storage\IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @param bool $isRename
*/
private function updateEncryptedVersion(Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $isRename) {
private function updateEncryptedVersion(Storage\IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $isRename) {
$isEncrypted = $this->encryptionManager->isEnabled() && $this->shouldEncrypt($targetInternalPath) ? 1 : 0;
$cacheInformation = [
'encrypted' => (bool)$isEncrypted,
@ -682,7 +682,7 @@ class Encryption extends Wrapper {
/**
* copy file between two storages
*
* @param Storage $sourceStorage
* @param Storage\IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @param bool $preserveMtime
@ -690,7 +690,7 @@ class Encryption extends Wrapper {
* @return bool
* @throws \Exception
*/
private function copyBetweenStorage(Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime, $isRename) {
private function copyBetweenStorage(Storage\IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime, $isRename) {
// for versions we have nothing to do, because versions should always use the
// key from the original file. Just create a 1:1 copy and done

@ -26,6 +26,7 @@ namespace OC\Files\Storage\Wrapper;
use OC\Files\Cache\Wrapper\CacheJail;
use OC\Files\Cache\Wrapper\JailPropagator;
use OCP\Files\Storage\IStorage;
use OCP\Lock\ILockingProvider;
/**
@ -465,12 +466,12 @@ class Jail extends Wrapper {
}
/**
* @param \OCP\Files\Storage $sourceStorage
* @param IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @return bool
*/
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
if ($sourceStorage === $this) {
return $this->copy($sourceInternalPath, $targetInternalPath);
}
@ -478,12 +479,12 @@ class Jail extends Wrapper {
}
/**
* @param \OCP\Files\Storage $sourceStorage
* @param IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @return bool
*/
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
if ($sourceStorage === $this) {
return $this->rename($sourceInternalPath, $targetInternalPath);
}

@ -27,6 +27,7 @@
namespace OC\Files\Storage\Wrapper;
use OCP\Files\Cache\ICacheEntry;
use OCP\Files\Storage\IStorage;
class Quota extends Wrapper {
@ -170,12 +171,12 @@ class Quota extends Wrapper {
}
/**
* @param \OCP\Files\Storage $sourceStorage
* @param IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @return bool
*/
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
$free = $this->free_space('');
if ($free < 0 or $this->getSize($sourceInternalPath, $sourceStorage) < $free) {
return $this->storage->copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
@ -185,12 +186,12 @@ class Quota extends Wrapper {
}
/**
* @param \OCP\Files\Storage $sourceStorage
* @param IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @return bool
*/
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
$free = $this->free_space('');
if ($free < 0 or $this->getSize($sourceInternalPath, $sourceStorage) < $free) {
return $this->storage->moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);

@ -28,6 +28,7 @@ namespace OC\Files\Storage\Wrapper;
use OCP\Files\InvalidPathException;
use OCP\Files\Storage\ILockingStorage;
use OCP\Files\Storage\IStorage;
use OCP\Lock\ILockingProvider;
class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage {
@ -542,12 +543,12 @@ class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage {
}
/**
* @param \OCP\Files\Storage $sourceStorage
* @param IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @return bool
*/
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
if ($sourceStorage === $this) {
return $this->copy($sourceInternalPath, $targetInternalPath);
}
@ -556,12 +557,12 @@ class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage {
}
/**
* @param \OCP\Files\Storage $sourceStorage
* @param IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @return bool
*/
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
if ($sourceStorage === $this) {
return $this->rename($sourceInternalPath, $targetInternalPath);
}

@ -22,6 +22,7 @@ namespace OC\Lockdown\Filesystem;
use Icewind\Streams\IteratorDirectory;
use OC\Files\FileInfo;
use OC\Files\Storage\Common;
use OCP\Files\Storage\IStorage;
class NullStorage extends Common {
public function __construct($parameters) {
@ -156,11 +157,11 @@ class NullStorage extends Common {
return false;
}
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
}
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
}

@ -62,7 +62,7 @@ class CsrfToken {
* The unencrypted value of the token. Used for decrypting an already
* encrypted token.
*
* @return int
* @return string
*/
public function getDecryptedValue() {
$token = explode(':', $this->value);

@ -116,11 +116,11 @@ class OC_Response {
}
/**
* Set response expire time
* @param string|DateTime $expires date-time when the response expires
* string for DateInterval from now
* DateTime object when to expire response
*/
* Set response expire time
* @param string|DateTime|int $expires date-time when the response expires
* string for DateInterval from now
* DateTime object when to expire response
*/
static public function setExpiresHeader($expires) {
if (is_string($expires) && $expires[0] == 'P') {
$interval = $expires;

@ -291,10 +291,11 @@ class OC_Template extends \OC\Template\Base {
}
/**
* Print a fatal error page and terminates the script
* @param string $error_msg The error message to show
* @param string $hint An optional hint message - needs to be properly escaped
*/
* Print a fatal error page and terminates the script
* @param string $error_msg The error message to show
* @param string $hint An optional hint message - needs to be properly escape
* @suppress PhanAccessMethodInternal
*/
public static function printErrorPage( $error_msg, $hint = '' ) {
if (\OC_App::isEnabled('theming') && !\OC_App::isAppLoaded('theming')) {
\OC_App::loadApp('theming');
@ -328,6 +329,7 @@ class OC_Template extends \OC\Template\Base {
* @param Exception|Throwable $exception
* @param bool $fetchPage
* @return bool|string
* @suppress PhanAccessMethodInternal
*/
public static function printExceptionErrorPage($exception, $fetchPage = false) {
try {

@ -57,7 +57,7 @@ function emit_css_tag($href, $opts = '') {
/**
* Prints all tags for CSS loading
* @param hash $obj all the script information from template
* @param array $obj all the script information from template
*/
function emit_css_loading_tags($obj) {
foreach($obj['cssfiles'] as $css) {
@ -72,7 +72,6 @@ function emit_css_loading_tags($obj) {
* Prints a <script> tag with nonce and defer depending on config
* @param string $src the source URL, ignored when empty
* @param string $script_content the inline script content, ignored when empty
* @param bool $defer_flag deferred loading or not
*/
function emit_script_tag($src, $script_content='') {
$defer_str=' defer';
@ -93,7 +92,7 @@ function emit_script_tag($src, $script_content='') {
/**
* Print all <script> tags for loading JS
* @param hash $obj all the script information from template
* @param array $obj all the script information from template
*/
function emit_script_loading_tags($obj) {
foreach($obj['jsfiles'] as $jsfile) {

@ -78,6 +78,7 @@ class OC_User {
* @return bool
*
* Set the User Authentication Module
* @suppress PhanDeprecatedFunction
*/
public static function useBackend($backend = 'database') {
if ($backend instanceof \OCP\UserInterface) {
@ -123,6 +124,7 @@ class OC_User {
/**
* setup the configured backends in config.php
* @suppress PhanDeprecatedFunction
*/
public static function setupBackends() {
OC_App::loadApps(['prelogin']);
@ -347,7 +349,7 @@ class OC_User {
* get the display name of the user currently logged in.
*
* @param string $uid
* @return string uid or false
* @return string|bool uid or false
*/
public static function getDisplayName($uid = null) {
if ($uid) {

@ -91,6 +91,7 @@ class OC_Util {
* TODO make home storage aware of this and use the object storage instead of local disk access
*
* @param array $config containing 'class' and optional 'arguments'
* @suppress PhanDeprecatedFunction
*/
private static function initObjectStoreRootFS($config) {
// check misconfiguration
@ -124,6 +125,7 @@ class OC_Util {
* necessity of a data folder being present.
*
* @param array $config containing 'class' and optional 'arguments'
* @suppress PhanDeprecatedFunction
*/
private static function initObjectStoreMultibucketRootFS($config) {
// check misconfiguration
@ -165,6 +167,9 @@ class OC_Util {
* @param string $user
* @return boolean
* @description configure the initial filesystem based on the configuration
* @suppress PhanDeprecatedFunction
* @suppress PhanAccessMethodInternal
* @suppress PhanUndeclaredMethod
*/
public static function setupFS($user = '') {
//setting up the filesystem twice can only lead to trouble
@ -289,6 +294,7 @@ class OC_Util {
* check if a password is required for each public link
*
* @return boolean
* @suppress PhanDeprecatedFunction
*/
public static function isPublicLinkPasswordRequired() {
$appConfig = \OC::$server->getAppConfig();
@ -329,6 +335,7 @@ class OC_Util {
* check if share API enforces a default expire date
*
* @return boolean
* @suppress PhanDeprecatedFunction
*/
public static function isDefaultExpireDateEnforced() {
$isDefaultExpireDateEnabled = \OCP\Config::getAppValue('core', 'shareapi_default_expire_date', 'no');
@ -345,7 +352,7 @@ class OC_Util {
* Get the quota of a user
*
* @param string $userId
* @return int Quota bytes
* @return float Quota bytes
*/
public static function getUserQuota($userId) {
$user = \OC::$server->getUserManager()->get($userId);
@ -365,6 +372,7 @@ class OC_Util {
* @param String $userId
* @param \OCP\Files\Folder $userDirectory
* @throws \RuntimeException
* @suppress PhanDeprecatedFunction
*/
public static function copySkeleton($userId, \OCP\Files\Folder $userDirectory) {
@ -431,6 +439,7 @@ class OC_Util {
/**
* @return void
* @suppress PhanUndeclaredMethod
*/
public static function tearDownFS() {
\OC\Files\Filesystem::tearDown();
@ -487,6 +496,7 @@ class OC_Util {
/**
* @description load the version.php into the session as cache
* @suppress PhanUndeclaredVariable
*/
private static function loadVersion() {
if (self::$versionCache !== null) {
@ -563,8 +573,8 @@ class OC_Util {
* add a translation JS file
*
* @param string $application application id
* @param string $languageCode language code, defaults to the current language
* @param bool $prepend prepend the Script to the beginning of the list
* @param string|null $languageCode language code, defaults to the current language
* @param bool|null $prepend prepend the Script to the beginning of the list
*/
public static function addTranslations($application, $languageCode = null, $prepend = false) {
if (is_null($languageCode)) {
@ -1068,6 +1078,7 @@ class OC_Util {
* the apps visible for the current user
*
* @return string URL
* @suppress PhanDeprecatedFunction
*/
public static function getDefaultPageUrl() {
$urlGenerator = \OC::$server->getURLGenerator();
@ -1347,6 +1358,8 @@ class OC_Util {
* in case the opcode cache does not re-validate files
*
* @return void
* @suppress PhanDeprecatedFunction
* @suppress PhanUndeclaredConstant
*/
public static function clearOpcodeCache() {
// APC

@ -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) {

@ -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;

@ -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);

@ -228,7 +228,7 @@ class Response {
/**
* By default renders no output
* @return null
* @return string|null
* @since 6.0.0
*/
public function render() {

@ -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

@ -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);
}
/**

@ -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);

@ -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) {

@ -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) {

@ -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

@ -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

@ -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);
}
}

@ -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);
}
}

@ -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);
}
}

@ -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) {

@ -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);
}
}

@ -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
*/

@ -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
*/

@ -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 );

@ -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);
}
/**

@ -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

@ -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) {

@ -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) {

@ -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
*/

@ -18,6 +18,7 @@ use OC\Files\View;
use OCP\Constants;
use OCP\Files\Config\IMountProvider;
use OCP\Files\FileInfo;
use OCP\Files\Storage\IStorage;
use OCP\Lock\ILockingProvider;
use OCP\Lock\LockedException;
use OCP\Share;
@ -32,11 +33,11 @@ class TemporaryNoTouch extends Temporary {
}
class TemporaryNoCross extends Temporary {
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = null) {
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = null) {
return Common::copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime);
}
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
return Common::moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
}
}

Loading…
Cancel
Save