aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-08-17 17:16:50 +0200
committerMorris Jobke <hey@morrisjobke.de>2020-08-17 17:46:57 +0200
commitd7f66c36acef9334e3c9ecf750cae5bfc2f206d8 (patch)
tree4896ad25898411bfd2268b188743bf6bf3d5fd31
parent00cb8e6c54d8f2a26c5770fef5fe4ae1e366d0ce (diff)
downloadnextcloud-server-d7f66c36acef9334e3c9ecf750cae5bfc2f206d8.tar.gz
nextcloud-server-d7f66c36acef9334e3c9ecf750cae5bfc2f206d8.zip
Fix "misplaced variables" warning of Psalm in PHPDoc statements
Ref #21787 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
-rw-r--r--apps/files_external/lib/Service/GlobalStoragesService.php2
-rw-r--r--apps/files_sharing/templates/public.php2
-rw-r--r--apps/files_trashbin/templates/index.php2
-rw-r--r--apps/settings/lib/Search/AppSearch.php1
-rw-r--r--apps/user_ldap/templates/renewpassword.php2
-rw-r--r--core/Command/User/ResetPassword.php1
-rw-r--r--core/register_command.php2
-rw-r--r--core/templates/404.php6
-rw-r--r--core/templates/login.php2
-rw-r--r--core/templates/publicshareauth.php4
-rw-r--r--core/templates/twofactorsetupchallenge.php8
-rw-r--r--core/templates/twofactorshowchallenge.php6
-rw-r--r--core/templates/untrustedDomain.php2
-rw-r--r--lib/private/DB/MDB2SchemaManager.php1
-rw-r--r--lib/private/DB/Migrator.php1
-rw-r--r--lib/private/PreviewManager.php1
-rw-r--r--lib/private/Search.php2
-rw-r--r--lib/private/Server.php2
-rw-r--r--lib/private/legacy/OC_Util.php10
19 files changed, 26 insertions, 31 deletions
diff --git a/apps/files_external/lib/Service/GlobalStoragesService.php b/apps/files_external/lib/Service/GlobalStoragesService.php
index 2905e08883e..3ef6fd798d4 100644
--- a/apps/files_external/lib/Service/GlobalStoragesService.php
+++ b/apps/files_external/lib/Service/GlobalStoragesService.php
@@ -167,7 +167,7 @@ class GlobalStoragesService extends StoragesService {
/**
* Get all configured admin and personal mounts
*
- * @return array map of storage id to storage config
+ * @return StorageConfig[] map of storage id to storage config
*/
public function getStorageForAllUsers() {
$mounts = $this->dbConfig->getAllMounts();
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index bdd3e8399ea..82544385dec 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -1,5 +1,5 @@
<?php
-/** @var \OCP\IL10N $_ */
+/** @var \OCP\IL10N $l */
/** @var array $_ */
?>
<div id="app-content">
diff --git a/apps/files_trashbin/templates/index.php b/apps/files_trashbin/templates/index.php
index 2bf4be54f6a..6d375b699f3 100644
--- a/apps/files_trashbin/templates/index.php
+++ b/apps/files_trashbin/templates/index.php
@@ -1,4 +1,4 @@
-<?php /** @var $l \OCP\IL10N */ ?>
+<?php /** @var \OCP\IL10N $l */ ?>
<div id="controls">
<div id="file_action_panel"></div>
</div>
diff --git a/apps/settings/lib/Search/AppSearch.php b/apps/settings/lib/Search/AppSearch.php
index 393f63a9e81..849bac0f730 100644
--- a/apps/settings/lib/Search/AppSearch.php
+++ b/apps/settings/lib/Search/AppSearch.php
@@ -70,7 +70,6 @@ class AppSearch implements IProvider {
* @inheritDoc
*/
public function search(IUser $user, ISearchQuery $query): SearchResult {
- /** @var $entries */
$entries = $this->navigationManager->getAll('all');
$result = [];
diff --git a/apps/user_ldap/templates/renewpassword.php b/apps/user_ldap/templates/renewpassword.php
index c3ea94fbf02..dca7a459c83 100644
--- a/apps/user_ldap/templates/renewpassword.php
+++ b/apps/user_ldap/templates/renewpassword.php
@@ -1,4 +1,4 @@
-<?php /** @var $l OC_L10N */ ?>
+<?php /** @var \OCP\IL10N $l */ ?>
<?php
script('user_ldap', [
'renewPassword',
diff --git a/core/Command/User/ResetPassword.php b/core/Command/User/ResetPassword.php
index bcb3c774ef0..bde82fd4770 100644
--- a/core/Command/User/ResetPassword.php
+++ b/core/Command/User/ResetPassword.php
@@ -70,7 +70,6 @@ class ResetPassword extends Command {
protected function execute(InputInterface $input, OutputInterface $output): int {
$username = $input->getArgument('user');
- /** @var $user \OCP\IUser */
$user = $this->userManager->get($username);
if (is_null($user)) {
$output->writeln('<error>User does not exist</error>');
diff --git a/core/register_command.php b/core/register_command.php
index 03d458a9cbc..412e8ba8678 100644
--- a/core/register_command.php
+++ b/core/register_command.php
@@ -42,7 +42,7 @@
*
*/
-/** @var $application Symfony\Component\Console\Application */
+/** @var Symfony\Component\Console\Application $application */
$application->add(new \Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand());
$application->add(new OC\Core\Command\Status);
$application->add(new OC\Core\Command\Check(\OC::$server->getSystemConfig()));
diff --git a/core/templates/404.php b/core/templates/404.php
index 85ddb4c4b17..10c49f34b6c 100644
--- a/core/templates/404.php
+++ b/core/templates/404.php
@@ -1,7 +1,7 @@
<?php
-/** @var $_ array */
-/** @var $l \OCP\IL10N */
-/** @var $theme OCP\Defaults */
+/** @var array $_ */
+/** @var \OCP\IL10N $l */
+/** @var \OCP\Defaults $theme */
// @codeCoverageIgnoreStart
if (!isset($_)) {//standalone page is not supported anymore - redirect to /
require_once '../../lib/base.php';
diff --git a/core/templates/login.php b/core/templates/login.php
index 124a62f0646..4dc5e41f917 100644
--- a/core/templates/login.php
+++ b/core/templates/login.php
@@ -1,4 +1,4 @@
-<?php /** @var $l \OCP\IL10N */ ?>
+<?php /** @var \OCP\IL10N $l */ ?>
<?php
script('core', 'dist/login');
?>
diff --git a/core/templates/publicshareauth.php b/core/templates/publicshareauth.php
index 22e22622291..96c5bc89111 100644
--- a/core/templates/publicshareauth.php
+++ b/core/templates/publicshareauth.php
@@ -1,6 +1,6 @@
<?php
- /** @var $_ array */
- /** @var $l \OCP\IL10N */
+ /** @var array $_ */
+ /** @var \OCP\IL10N $l */
style('core', 'guest');
style('core', 'publicshareauth');
script('core', 'publicshareauth');
diff --git a/core/templates/twofactorsetupchallenge.php b/core/templates/twofactorsetupchallenge.php
index a5b8b44f049..ea6a1e62f6e 100644
--- a/core/templates/twofactorsetupchallenge.php
+++ b/core/templates/twofactorsetupchallenge.php
@@ -1,9 +1,9 @@
<?php
-/** @var $l \OCP\IL10N */
-/** @var $_ array */
-/* @var $provider OCP\Authentication\TwoFactorAuth\IProvider */
+/** @var \OCP\IL10N $l */
+/** @var array $_ */
+/** @var \OCP\Authentication\TwoFactorAuth\IProvider $provider */
$provider = $_['provider'];
-/* @var $template string */
+/* @var string $template */
$template = $_['template'];
?>
diff --git a/core/templates/twofactorshowchallenge.php b/core/templates/twofactorshowchallenge.php
index 481cea06eb0..9be36fe13a2 100644
--- a/core/templates/twofactorshowchallenge.php
+++ b/core/templates/twofactorshowchallenge.php
@@ -1,7 +1,7 @@
<?php
-/** @var $l \OCP\IL10N */
-/** @var $_ array */
-/* @var $error boolean */
+/** @var \OCP\IL10N $l */
+/** @var array $_*/
+/** @var boolean $error */
$error = $_['error'];
/* @var $error_message string */
$error_message = $_['error_message'];
diff --git a/core/templates/untrustedDomain.php b/core/templates/untrustedDomain.php
index 7de4ff78f30..75054106ab2 100644
--- a/core/templates/untrustedDomain.php
+++ b/core/templates/untrustedDomain.php
@@ -1,4 +1,4 @@
-<?php /** @var $_ array */ ?>
+<?php /** @var array $_ */ ?>
<div class="error">
<h2><?php p($l->t('Access through untrusted domain')); ?></h2>
diff --git a/lib/private/DB/MDB2SchemaManager.php b/lib/private/DB/MDB2SchemaManager.php
index 145272619b4..7808e0c0b51 100644
--- a/lib/private/DB/MDB2SchemaManager.php
+++ b/lib/private/DB/MDB2SchemaManager.php
@@ -145,7 +145,6 @@ class MDB2SchemaManager {
$toSchema = new Schema([], [], $this->conn->getSchemaManager()->createSchemaConfig());
$fromSchema = $schemaReader->loadSchemaFromFile($file, $toSchema);
$toSchema = clone $fromSchema;
- /** @var $table \Doctrine\DBAL\Schema\Table */
foreach ($toSchema->getTables() as $table) {
$toSchema->dropTable($table->getName());
}
diff --git a/lib/private/DB/Migrator.php b/lib/private/DB/Migrator.php
index 2ea365ab294..be3d6557e95 100644
--- a/lib/private/DB/Migrator.php
+++ b/lib/private/DB/Migrator.php
@@ -226,7 +226,6 @@ class Migrator {
$sourceSchema = $connection->getSchemaManager()->createSchema();
// remove tables we don't know about
- /** @var $table \Doctrine\DBAL\Schema\Table */
foreach ($sourceSchema->getTables() as $table) {
if (!$targetSchema->hasTable($table->getName())) {
$sourceSchema->dropTable($table->getName());
diff --git a/lib/private/PreviewManager.php b/lib/private/PreviewManager.php
index 546d495b47d..f6f6671f08b 100644
--- a/lib/private/PreviewManager.php
+++ b/lib/private/PreviewManager.php
@@ -261,7 +261,6 @@ class PreviewManager implements IPreview {
continue;
}
- /** @var $provider IProvider */
if ($provider->isAvailable($file)) {
return true;
}
diff --git a/lib/private/Search.php b/lib/private/Search.php
index ae22a6d9f19..9ecf34aef54 100644
--- a/lib/private/Search.php
+++ b/lib/private/Search.php
@@ -36,6 +36,7 @@ use OCP\Search\Provider;
* Provide an interface to all search providers
*/
class Search implements ISearch {
+ /** @var Provider[] */
private $providers = [];
private $registeredProviders = [];
@@ -51,7 +52,6 @@ class Search implements ISearch {
$this->initProviders();
$results = [];
foreach ($this->providers as $provider) {
- /** @var $provider Provider */
if (! $provider->providesResultsFor($inApps)) {
continue;
}
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 12abf793828..a934628a047 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -580,7 +580,7 @@ class Server extends ServerContainer implements IServerContainer {
$dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid));
});
$userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) {
- /** @var $user \OC\User\User */
+ /** @var \OC\User\User $user */
\OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]);
/** @var IEventDispatcher $dispatcher */
diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php
index fd55962447e..0be615a8e1d 100644
--- a/lib/private/legacy/OC_Util.php
+++ b/lib/private/legacy/OC_Util.php
@@ -555,16 +555,16 @@ class OC_Util {
$timestamp = filemtime(OC::$SERVERROOT . '/version.php');
require OC::$SERVERROOT . '/version.php';
- /** @var $timestamp int */
+ /** @var int $timestamp */
self::$versionCache['OC_Version_Timestamp'] = $timestamp;
- /** @var $OC_Version string */
+ /** @var string $OC_Version */
self::$versionCache['OC_Version'] = $OC_Version;
- /** @var $OC_VersionString string */
+ /** @var string $OC_VersionString */
self::$versionCache['OC_VersionString'] = $OC_VersionString;
- /** @var $OC_Build string */
+ /** @var string $OC_Build */
self::$versionCache['OC_Build'] = $OC_Build;
- /** @var $OC_Channel string */
+ /** @var string $OC_Channel */
self::$versionCache['OC_Channel'] = $OC_Channel;
}