Fix "misplaced variables" warning of Psalm in PHPDoc statements

Ref #21787

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2020-08-17 17:16:50 +02:00
parent 00cb8e6c54
commit d7f66c36ac
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
19 changed files with 26 additions and 31 deletions

View File

@ -167,7 +167,7 @@ class GlobalStoragesService extends StoragesService {
/** /**
* Get all configured admin and personal mounts * 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() { public function getStorageForAllUsers() {
$mounts = $this->dbConfig->getAllMounts(); $mounts = $this->dbConfig->getAllMounts();

View File

@ -1,5 +1,5 @@
<?php <?php
/** @var \OCP\IL10N $_ */ /** @var \OCP\IL10N $l */
/** @var array $_ */ /** @var array $_ */
?> ?>
<div id="app-content"> <div id="app-content">

View File

@ -1,4 +1,4 @@
<?php /** @var $l \OCP\IL10N */ ?> <?php /** @var \OCP\IL10N $l */ ?>
<div id="controls"> <div id="controls">
<div id="file_action_panel"></div> <div id="file_action_panel"></div>
</div> </div>

View File

@ -70,7 +70,6 @@ class AppSearch implements IProvider {
* @inheritDoc * @inheritDoc
*/ */
public function search(IUser $user, ISearchQuery $query): SearchResult { public function search(IUser $user, ISearchQuery $query): SearchResult {
/** @var $entries */
$entries = $this->navigationManager->getAll('all'); $entries = $this->navigationManager->getAll('all');
$result = []; $result = [];

View File

@ -1,4 +1,4 @@
<?php /** @var $l OC_L10N */ ?> <?php /** @var \OCP\IL10N $l */ ?>
<?php <?php
script('user_ldap', [ script('user_ldap', [
'renewPassword', 'renewPassword',

View File

@ -70,7 +70,6 @@ class ResetPassword extends Command {
protected function execute(InputInterface $input, OutputInterface $output): int { protected function execute(InputInterface $input, OutputInterface $output): int {
$username = $input->getArgument('user'); $username = $input->getArgument('user');
/** @var $user \OCP\IUser */
$user = $this->userManager->get($username); $user = $this->userManager->get($username);
if (is_null($user)) { if (is_null($user)) {
$output->writeln('<error>User does not exist</error>'); $output->writeln('<error>User does not exist</error>');

View File

@ -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 \Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand());
$application->add(new OC\Core\Command\Status); $application->add(new OC\Core\Command\Status);
$application->add(new OC\Core\Command\Check(\OC::$server->getSystemConfig())); $application->add(new OC\Core\Command\Check(\OC::$server->getSystemConfig()));

View File

@ -1,7 +1,7 @@
<?php <?php
/** @var $_ array */ /** @var array $_ */
/** @var $l \OCP\IL10N */ /** @var \OCP\IL10N $l */
/** @var $theme OCP\Defaults */ /** @var \OCP\Defaults $theme */
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
if (!isset($_)) {//standalone page is not supported anymore - redirect to / if (!isset($_)) {//standalone page is not supported anymore - redirect to /
require_once '../../lib/base.php'; require_once '../../lib/base.php';

View File

@ -1,4 +1,4 @@
<?php /** @var $l \OCP\IL10N */ ?> <?php /** @var \OCP\IL10N $l */ ?>
<?php <?php
script('core', 'dist/login'); script('core', 'dist/login');
?> ?>

View File

@ -1,6 +1,6 @@
<?php <?php
/** @var $_ array */ /** @var array $_ */
/** @var $l \OCP\IL10N */ /** @var \OCP\IL10N $l */
style('core', 'guest'); style('core', 'guest');
style('core', 'publicshareauth'); style('core', 'publicshareauth');
script('core', 'publicshareauth'); script('core', 'publicshareauth');

View File

@ -1,9 +1,9 @@
<?php <?php
/** @var $l \OCP\IL10N */ /** @var \OCP\IL10N $l */
/** @var $_ array */ /** @var array $_ */
/* @var $provider OCP\Authentication\TwoFactorAuth\IProvider */ /** @var \OCP\Authentication\TwoFactorAuth\IProvider $provider */
$provider = $_['provider']; $provider = $_['provider'];
/* @var $template string */ /* @var string $template */
$template = $_['template']; $template = $_['template'];
?> ?>

View File

@ -1,7 +1,7 @@
<?php <?php
/** @var $l \OCP\IL10N */ /** @var \OCP\IL10N $l */
/** @var $_ array */ /** @var array $_*/
/* @var $error boolean */ /** @var boolean $error */
$error = $_['error']; $error = $_['error'];
/* @var $error_message string */ /* @var $error_message string */
$error_message = $_['error_message']; $error_message = $_['error_message'];

View File

@ -1,4 +1,4 @@
<?php /** @var $_ array */ ?> <?php /** @var array $_ */ ?>
<div class="error"> <div class="error">
<h2><?php p($l->t('Access through untrusted domain')); ?></h2> <h2><?php p($l->t('Access through untrusted domain')); ?></h2>

View File

@ -145,7 +145,6 @@ class MDB2SchemaManager {
$toSchema = new Schema([], [], $this->conn->getSchemaManager()->createSchemaConfig()); $toSchema = new Schema([], [], $this->conn->getSchemaManager()->createSchemaConfig());
$fromSchema = $schemaReader->loadSchemaFromFile($file, $toSchema); $fromSchema = $schemaReader->loadSchemaFromFile($file, $toSchema);
$toSchema = clone $fromSchema; $toSchema = clone $fromSchema;
/** @var $table \Doctrine\DBAL\Schema\Table */
foreach ($toSchema->getTables() as $table) { foreach ($toSchema->getTables() as $table) {
$toSchema->dropTable($table->getName()); $toSchema->dropTable($table->getName());
} }

View File

@ -226,7 +226,6 @@ class Migrator {
$sourceSchema = $connection->getSchemaManager()->createSchema(); $sourceSchema = $connection->getSchemaManager()->createSchema();
// remove tables we don't know about // remove tables we don't know about
/** @var $table \Doctrine\DBAL\Schema\Table */
foreach ($sourceSchema->getTables() as $table) { foreach ($sourceSchema->getTables() as $table) {
if (!$targetSchema->hasTable($table->getName())) { if (!$targetSchema->hasTable($table->getName())) {
$sourceSchema->dropTable($table->getName()); $sourceSchema->dropTable($table->getName());

View File

@ -261,7 +261,6 @@ class PreviewManager implements IPreview {
continue; continue;
} }
/** @var $provider IProvider */
if ($provider->isAvailable($file)) { if ($provider->isAvailable($file)) {
return true; return true;
} }

View File

@ -36,6 +36,7 @@ use OCP\Search\Provider;
* Provide an interface to all search providers * Provide an interface to all search providers
*/ */
class Search implements ISearch { class Search implements ISearch {
/** @var Provider[] */
private $providers = []; private $providers = [];
private $registeredProviders = []; private $registeredProviders = [];
@ -51,7 +52,6 @@ class Search implements ISearch {
$this->initProviders(); $this->initProviders();
$results = []; $results = [];
foreach ($this->providers as $provider) { foreach ($this->providers as $provider) {
/** @var $provider Provider */
if (! $provider->providesResultsFor($inApps)) { if (! $provider->providesResultsFor($inApps)) {
continue; continue;
} }

View File

@ -580,7 +580,7 @@ class Server extends ServerContainer implements IServerContainer {
$dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid)); $dispatcher->dispatchTyped(new BeforeUserLoggedInWithCookieEvent($uid));
}); });
$userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { $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]); \OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]);
/** @var IEventDispatcher $dispatcher */ /** @var IEventDispatcher $dispatcher */

View File

@ -555,16 +555,16 @@ class OC_Util {
$timestamp = filemtime(OC::$SERVERROOT . '/version.php'); $timestamp = filemtime(OC::$SERVERROOT . '/version.php');
require OC::$SERVERROOT . '/version.php'; require OC::$SERVERROOT . '/version.php';
/** @var $timestamp int */ /** @var int $timestamp */
self::$versionCache['OC_Version_Timestamp'] = $timestamp; self::$versionCache['OC_Version_Timestamp'] = $timestamp;
/** @var $OC_Version string */ /** @var string $OC_Version */
self::$versionCache['OC_Version'] = $OC_Version; self::$versionCache['OC_Version'] = $OC_Version;
/** @var $OC_VersionString string */ /** @var string $OC_VersionString */
self::$versionCache['OC_VersionString'] = $OC_VersionString; self::$versionCache['OC_VersionString'] = $OC_VersionString;
/** @var $OC_Build string */ /** @var string $OC_Build */
self::$versionCache['OC_Build'] = $OC_Build; self::$versionCache['OC_Build'] = $OC_Build;
/** @var $OC_Channel string */ /** @var string $OC_Channel */
self::$versionCache['OC_Channel'] = $OC_Channel; self::$versionCache['OC_Channel'] = $OC_Channel;
} }