summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-07-19 20:21:05 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-08-01 08:20:16 +0200
commit0fa49db77049712c6ecd249921235efd9776318b (patch)
treedd2e7b01135c2fdaec3c67b5219a453ef4c0faba /lib
parent66b82087915b53a98d5b84062ced6e59712698a2 (diff)
downloadnextcloud-server-0fa49db77049712c6ecd249921235efd9776318b.tar.gz
nextcloud-server-0fa49db77049712c6ecd249921235efd9776318b.zip
Some more invalid PHPDocs in legacy classes
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/L10N/L10NString.php2
-rw-r--r--lib/private/legacy/db.php10
-rw-r--r--lib/private/legacy/db/statementwrapper.php2
-rw-r--r--lib/private/legacy/eventsource.php1
-rw-r--r--lib/private/legacy/helper.php2
-rw-r--r--lib/private/legacy/json.php9
-rw-r--r--lib/private/legacy/util.php5
-rw-r--r--lib/public/AppFramework/App.php1
8 files changed, 21 insertions, 11 deletions
diff --git a/lib/private/L10N/L10NString.php b/lib/private/L10N/L10NString.php
index fd2f14f9f28..75fcd7f5e44 100644
--- a/lib/private/L10N/L10NString.php
+++ b/lib/private/L10N/L10NString.php
@@ -73,7 +73,7 @@ class L10NString implements \JsonSerializable {
}
// Replace %n first (won't interfere with vsprintf)
- $text = str_replace('%n', $this->count, $text);
+ $text = str_replace('%n', (string)$this->count, $text);
return vsprintf($text, $this->parameters);
}
diff --git a/lib/private/legacy/db.php b/lib/private/legacy/db.php
index 9e4d619d953..843970d7d53 100644
--- a/lib/private/legacy/db.php
+++ b/lib/private/legacy/db.php
@@ -45,9 +45,9 @@ class OC_DB {
/**
* Prepare a SQL query
* @param string $query Query string
- * @param int $limit
- * @param int $offset
- * @param bool $isManipulation
+ * @param int|null $limit
+ * @param int|null $offset
+ * @param bool|null $isManipulation
* @throws \OC\DatabaseException
* @return OC_DB_StatementWrapper prepared SQL query
*
@@ -104,7 +104,7 @@ class OC_DB {
* @param mixed $stmt OC_DB_StatementWrapper,
* an array with 'sql' and optionally 'limit' and 'offset' keys
* .. or a simple sql query string
- * @param array $parameters
+ * @param array|null $parameters
* @return OC_DB_StatementWrapper
* @throws \OC\DatabaseException
*/
@@ -151,7 +151,6 @@ class OC_DB {
/**
* saves database schema to xml file
* @param string $file name of file
- * @param int $mode
* @return bool
*
* TODO: write more documentation
@@ -179,6 +178,7 @@ class OC_DB {
* @param string $file file to read structure from
* @throws Exception
* @return string|boolean
+ * @suppress PhanDeprecatedFunction
*/
public static function updateDbFromStructure($file) {
$schemaManager = self::getMDB2SchemaManager();
diff --git a/lib/private/legacy/db/statementwrapper.php b/lib/private/legacy/db/statementwrapper.php
index 53f7b484d04..cac4598e650 100644
--- a/lib/private/legacy/db/statementwrapper.php
+++ b/lib/private/legacy/db/statementwrapper.php
@@ -62,7 +62,7 @@ class OC_DB_StatementWrapper {
* make execute return the result instead of a bool
*
* @param array $input
- * @return \OC_DB_StatementWrapper|int
+ * @return \OC_DB_StatementWrapper|int|bool
*/
public function execute($input= []) {
$this->lastArguments = $input;
diff --git a/lib/private/legacy/eventsource.php b/lib/private/legacy/eventsource.php
index 6211d851426..74beb157e18 100644
--- a/lib/private/legacy/eventsource.php
+++ b/lib/private/legacy/eventsource.php
@@ -97,6 +97,7 @@ class OC_EventSource implements \OCP\IEventSource {
*
* @throws \BadMethodCallException
* if only one parameter is given, a typeless message will be send with that parameter as data
+ * @suppress PhanDeprecatedFunction
*/
public function send($type, $data = null) {
if ($data and !preg_match('/^[A-Za-z0-9_]+$/', $type)) {
diff --git a/lib/private/legacy/helper.php b/lib/private/legacy/helper.php
index 6704a8cd318..48b7d037c58 100644
--- a/lib/private/legacy/helper.php
+++ b/lib/private/legacy/helper.php
@@ -131,7 +131,7 @@ class OC_Helper {
/**
* Make a computer file size
* @param string $str file size in human readable format
- * @return float a file size in bytes
+ * @return float|bool a file size in bytes
*
* Makes 2kB to 2048.
*
diff --git a/lib/private/legacy/json.php b/lib/private/legacy/json.php
index 9b90daccac9..180dd7c448d 100644
--- a/lib/private/legacy/json.php
+++ b/lib/private/legacy/json.php
@@ -52,6 +52,7 @@ class OC_JSON{
* Check if the app is enabled, send json error msg if not
* @param string $app
* @deprecated Use the AppFramework instead. It will automatically check if the app is enabled.
+ * @suppress PhanDeprecatedFunction
*/
public static function checkAppEnabled($app) {
if( !OC_App::isEnabled($app)) {
@@ -64,6 +65,7 @@ class OC_JSON{
/**
* Check if the user is logged in, send json error msg if not
* @deprecated Use annotation based ACLs from the AppFramework instead
+ * @suppress PhanDeprecatedFunction
*/
public static function checkLoggedIn() {
$twoFactorAuthManger = \OC::$server->getTwoFactorAuthManager();
@@ -79,6 +81,7 @@ class OC_JSON{
/**
* Check an ajax get/post call if the request token is valid, send json error msg if not.
* @deprecated Use annotation based CSRF checks from the AppFramework instead
+ * @suppress PhanDeprecatedFunction
*/
public static function callCheck() {
if(!\OC::$server->getRequest()->passesStrictCookieCheck()) {
@@ -96,6 +99,7 @@ class OC_JSON{
/**
* Check if the user is a admin, send json error msg if not.
* @deprecated Use annotation based ACLs from the AppFramework instead
+ * @suppress PhanDeprecatedFunction
*/
public static function checkAdminUser() {
if( !OC_User::isAdminUser(OC_User::getUser())) {
@@ -109,6 +113,7 @@ class OC_JSON{
* Check is a given user exists - send json error msg if not
* @param string $user
* @deprecated Use a AppFramework JSONResponse instead
+ * @suppress PhanDeprecatedFunction
*/
public static function checkUserExists($user) {
if (!OCP\User::userExists($user)) {
@@ -122,6 +127,7 @@ class OC_JSON{
/**
* Check if the user is a subadmin, send json error msg if not
* @deprecated Use annotation based ACLs from the AppFramework instead
+ * @suppress PhanDeprecatedFunction
*/
public static function checkSubAdminUser() {
$userObject = \OC::$server->getUserSession()->getUser();
@@ -140,6 +146,7 @@ class OC_JSON{
/**
* Send json error msg
* @deprecated Use a AppFramework JSONResponse instead
+ * @suppress PhanDeprecatedFunction
*/
public static function error($data = array()) {
$data['status'] = 'error';
@@ -149,6 +156,7 @@ class OC_JSON{
/**
* Send json success msg
* @deprecated Use a AppFramework JSONResponse instead
+ * @suppress PhanDeprecatedFunction
*/
public static function success($data = array()) {
$data['status'] = 'success';
@@ -167,6 +175,7 @@ class OC_JSON{
/**
* Encode and print $data in json format
* @deprecated Use a AppFramework JSONResponse instead
+ * @suppress PhanDeprecatedFunction
*/
public static function encodedPrint($data, $setContentType=true) {
if($setContentType) {
diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php
index d61088169ae..f0fef027ec2 100644
--- a/lib/private/legacy/util.php
+++ b/lib/private/legacy/util.php
@@ -169,7 +169,6 @@ class OC_Util {
* @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
@@ -207,7 +206,7 @@ class OC_Util {
return $storage;
});
- \OC\Files\Filesystem::addStorageWrapper('enable_sharing', function ($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) {
+ \OC\Files\Filesystem::addStorageWrapper('enable_sharing', function ($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) {
if (!$mount->getOption('enable_sharing', true)) {
return new \OC\Files\Storage\Wrapper\PermissionsMask([
'storage' => $storage,
@@ -218,7 +217,7 @@ class OC_Util {
});
// install storage availability wrapper, before most other wrappers
- \OC\Files\Filesystem::addStorageWrapper('oc_availability', function ($mountPoint, $storage) {
+ \OC\Files\Filesystem::addStorageWrapper('oc_availability', function ($mountPoint, \OCP\Files\Storage\IStorage $storage) {
if (!$storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage') && !$storage->isLocal()) {
return new \OC\Files\Storage\Wrapper\Availability(['storage' => $storage]);
}
diff --git a/lib/public/AppFramework/App.php b/lib/public/AppFramework/App.php
index 313f1e490a1..e5cd832563d 100644
--- a/lib/public/AppFramework/App.php
+++ b/lib/public/AppFramework/App.php
@@ -95,6 +95,7 @@ class App {
* @param \OCP\Route\IRouter $router
* @param array $routes
* @since 6.0.0
+ * @suppress PhanAccessMethodInternal
*/
public function registerRoutes($router, $routes) {
$routeConfig = new RouteConfig($this->container, $router, $routes);