Merge pull request #36271 from nextcloud/fix/fix-codestyle

Fix codestyle using codesniffer
This commit is contained in:
Côme Chilliet 2023-01-20 15:26:17 +01:00 committed by GitHub
commit 3f231d68d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
887 changed files with 430 additions and 1320 deletions

View File

@ -28,7 +28,6 @@ require_once(dirname(__DIR__) . '/3rdparty/autoload.php');
* this class checks all methods for the presence of the @since tag * this class checks all methods for the presence of the @since tag
*/ */
class SinceTagCheckVisitor extends \PhpParser\NodeVisitorAbstract { class SinceTagCheckVisitor extends \PhpParser\NodeVisitorAbstract {
/** @var string */ /** @var string */
protected $namespace = ''; protected $namespace = '';
/** @var string */ /** @var string */

View File

@ -26,7 +26,6 @@ use PHPUnit\Framework\Assert;
require __DIR__ . '/../../vendor/autoload.php'; require __DIR__ . '/../../vendor/autoload.php';
trait Avatar { trait Avatar {
/** @var string **/ /** @var string **/
private $lastAvatar; private $lastAvatar;

View File

@ -73,7 +73,6 @@ trait BasicStructure {
protected $remoteBaseUrl; protected $remoteBaseUrl;
public function __construct($baseUrl, $admin, $regular_user_password) { public function __construct($baseUrl, $admin, $regular_user_password) {
// Initialize your context here // Initialize your context here
$this->baseUrl = $baseUrl; $this->baseUrl = $baseUrl;
$this->adminUser = $admin; $this->adminUser = $admin;

View File

@ -23,7 +23,6 @@
use PHPUnit\Framework\Assert; use PHPUnit\Framework\Assert;
trait ContactsMenu { trait ContactsMenu {
// BasicStructure trait is expected to be used in the class that uses this // BasicStructure trait is expected to be used in the class that uses this
// trait. // trait.

View File

@ -26,7 +26,6 @@ use PHPUnit\Framework\Assert;
require __DIR__ . '/../../vendor/autoload.php'; require __DIR__ . '/../../vendor/autoload.php';
trait Download { trait Download {
/** @var string **/ /** @var string **/
private $downloadedFile; private $downloadedFile;

View File

@ -21,7 +21,6 @@
* *
*/ */
trait Mail { trait Mail {
// CommandLine trait is expected to be used in the class that uses this // CommandLine trait is expected to be used in the class that uses this
// trait. // trait.

View File

@ -24,7 +24,6 @@ use Behat\Gherkin\Node\TableNode;
use PHPUnit\Framework\Assert; use PHPUnit\Framework\Assert;
trait Search { trait Search {
// BasicStructure trait is expected to be used in the class that uses this // BasicStructure trait is expected to be used in the class that uses this
// trait. // trait.

View File

@ -23,7 +23,6 @@
use Behat\Behat\Context\Context; use Behat\Behat\Context\Context;
class TalkContext implements Context { class TalkContext implements Context {
/** /**
* @BeforeFeature @Talk * @BeforeFeature @Talk
* @BeforeScenario @Talk * @BeforeScenario @Talk

View File

@ -31,7 +31,6 @@ require __DIR__ . '/../../vendor/autoload.php';
* Trashbin functions * Trashbin functions
*/ */
trait Trashbin { trait Trashbin {
// WebDav trait is expected to be used in the class that uses this trait. // WebDav trait is expected to be used in the class that uses this trait.
/** /**

View File

@ -107,11 +107,11 @@ class ListApps extends Base {
$output->writeln('Disabled:'); $output->writeln('Disabled:');
parent::writeArrayInOutputFormat($input, $output, $items['disabled']); parent::writeArrayInOutputFormat($input, $output, $items['disabled']);
break; break;
default: default:
parent::writeArrayInOutputFormat($input, $output, $items); parent::writeArrayInOutputFormat($input, $output, $items);
break; break;
} }
} }

View File

@ -77,7 +77,7 @@ class ListConfigs extends Base {
$configs = [ $configs = [
'system' => $this->getSystemConfigs($noSensitiveValues), 'system' => $this->getSystemConfigs($noSensitiveValues),
]; ];
break; break;
case 'all': case 'all':
$apps = $this->appConfig->getApps(); $apps = $this->appConfig->getApps();
@ -88,7 +88,7 @@ class ListConfigs extends Base {
foreach ($apps as $appName) { foreach ($apps as $appName) {
$configs['apps'][$appName] = $this->getAppConfigs($appName, $noSensitiveValues); $configs['apps'][$appName] = $this->getAppConfigs($appName, $noSensitiveValues);
} }
break; break;
default: default:
$configs = [ $configs = [

View File

@ -74,7 +74,6 @@ class Install extends Command {
} }
protected function execute(InputInterface $input, OutputInterface $output): int { protected function execute(InputInterface $input, OutputInterface $output): int {
// validate the environment // validate the environment
$server = \OC::$server; $server = \OC::$server;
$setupHelper = new Setup( $setupHelper = new Setup(

View File

@ -95,10 +95,10 @@ class Upgrade extends Command {
$self = $this; $self = $this;
$updater = new Updater( $updater = new Updater(
$this->config, $this->config,
\OC::$server->getIntegrityCodeChecker(), \OC::$server->getIntegrityCodeChecker(),
$this->logger, $this->logger,
$this->installer $this->installer
); );
/** @var IEventDispatcher $dispatcher */ /** @var IEventDispatcher $dispatcher */

View File

@ -308,16 +308,16 @@ class AvatarController extends Controller {
return new JSONResponse(['data' => [ return new JSONResponse(['data' => [
'message' => $this->l->t("No temporary profile picture available, try again") 'message' => $this->l->t("No temporary profile picture available, try again")
]], ]],
Http::STATUS_NOT_FOUND); Http::STATUS_NOT_FOUND);
} }
$image = new \OCP\Image(); $image = new \OCP\Image();
$image->loadFromData($tmpAvatar); $image->loadFromData($tmpAvatar);
$resp = new DataDisplayResponse( $resp = new DataDisplayResponse(
$image->data() ?? '', $image->data() ?? '',
Http::STATUS_OK, Http::STATUS_OK,
['Content-Type' => $image->mimeType()]); ['Content-Type' => $image->mimeType()]);
$resp->setETag((string)crc32($image->data() ?? '')); $resp->setETag((string)crc32($image->data() ?? ''));
$resp->cacheFor(0); $resp->cacheFor(0);
@ -331,12 +331,12 @@ class AvatarController extends Controller {
public function postCroppedAvatar(?array $crop = null): JSONResponse { public function postCroppedAvatar(?array $crop = null): JSONResponse {
if (is_null($crop)) { if (is_null($crop)) {
return new JSONResponse(['data' => ['message' => $this->l->t("No crop data provided")]], return new JSONResponse(['data' => ['message' => $this->l->t("No crop data provided")]],
Http::STATUS_BAD_REQUEST); Http::STATUS_BAD_REQUEST);
} }
if (!isset($crop['x'], $crop['y'], $crop['w'], $crop['h'])) { if (!isset($crop['x'], $crop['y'], $crop['w'], $crop['h'])) {
return new JSONResponse(['data' => ['message' => $this->l->t("No valid crop data provided")]], return new JSONResponse(['data' => ['message' => $this->l->t("No valid crop data provided")]],
Http::STATUS_BAD_REQUEST); Http::STATUS_BAD_REQUEST);
} }
$tmpAvatar = $this->cache->get('tmpAvatar'); $tmpAvatar = $this->cache->get('tmpAvatar');
@ -344,7 +344,7 @@ class AvatarController extends Controller {
return new JSONResponse(['data' => [ return new JSONResponse(['data' => [
'message' => $this->l->t("No temporary profile picture available, try again") 'message' => $this->l->t("No temporary profile picture available, try again")
]], ]],
Http::STATUS_BAD_REQUEST); Http::STATUS_BAD_REQUEST);
} }
$image = new \OCP\Image(); $image = new \OCP\Image();
@ -358,7 +358,7 @@ class AvatarController extends Controller {
return new JSONResponse(['status' => 'success']); return new JSONResponse(['status' => 'success']);
} catch (\OC\NotSquareException $e) { } catch (\OC\NotSquareException $e) {
return new JSONResponse(['data' => ['message' => $this->l->t('Crop is not square')]], return new JSONResponse(['data' => ['message' => $this->l->t('Crop is not square')]],
Http::STATUS_BAD_REQUEST); Http::STATUS_BAD_REQUEST);
} catch (\Exception $e) { } catch (\Exception $e) {
$this->logger->error($e->getMessage(), ['exception' => $e, 'app' => 'core']); $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => 'core']);
return new JSONResponse(['data' => ['message' => $this->l->t('An error occurred. Please contact your admin.')]], Http::STATUS_BAD_REQUEST); return new JSONResponse(['data' => ['message' => $this->l->t('An error occurred. Please contact your admin.')]], Http::STATUS_BAD_REQUEST);

View File

@ -28,7 +28,6 @@ use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Response; use OCP\AppFramework\Http\Response;
class WalledGardenController extends Controller { class WalledGardenController extends Controller {
/** /**
* @PublicPage * @PublicPage
* @NoCSRFRequired * @NoCSRFRequired

View File

@ -33,7 +33,6 @@ use OCP\AppFramework\Http\Response;
use OCP\IRequest; use OCP\IRequest;
class WellKnownController extends Controller { class WellKnownController extends Controller {
/** @var RequestManager */ /** @var RequestManager */
private $requestManager; private $requestManager;

View File

@ -37,7 +37,6 @@ use OCP\IUserSession;
use OCP\L10N\IFactory; use OCP\L10N\IFactory;
class WhatsNewController extends OCSController { class WhatsNewController extends OCSController {
/** @var IConfig */ /** @var IConfig */
protected $config; protected $config;
/** @var IUserSession */ /** @var IUserSession */

View File

@ -33,7 +33,6 @@ use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest; use OCP\IRequest;
class WipeController extends Controller { class WipeController extends Controller {
/** @var RemoteWipe */ /** @var RemoteWipe */
private $remoteWipe; private $remoteWipe;

View File

@ -26,7 +26,6 @@ declare(strict_types=1);
namespace OC\Core\Data; namespace OC\Core\Data;
class LoginFlowV2Tokens { class LoginFlowV2Tokens {
/** @var string */ /** @var string */
private $loginToken; private $loginToken;
/** @var string */ /** @var string */

View File

@ -40,7 +40,6 @@ use OCP\Profile\ParameterDoesNotExistException;
* @method void setConfig(string $config) * @method void setConfig(string $config)
*/ */
class ProfileConfig extends Entity implements JsonSerializable { class ProfileConfig extends Entity implements JsonSerializable {
/** /**
* Visible to users, guests, and public access * Visible to users, guests, and public access
* *

View File

@ -46,7 +46,6 @@ use OCP\IURLGenerator;
use OCP\IUser; use OCP\IUser;
class TwoFactorMiddleware extends Middleware { class TwoFactorMiddleware extends Middleware {
/** @var Manager */ /** @var Manager */
private $twoFactorManager; private $twoFactorManager;

View File

@ -39,7 +39,6 @@ use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep; use OCP\Migration\SimpleMigrationStep;
class Version13000Date20170718121200 extends SimpleMigrationStep { class Version13000Date20170718121200 extends SimpleMigrationStep {
/** @var IDBConnection */ /** @var IDBConnection */
private $connection; private $connection;

View File

@ -28,7 +28,6 @@ use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep; use OCP\Migration\SimpleMigrationStep;
class Version13000Date20170814074715 extends SimpleMigrationStep { class Version13000Date20170814074715 extends SimpleMigrationStep {
/** /**
* @param IOutput $output * @param IOutput $output
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -33,7 +33,6 @@ use OCP\Migration\SimpleMigrationStep;
* Auto-generated migration step: Please modify to your needs! * Auto-generated migration step: Please modify to your needs!
*/ */
class Version13000Date20170919121250 extends SimpleMigrationStep { class Version13000Date20170919121250 extends SimpleMigrationStep {
/** /**
* @param IOutput $output * @param IOutput $output
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -29,7 +29,6 @@ use OCP\Migration\BigIntMigration;
* Auto-generated migration step: Please modify to your needs! * Auto-generated migration step: Please modify to your needs!
*/ */
class Version13000Date20170926101637 extends BigIntMigration { class Version13000Date20170926101637 extends BigIntMigration {
/** /**
* @return array Returns an array with the following structure * @return array Returns an array with the following structure
* ['table1' => ['column1', 'column2'], ...] * ['table1' => ['column1', 'column2'], ...]

View File

@ -35,7 +35,6 @@ use OCP\Migration\SimpleMigrationStep;
* Auto-generated migration step: Please modify to your needs! * Auto-generated migration step: Please modify to your needs!
*/ */
class Version14000Date20180404140050 extends SimpleMigrationStep { class Version14000Date20180404140050 extends SimpleMigrationStep {
/** @var IDBConnection */ /** @var IDBConnection */
private $connection; private $connection;

View File

@ -27,7 +27,6 @@ use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep; use OCP\Migration\SimpleMigrationStep;
class Version14000Date20180516101403 extends SimpleMigrationStep { class Version14000Date20180516101403 extends SimpleMigrationStep {
/** /**
* @param IOutput $output * @param IOutput $output
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -32,7 +32,6 @@ use OCP\Migration\SimpleMigrationStep;
*/ */
class Version14000Date20180712153140 extends SimpleMigrationStep { class Version14000Date20180712153140 extends SimpleMigrationStep {
public function changeSchema(\OCP\Migration\IOutput $output, \Closure $schemaClosure, array $options) { public function changeSchema(\OCP\Migration\IOutput $output, \Closure $schemaClosure, array $options) {
/** @var ISchemaWrapper $schema */ /** @var ISchemaWrapper $schema */
$schema = $schemaClosure(); $schema = $schemaClosure();

View File

@ -32,7 +32,6 @@ use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep; use OCP\Migration\SimpleMigrationStep;
class Version15000Date20180926101451 extends SimpleMigrationStep { class Version15000Date20180926101451 extends SimpleMigrationStep {
/** /**
* @param IOutput $output * @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -32,7 +32,6 @@ use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep; use OCP\Migration\SimpleMigrationStep;
class Version15000Date20181015062942 extends SimpleMigrationStep { class Version15000Date20181015062942 extends SimpleMigrationStep {
/** /**
* @param IOutput $output * @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -32,7 +32,6 @@ use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep; use OCP\Migration\SimpleMigrationStep;
class Version15000Date20181029084625 extends SimpleMigrationStep { class Version15000Date20181029084625 extends SimpleMigrationStep {
/** /**
* @param IOutput $output * @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -35,8 +35,6 @@ use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep; use OCP\Migration\SimpleMigrationStep;
class Version16000Date20190207141427 extends SimpleMigrationStep { class Version16000Date20190207141427 extends SimpleMigrationStep {
/** /**
* @param IOutput $output * @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -33,7 +33,6 @@ use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep; use OCP\Migration\SimpleMigrationStep;
class Version16000Date20190427105638 extends SimpleMigrationStep { class Version16000Date20190427105638 extends SimpleMigrationStep {
/** @var IDBConnection */ /** @var IDBConnection */
private $connection; private $connection;

View File

@ -35,7 +35,6 @@ use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep; use OCP\Migration\SimpleMigrationStep;
class Version16000Date20190428150708 extends SimpleMigrationStep { class Version16000Date20190428150708 extends SimpleMigrationStep {
/** /**
* @param IOutput $output * @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -36,7 +36,6 @@ use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep; use OCP\Migration\SimpleMigrationStep;
class Version17000Date20190514105811 extends SimpleMigrationStep { class Version17000Date20190514105811 extends SimpleMigrationStep {
/** /**
* @param IOutput $output * @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -36,7 +36,6 @@ use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep; use OCP\Migration\SimpleMigrationStep;
class Version18000Date20190920085628 extends SimpleMigrationStep { class Version18000Date20190920085628 extends SimpleMigrationStep {
/** @var IDBConnection */ /** @var IDBConnection */
protected $connection; protected $connection;

View File

@ -36,7 +36,6 @@ use OCP\Migration\SimpleMigrationStep;
use OCP\Migration\IOutput; use OCP\Migration\IOutput;
class Version18000Date20191014105105 extends SimpleMigrationStep { class Version18000Date20191014105105 extends SimpleMigrationStep {
/** @var IDBConnection */ /** @var IDBConnection */
protected $connection; protected $connection;

View File

@ -32,7 +32,6 @@ use OCP\Migration\SimpleMigrationStep;
use OCP\Migration\IOutput; use OCP\Migration\IOutput;
class Version18000Date20191204114856 extends SimpleMigrationStep { class Version18000Date20191204114856 extends SimpleMigrationStep {
/** @var IDBConnection */ /** @var IDBConnection */
protected $connection; protected $connection;

View File

@ -35,7 +35,6 @@ use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep; use OCP\Migration\SimpleMigrationStep;
class Version20000Date20201109081918 extends SimpleMigrationStep { class Version20000Date20201109081918 extends SimpleMigrationStep {
/** @var IDBConnection */ /** @var IDBConnection */
protected $connection; protected $connection;

View File

@ -31,7 +31,6 @@ use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep; use OCP\Migration\SimpleMigrationStep;
class Version20000Date20201109081919 extends SimpleMigrationStep { class Version20000Date20201109081919 extends SimpleMigrationStep {
/** /**
* @param IOutput $output * @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -30,7 +30,6 @@ use OCP\Migration\SimpleMigrationStep;
use OCP\Migration\IOutput; use OCP\Migration\IOutput;
class Version23000Date20210721100600 extends SimpleMigrationStep { class Version23000Date20210721100600 extends SimpleMigrationStep {
/** /**
* @param IOutput $output * @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -29,7 +29,6 @@ namespace OC\Core\Migrations;
use OCP\Migration\BigIntMigration; use OCP\Migration\BigIntMigration;
class Version23000Date20211213203940 extends BigIntMigration { class Version23000Date20211213203940 extends BigIntMigration {
/** /**
* @return array Returns an array with the following structure * @return array Returns an array with the following structure
* ['table1' => ['column1', 'column2'], ...] * ['table1' => ['column1', 'column2'], ...]

View File

@ -37,7 +37,6 @@ use OCP\Migration\SimpleMigrationStep;
* *
*/ */
class Version24000Date20211210141942 extends SimpleMigrationStep { class Version24000Date20211210141942 extends SimpleMigrationStep {
/** @var IDBConnection */ /** @var IDBConnection */
protected $connection; protected $connection;

View File

@ -33,7 +33,6 @@ use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep; use OCP\Migration\SimpleMigrationStep;
class Version25000Date20220602190540 extends SimpleMigrationStep { class Version25000Date20220602190540 extends SimpleMigrationStep {
/** /**
* @param IOutput $output * @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -33,7 +33,6 @@ use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep; use OCP\Migration\SimpleMigrationStep;
class Version25000Date20220905140840 extends SimpleMigrationStep { class Version25000Date20220905140840 extends SimpleMigrationStep {
/** /**
* @param IOutput $output * @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -112,10 +112,10 @@ if (\OCP\Util::needUpgrade()) {
$logger = \OC::$server->get(\Psr\Log\LoggerInterface::class); $logger = \OC::$server->get(\Psr\Log\LoggerInterface::class);
$config = \OC::$server->getConfig(); $config = \OC::$server->getConfig();
$updater = new \OC\Updater( $updater = new \OC\Updater(
$config, $config,
\OC::$server->getIntegrityCodeChecker(), \OC::$server->getIntegrityCodeChecker(),
$logger, $logger,
\OC::$server->query(\OC\Installer::class) \OC::$server->query(\OC\Installer::class)
); );
$incompatibleApps = []; $incompatibleApps = [];

View File

@ -55,19 +55,19 @@ $application->add(new OC\Core\Command\Status(\OC::$server->get(\OCP\IConfig::cla
$application->add(new OC\Core\Command\Check(\OC::$server->getSystemConfig())); $application->add(new OC\Core\Command\Check(\OC::$server->getSystemConfig()));
$application->add(new OC\Core\Command\L10n\CreateJs()); $application->add(new OC\Core\Command\L10n\CreateJs());
$application->add(new \OC\Core\Command\Integrity\SignApp( $application->add(new \OC\Core\Command\Integrity\SignApp(
\OC::$server->getIntegrityCodeChecker(), \OC::$server->getIntegrityCodeChecker(),
new \OC\IntegrityCheck\Helpers\FileAccessHelper(), new \OC\IntegrityCheck\Helpers\FileAccessHelper(),
\OC::$server->getURLGenerator() \OC::$server->getURLGenerator()
)); ));
$application->add(new \OC\Core\Command\Integrity\SignCore( $application->add(new \OC\Core\Command\Integrity\SignCore(
\OC::$server->getIntegrityCodeChecker(), \OC::$server->getIntegrityCodeChecker(),
new \OC\IntegrityCheck\Helpers\FileAccessHelper() new \OC\IntegrityCheck\Helpers\FileAccessHelper()
)); ));
$application->add(new \OC\Core\Command\Integrity\CheckApp( $application->add(new \OC\Core\Command\Integrity\CheckApp(
\OC::$server->getIntegrityCodeChecker() \OC::$server->getIntegrityCodeChecker()
)); ));
$application->add(new \OC\Core\Command\Integrity\CheckCore( $application->add(new \OC\Core\Command\Integrity\CheckCore(
\OC::$server->getIntegrityCodeChecker() \OC::$server->getIntegrityCodeChecker()
)); ));
@ -142,21 +142,21 @@ if (\OC::$server->getConfig()->getSystemValue('installed', false)) {
\OC::$server->getConfig() \OC::$server->getConfig()
); );
$application->add(new OC\Core\Command\Encryption\ChangeKeyStorageRoot( $application->add(new OC\Core\Command\Encryption\ChangeKeyStorageRoot(
$view, $view,
\OC::$server->getUserManager(), \OC::$server->getUserManager(),
\OC::$server->getConfig(), \OC::$server->getConfig(),
$util, $util,
new \Symfony\Component\Console\Helper\QuestionHelper() new \Symfony\Component\Console\Helper\QuestionHelper()
) )
); );
$application->add(new OC\Core\Command\Encryption\ShowKeyStorageRoot($util)); $application->add(new OC\Core\Command\Encryption\ShowKeyStorageRoot($util));
$application->add(new OC\Core\Command\Encryption\MigrateKeyStorage( $application->add(new OC\Core\Command\Encryption\MigrateKeyStorage(
$view, $view,
\OC::$server->getUserManager(), \OC::$server->getUserManager(),
\OC::$server->getConfig(), \OC::$server->getConfig(),
$util, $util,
\OC::$server->getCrypto() \OC::$server->getCrypto()
) )
); );
$application->add(new OC\Core\Command\Maintenance\DataFingerprint(\OC::$server->getConfig(), new \OC\AppFramework\Utility\TimeFactory())); $application->add(new OC\Core\Command\Maintenance\DataFingerprint(\OC::$server->getConfig(), new \OC\AppFramework\Utility\TimeFactory()));

View File

@ -12,6 +12,6 @@ if (!isset($_)) {//standalone page is not supported anymore - redirect to /
<div class="guest-box"> <div class="guest-box">
<h2><?php p($l->t('Access forbidden')); ?></h2> <h2><?php p($l->t('Access forbidden')); ?></h2>
<p class='hint'><?php if (isset($_['message'])) { <p class='hint'><?php if (isset($_['message'])) {
p($_['message']); p($_['message']);
}?></p> }?></p>
</ul> </ul>

View File

@ -9,8 +9,8 @@
<title> <title>
<?php <?php
p(!empty($_['pageTitle']) ? $_['pageTitle'] . ' ' : ''); p(!empty($_['pageTitle']) ? $_['pageTitle'] . ' ' : '');
p($theme->getTitle()); p($theme->getTitle());
?> ?>
</title> </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<?php if ($theme->getiTunesAppId() !== '') { ?> <?php if ($theme->getiTunesAppId() !== '') { ?>

View File

@ -2,10 +2,10 @@
<div id="nojavascript"> <div id="nojavascript">
<div> <div>
<?php print_unescaped(str_replace( <?php print_unescaped(str_replace(
['{linkstart}', '{linkend}'], ['{linkstart}', '{linkend}'],
['<a href="https://www.enable-javascript.com/" target="_blank" rel="noreferrer noopener">', '</a>'], ['<a href="https://www.enable-javascript.com/" target="_blank" rel="noreferrer noopener">', '</a>'],
$l->t('This application requires JavaScript for correct operation. Please {linkstart}enable JavaScript{linkend} and reload the page.') $l->t('This application requires JavaScript for correct operation. Please {linkstart}enable JavaScript{linkend} and reload the page.')
)); ?> )); ?>
</div> </div>
</div> </div>
</noscript> </noscript>

View File

@ -5,8 +5,8 @@
<title> <title>
<?php <?php
p(!empty($_['application'])?$_['application'].' - ':''); p(!empty($_['application'])?$_['application'].' - ':'');
p($theme->getTitle()); p($theme->getTitle());
?> ?>
</title> </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<?php if ($theme->getiTunesAppId() !== '') { ?> <?php if ($theme->getiTunesAppId() !== '') { ?>
@ -55,10 +55,10 @@
<div class="header-right"> <div class="header-right">
<?php <?php
/** @var \OCP\AppFramework\Http\Template\PublicTemplateResponse $template */ /** @var \OCP\AppFramework\Http\Template\PublicTemplateResponse $template */
if (isset($template) && $template->getActionCount() !== 0) { if (isset($template) && $template->getActionCount() !== 0) {
$primary = $template->getPrimaryAction(); $primary = $template->getPrimaryAction();
$others = $template->getOtherActions(); ?> $others = $template->getOtherActions(); ?>
<span id="header-primary-action" class="<?php if ($template->getActionCount() === 1) { <span id="header-primary-action" class="<?php if ($template->getActionCount() === 1) {
p($primary->getIcon()); p($primary->getIcon());
} ?>"> } ?>">
@ -76,13 +76,13 @@
foreach ($others as $action) { foreach ($others as $action) {
print_unescaped($action->render()); print_unescaped($action->render());
} }
?> ?>
</ul> </ul>
</div> </div>
</div> </div>
<?php } ?> <?php } ?>
<?php <?php
} ?> } ?>
</div> </div>
</header> </header>
<main id="content" class="app-<?php p($_['appid']) ?>"> <main id="content" class="app-<?php p($_['appid']) ?>">
@ -99,15 +99,15 @@
<footer> <footer>
<p><?php print_unescaped($theme->getLongFooter()); ?></p> <p><?php print_unescaped($theme->getLongFooter()); ?></p>
<?php <?php
if ($_['showSimpleSignUpLink']) { if ($_['showSimpleSignUpLink']) {
?> ?>
<p> <p>
<a href="https://nextcloud.com/signup/" target="_blank" rel="noreferrer noopener"> <a href="https://nextcloud.com/signup/" target="_blank" rel="noreferrer noopener">
<?php p($l->t('Get your own free account')); ?> <?php p($l->t('Get your own free account')); ?>
</a> </a>
</p> </p>
<?php <?php
} }
?> ?>
</footer> </footer>
<?php } ?> <?php } ?>

View File

@ -19,9 +19,9 @@ $getUserAvatar = static function (int $size) use ($_): string {
<title> <title>
<?php <?php
p(!empty($_['pageTitle'])?$_['pageTitle'].' - ':''); p(!empty($_['pageTitle'])?$_['pageTitle'].' - ':'');
p(!empty($_['application'])?$_['application'].' - ':''); p(!empty($_['application'])?$_['application'].' - ':'');
p($theme->getTitle()); p($theme->getTitle());
?> ?>
</title> </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
@ -43,8 +43,8 @@ $getUserAvatar = static function (int $size) use ($_): string {
<?php print_unescaped($_['headers']); ?> <?php print_unescaped($_['headers']); ?>
</head> </head>
<body id="<?php p($_['bodyid']);?>" <?php foreach ($_['enabledThemes'] as $themeId) { <body id="<?php p($_['bodyid']);?>" <?php foreach ($_['enabledThemes'] as $themeId) {
p("data-theme-$themeId "); p("data-theme-$themeId ");
}?> data-themes=<?php p(join(',', $_['enabledThemes'])) ?>> }?> data-themes=<?php p(join(',', $_['enabledThemes'])) ?>>
<?php include 'layout.noscript.warning.php'; ?> <?php include 'layout.noscript.warning.php'; ?>
<?php foreach ($_['initialStates'] as $app => $initialState) { ?> <?php foreach ($_['initialStates'] as $app => $initialState) { ?>
@ -75,19 +75,19 @@ $getUserAvatar = static function (int $size) use ($_): string {
aria-label="<?php p($l->t('Open settings menu'));?>" aria-label="<?php p($l->t('Open settings menu'));?>"
aria-haspopup="true" aria-controls="expanddiv" aria-expanded="false"> aria-haspopup="true" aria-controls="expanddiv" aria-expanded="false">
<div id="avatardiv-menu" class="avatardiv<?php if ($_['userAvatarSet']) { <div id="avatardiv-menu" class="avatardiv<?php if ($_['userAvatarSet']) {
print_unescaped(' avatardiv-shown'); print_unescaped(' avatardiv-shown');
} else { } else {
print_unescaped('" style="display: none'); print_unescaped('" style="display: none');
} ?>" } ?>"
data-user="<?php p($_['user_uid']); ?>" data-user="<?php p($_['user_uid']); ?>"
data-displayname="<?php p($_['user_displayname']); ?>" data-displayname="<?php p($_['user_displayname']); ?>"
<?php <?php
if ($_['userAvatarSet']) { if ($_['userAvatarSet']) {
$avatar32 = $getUserAvatar(32); ?> data-avatar="<?php p($avatar32); ?>" $avatar32 = $getUserAvatar(32); ?> data-avatar="<?php p($avatar32); ?>"
<?php <?php
} ?>> } ?>>
<?php <?php
if ($_['userAvatarSet']) {?> if ($_['userAvatarSet']) {?>
<img alt="" width="32" height="32" <img alt="" width="32" height="32"
src="<?php p($avatar32);?>" src="<?php p($avatar32);?>"
srcset="<?php p($getUserAvatar(64));?> 2x, <?php p($getUserAvatar(128));?> 4x" srcset="<?php p($getUserAvatar(64));?> 2x, <?php p($getUserAvatar(128));?> 4x"

View File

@ -4,7 +4,7 @@
\OCP\Util::addStyle('core', 'guest'); \OCP\Util::addStyle('core', 'guest');
\OCP\Util::addStyle('core', 'publicshareauth'); \OCP\Util::addStyle('core', 'publicshareauth');
\OCP\Util::addScript('core', 'publicshareauth'); \OCP\Util::addScript('core', 'publicshareauth');
?> ?>
<div class="guest-box"> <div class="guest-box">
<!-- password prompt form. It should be hidden when we show the email prompt form --> <!-- password prompt form. It should be hidden when we show the email prompt form -->

View File

@ -37,18 +37,18 @@ $noProviders = empty($_['providers']);
<li> <li>
<a class="two-factor-provider" <a class="two-factor-provider"
href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge', href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge',
[ [
'challengeProviderId' => $provider->getId(), 'challengeProviderId' => $provider->getId(),
'redirect_url' => $_['redirect_url'], 'redirect_url' => $_['redirect_url'],
] ]
)) ?>"> )) ?>">
<?php <?php
if ($provider instanceof \OCP\Authentication\TwoFactorAuth\IProvidesIcons) { if ($provider instanceof \OCP\Authentication\TwoFactorAuth\IProvidesIcons) {
$icon = $provider->getLightIcon(); $icon = $provider->getLightIcon();
} else { } else {
$icon = image_path('core', 'actions/password-white.svg'); $icon = image_path('core', 'actions/password-white.svg');
} }
?> ?>
<img src="<?php p($icon) ?>" alt="" /> <img src="<?php p($icon) ?>" alt="" />
<div> <div>
<h3><?php p($provider->getDisplayName()) ?></h3> <h3><?php p($provider->getDisplayName()) ?></h3>

View File

@ -31,17 +31,17 @@ declare(strict_types=1);
<li> <li>
<a class="two-factor-provider" <a class="two-factor-provider"
href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.setupProvider', href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.setupProvider',
[ [
'providerId' => $provider->getId(), 'providerId' => $provider->getId(),
] ]
)) ?>"> )) ?>">
<?php <?php
if ($provider instanceof \OCP\Authentication\TwoFactorAuth\IProvidesIcons) { if ($provider instanceof \OCP\Authentication\TwoFactorAuth\IProvidesIcons) {
$icon = $provider->getLightIcon(); $icon = $provider->getLightIcon();
} else { } else {
$icon = image_path('core', 'actions/password-white.svg'); $icon = image_path('core', 'actions/password-white.svg');
} }
?> ?>
<img src="<?php p($icon) ?>" alt="" /> <img src="<?php p($icon) ?>" alt="" />
<div> <div>
<h3><?php p($provider->getDisplayName()) ?></h3> <h3><?php p($provider->getDisplayName()) ?></h3>

View File

@ -3,12 +3,12 @@
<h2 class="title"><?php p($l->t('Update needed')) ?></h2> <h2 class="title"><?php p($l->t('Update needed')) ?></h2>
<div class="text-left"> <div class="text-left">
<?php if ($_['tooBig']) { <?php if ($_['tooBig']) {
p($l->t('Please use the command line updater because you have a big instance with more than 50 users.')); p($l->t('Please use the command line updater because you have a big instance with more than 50 users.'));
} else { } else {
p($l->t('Please use the command line updater because automatic updating is disabled in the config.php.')); p($l->t('Please use the command line updater because automatic updating is disabled in the config.php.'));
} ?><br><br> } ?><br><br>
<?php <?php
print_unescaped($l->t('For help, see the <a target="_blank" rel="noreferrer noopener" href="%s">documentation</a>.', [link_to_docs('admin-cli-upgrade')])); ?> print_unescaped($l->t('For help, see the <a target="_blank" rel="noreferrer noopener" href="%s">documentation</a>.', [link_to_docs('admin-cli-upgrade')])); ?>
</div> </div>
</div> </div>

View File

@ -32,7 +32,6 @@ use OCP\Accounts\IAccountManager;
use OCP\Accounts\IAccountProperty; use OCP\Accounts\IAccountProperty;
class AccountProperty implements IAccountProperty { class AccountProperty implements IAccountProperty {
/** @var string */ /** @var string */
private $name; private $name;
/** @var string */ /** @var string */

View File

@ -32,7 +32,6 @@ use OCP\Accounts\IAccountProperty;
use OCP\Accounts\IAccountPropertyCollection; use OCP\Accounts\IAccountPropertyCollection;
class AccountPropertyCollection implements IAccountPropertyCollection { class AccountPropertyCollection implements IAccountPropertyCollection {
/** @var string */ /** @var string */
protected $collectionName = ''; protected $collectionName = '';

View File

@ -36,7 +36,6 @@ use Psr\Log\LoggerInterface;
* @template-implements IEventListener<UserChangedEvent> * @template-implements IEventListener<UserChangedEvent>
*/ */
class Hooks implements IEventListener { class Hooks implements IEventListener {
/** @var IAccountManager */ /** @var IAccountManager */
private $accountManager; private $accountManager;
/** @var LoggerInterface */ /** @var LoggerInterface */

View File

@ -29,7 +29,6 @@ use OCP\Activity\IEventMerger;
use OCP\IL10N; use OCP\IL10N;
class EventMerger implements IEventMerger { class EventMerger implements IEventMerger {
/** @var IL10N */ /** @var IL10N */
protected $l10n; protected $l10n;

View File

@ -52,7 +52,6 @@ use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class AppManager implements IAppManager { class AppManager implements IAppManager {
/** /**
* Apps with these types can not be enabled for certain groups only * Apps with these types can not be enabled for certain groups only
* @var string[] * @var string[]

View File

@ -24,7 +24,6 @@
namespace OC\App\AppStore\Bundles; namespace OC\App\AppStore\Bundles;
class EducationBundle extends Bundle { class EducationBundle extends Bundle {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */

View File

@ -24,7 +24,6 @@
namespace OC\App\AppStore\Bundles; namespace OC\App\AppStore\Bundles;
class EnterpriseBundle extends Bundle { class EnterpriseBundle extends Bundle {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */

View File

@ -25,7 +25,6 @@
namespace OC\App\AppStore\Bundles; namespace OC\App\AppStore\Bundles;
class GroupwareBundle extends Bundle { class GroupwareBundle extends Bundle {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */

View File

@ -24,7 +24,6 @@
namespace OC\App\AppStore\Bundles; namespace OC\App\AppStore\Bundles;
class SocialSharingBundle extends Bundle { class SocialSharingBundle extends Bundle {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */

View File

@ -39,7 +39,6 @@ use OCP\Support\Subscription\IRegistry;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
class AppFetcher extends Fetcher { class AppFetcher extends Fetcher {
/** @var CompareVersion */ /** @var CompareVersion */
private $compareVersion; private $compareVersion;
@ -117,15 +116,15 @@ class AppFetcher extends Fetcher {
$minPhpVersion = $phpVersion->getMinimumVersion(); $minPhpVersion = $phpVersion->getMinimumVersion();
$maxPhpVersion = $phpVersion->getMaximumVersion(); $maxPhpVersion = $phpVersion->getMaximumVersion();
$minPhpFulfilled = $minPhpVersion === '' || $this->compareVersion->isCompatible( $minPhpFulfilled = $minPhpVersion === '' || $this->compareVersion->isCompatible(
PHP_VERSION, PHP_VERSION,
$minPhpVersion, $minPhpVersion,
'>=' '>='
); );
$maxPhpFulfilled = $maxPhpVersion === '' || $this->compareVersion->isCompatible( $maxPhpFulfilled = $maxPhpVersion === '' || $this->compareVersion->isCompatible(
PHP_VERSION, PHP_VERSION,
$maxPhpVersion, $maxPhpVersion,
'<=' '<='
); );
$isPhpCompatible = $minPhpFulfilled && $maxPhpFulfilled; $isPhpCompatible = $minPhpFulfilled && $maxPhpFulfilled;
} }

View File

@ -167,10 +167,8 @@ abstract class Fetcher {
// Always get latests apps info if $allowUnstable // Always get latests apps info if $allowUnstable
if (!$allowUnstable && is_array($jsonBlob)) { if (!$allowUnstable && is_array($jsonBlob)) {
// No caching when the version has been updated // No caching when the version has been updated
if (isset($jsonBlob['ncversion']) && $jsonBlob['ncversion'] === $this->getVersion()) { if (isset($jsonBlob['ncversion']) && $jsonBlob['ncversion'] === $this->getVersion()) {
// If the timestamp is older than 3600 seconds request the files new // If the timestamp is older than 3600 seconds request the files new
if ((int)$jsonBlob['timestamp'] > ($this->timeFactory->getTime() - self::INVALIDATE_AFTER_SECONDS)) { if ((int)$jsonBlob['timestamp'] > ($this->timeFactory->getTime() - self::INVALIDATE_AFTER_SECONDS)) {
return $jsonBlob['data']; return $jsonBlob['data'];

View File

@ -33,7 +33,6 @@ namespace OC\App;
use OCP\IL10N; use OCP\IL10N;
class DependencyAnalyzer { class DependencyAnalyzer {
/** @var Platform */ /** @var Platform */
private $platform; private $platform;
/** @var \OCP\IL10N */ /** @var \OCP\IL10N */

View File

@ -267,7 +267,7 @@ class InfoParser {
} else { } else {
$array[$element] = $data; $array[$element] = $data;
} }
// Just a value // Just a value
} else { } else {
if ($totalElement > 1) { if ($totalElement > 1) {
$array[$element][] = $this->xmlToArray($node); $array[$element][] = $this->xmlToArray($node);

View File

@ -42,7 +42,6 @@ use OCP\IConfig;
* database. * database.
*/ */
class AppConfig implements IAppConfig { class AppConfig implements IAppConfig {
/** @var array[] */ /** @var array[] */
protected $sensitiveValues = [ protected $sensitiveValues = [
'circles' => [ 'circles' => [
@ -285,7 +284,6 @@ class AppConfig implements IAppConfig {
* > Large objects (LOBs) are not supported in comparison conditions. * > Large objects (LOBs) are not supported in comparison conditions.
*/ */
if (!($this->conn instanceof OracleConnection)) { if (!($this->conn instanceof OracleConnection)) {
/* /*
* Only update the value when it is not the same * Only update the value when it is not the same
* Note that NULL requires some special handling. Since comparing * Note that NULL requires some special handling. Since comparing

View File

@ -53,7 +53,6 @@ use OCP\IRequest;
* Handles all the dependency injection, controllers and output flow * Handles all the dependency injection, controllers and output flow
*/ */
class App { class App {
/** @var string[] */ /** @var string[] */
private static $nameSpaceCache = []; private static $nameSpaceCache = [];

View File

@ -29,7 +29,6 @@ namespace OC\AppFramework\Bootstrap;
* @psalm-immutable * @psalm-immutable
*/ */
abstract class ARegistration { abstract class ARegistration {
/** @var string */ /** @var string */
private $appId; private $appId;

View File

@ -31,7 +31,6 @@ use OCP\AppFramework\IAppContainer;
use OCP\IServerContainer; use OCP\IServerContainer;
class BootContext implements IBootContext { class BootContext implements IBootContext {
/** @var IAppContainer */ /** @var IAppContainer */
private $appContainer; private $appContainer;

View File

@ -46,7 +46,6 @@ use Psr\Log\LoggerInterface;
use Throwable; use Throwable;
class Coordinator { class Coordinator {
/** @var IServerContainer */ /** @var IServerContainer */
private $serverContainer; private $serverContainer;

View File

@ -30,7 +30,6 @@ namespace OC\AppFramework\Bootstrap;
* @template-extends ServiceRegistration<\OCP\EventDispatcher\IEventListener> * @template-extends ServiceRegistration<\OCP\EventDispatcher\IEventListener>
*/ */
class EventListenerRegistration extends ServiceRegistration { class EventListenerRegistration extends ServiceRegistration {
/** @var string */ /** @var string */
private $event; private $event;

View File

@ -33,7 +33,6 @@ use ReflectionParameter;
use function array_map; use function array_map;
class FunctionInjector { class FunctionInjector {
/** @var ContainerInterface */ /** @var ContainerInterface */
private $container; private $container;

View File

@ -29,7 +29,6 @@ namespace OC\AppFramework\Bootstrap;
* @psalm-immutable * @psalm-immutable
*/ */
final class ParameterRegistration extends ARegistration { final class ParameterRegistration extends ARegistration {
/** @var string */ /** @var string */
private $name; private $name;

View File

@ -30,7 +30,6 @@ namespace OC\AppFramework\Bootstrap;
* @template-extends ServiceRegistration<\OCP\Preview\IProviderV2> * @template-extends ServiceRegistration<\OCP\Preview\IProviderV2>
*/ */
class PreviewProviderRegistration extends ServiceRegistration { class PreviewProviderRegistration extends ServiceRegistration {
/** @var string */ /** @var string */
private $mimeTypeRegex; private $mimeTypeRegex;

View File

@ -58,7 +58,6 @@ use Psr\Log\LoggerInterface;
use Throwable; use Throwable;
class RegistrationContext { class RegistrationContext {
/** @var ServiceRegistration<ICapability>[] */ /** @var ServiceRegistration<ICapability>[] */
private $capabilities = []; private $capabilities = [];

View File

@ -29,7 +29,6 @@ namespace OC\AppFramework\Bootstrap;
* @psalm-immutable * @psalm-immutable
*/ */
class ServiceAliasRegistration extends ARegistration { class ServiceAliasRegistration extends ARegistration {
/** /**
* @var string * @var string
* @psalm-var string|class-string * @psalm-var string|class-string

View File

@ -29,7 +29,6 @@ namespace OC\AppFramework\Bootstrap;
* @psalm-immutable * @psalm-immutable
*/ */
class ServiceFactoryRegistration extends ARegistration { class ServiceFactoryRegistration extends ARegistration {
/** /**
* @var string * @var string
* @psalm-var string|class-string * @psalm-var string|class-string

View File

@ -49,7 +49,6 @@ use Psr\Log\LoggerInterface;
* Class to dispatch the request to the middleware dispatcher * Class to dispatch the request to the middleware dispatcher
*/ */
class Dispatcher { class Dispatcher {
/** @var MiddlewareDispatcher */ /** @var MiddlewareDispatcher */
private $middlewareDispatcher; private $middlewareDispatcher;
@ -169,7 +168,7 @@ class Dispatcher {
} catch (\Throwable $throwable) { } catch (\Throwable $throwable) {
$exception = new \Exception($throwable->getMessage() . ' in file \'' . $throwable->getFile() . '\' line ' . $throwable->getLine(), $throwable->getCode(), $throwable); $exception = new \Exception($throwable->getMessage() . ' in file \'' . $throwable->getFile() . '\' line ' . $throwable->getLine(), $throwable->getCode(), $throwable);
$response = $this->middlewareDispatcher->afterException( $response = $this->middlewareDispatcher->afterException(
$controller, $methodName, $exception); $controller, $methodName, $exception);
} }
$response = $this->middlewareDispatcher->afterController( $response = $this->middlewareDispatcher->afterController(
@ -202,7 +201,6 @@ class Dispatcher {
$types = ['int', 'integer', 'bool', 'boolean', 'float', 'double']; $types = ['int', 'integer', 'bool', 'boolean', 'float', 'double'];
foreach ($this->reflector->getParameters() as $param => $default) { foreach ($this->reflector->getParameters() as $param => $default) {
// try to get the parameter from the request object and cast // try to get the parameter from the request object and cast
// it to the type annotated in the @param annotation // it to the type annotated in the @param annotation
$value = $this->request->getParam($param, $default); $value = $this->request->getParam($param, $default);
@ -234,7 +232,6 @@ class Dispatcher {
// format response // format response
if ($response instanceof DataResponse || !($response instanceof Response)) { if ($response instanceof DataResponse || !($response instanceof Response)) {
// get format from the url format or request format parameter // get format from the url format or request format parameter
$format = $this->request->getParam('format'); $format = $this->request->getParam('format');

View File

@ -429,7 +429,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
$this->items['post'] = $params; $this->items['post'] = $params;
} }
} }
// Handle application/x-www-form-urlencoded for methods other than GET // Handle application/x-www-form-urlencoded for methods other than GET
// or post correctly // or post correctly
} elseif ($this->method !== 'GET' } elseif ($this->method !== 'GET'
&& $this->method !== 'POST' && $this->method !== 'POST'

View File

@ -32,7 +32,6 @@ use OCP\ILogger;
* @deprecated * @deprecated
*/ */
class Logger implements ILogger { class Logger implements ILogger {
/** @var ILogger */ /** @var ILogger */
private $logger; private $logger;

View File

@ -35,7 +35,6 @@ use OCP\AppFramework\Middleware;
use OCP\IRequest; use OCP\IRequest;
class CompressionMiddleware extends Middleware { class CompressionMiddleware extends Middleware {
/** @var bool */ /** @var bool */
private $useGZip; private $useGZip;

View File

@ -39,7 +39,6 @@ use OCP\AppFramework\Middleware;
* This class is used to store and run all the middleware in correct order * This class is used to store and run all the middleware in correct order
*/ */
class MiddlewareDispatcher { class MiddlewareDispatcher {
/** /**
* @var array array containing all the middlewares * @var array array containing all the middlewares
*/ */

View File

@ -39,7 +39,6 @@ use OCP\AppFramework\OCSController;
use OCP\IRequest; use OCP\IRequest;
class OCSMiddleware extends Middleware { class OCSMiddleware extends Middleware {
/** @var IRequest */ /** @var IRequest */
private $request; private $request;

View File

@ -35,7 +35,6 @@ use OCP\IRequest;
use OCP\ISession; use OCP\ISession;
class PublicShareMiddleware extends Middleware { class PublicShareMiddleware extends Middleware {
/** @var IRequest */ /** @var IRequest */
private $request; private $request;

View File

@ -118,7 +118,6 @@ class CORSMiddleware extends Middleware {
if (isset($this->request->server['HTTP_ORIGIN']) && if (isset($this->request->server['HTTP_ORIGIN']) &&
$this->reflector->hasAnnotation('CORS')) { $this->reflector->hasAnnotation('CORS')) {
// allow credentials headers must not be true or CSRF is possible // allow credentials headers must not be true or CSRF is possible
// otherwise // otherwise
foreach ($response->getHeaders() as $header => $value) { foreach ($response->getHeaders() as $header => $value) {

View File

@ -36,7 +36,6 @@ use OCP\AppFramework\Http\Response;
use OCP\AppFramework\Middleware; use OCP\AppFramework\Middleware;
class CSPMiddleware extends Middleware { class CSPMiddleware extends Middleware {
/** @var ContentSecurityPolicyManager */ /** @var ContentSecurityPolicyManager */
private $contentSecurityPolicyManager; private $contentSecurityPolicyManager;
/** @var ContentSecurityPolicyNonceManager */ /** @var ContentSecurityPolicyNonceManager */

View File

@ -33,7 +33,6 @@ use OCP\AppFramework\Http\Response;
use OCP\AppFramework\Middleware; use OCP\AppFramework\Middleware;
class FeaturePolicyMiddleware extends Middleware { class FeaturePolicyMiddleware extends Middleware {
/** @var FeaturePolicyManager */ /** @var FeaturePolicyManager */
private $policyManager; private $policyManager;

View File

@ -31,7 +31,6 @@ use OCP\AppFramework\Http\Response;
use OCP\AppFramework\Middleware; use OCP\AppFramework\Middleware;
class SameSiteCookieMiddleware extends Middleware { class SameSiteCookieMiddleware extends Middleware {
/** @var Request */ /** @var Request */
private $request; private $request;

View File

@ -137,7 +137,6 @@ class SecurityMiddleware extends Middleware {
* @suppress PhanUndeclaredClassConstant * @suppress PhanUndeclaredClassConstant
*/ */
public function beforeController($controller, $methodName) { public function beforeController($controller, $methodName) {
// this will set the current navigation entry of the app, use this only // this will set the current navigation entry of the app, use this only
// for normal HTML requests and not for AJAX requests // for normal HTML requests and not for AJAX requests
$this->navigationManager->setActiveEntry($this->appName); $this->navigationManager->setActiveEntry($this->appName);
@ -207,11 +206,11 @@ class SecurityMiddleware extends Middleware {
* This allows oauth apps (e.g. moodle) to use the OCS endpoints * This allows oauth apps (e.g. moodle) to use the OCS endpoints
*/ */
if (!$this->request->passesCSRFCheck() && !( if (!$this->request->passesCSRFCheck() && !(
$controller instanceof OCSController && ( $controller instanceof OCSController && (
$this->request->getHeader('OCS-APIREQUEST') === 'true' || $this->request->getHeader('OCS-APIREQUEST') === 'true' ||
strpos($this->request->getHeader('Authorization'), 'Bearer ') === 0 strpos($this->request->getHeader('Authorization'), 'Bearer ') === 0
) )
)) { )) {
throw new CrossSiteRequestForgeryException(); throw new CrossSiteRequestForgeryException();
} }
} }

View File

@ -32,7 +32,6 @@ use OCP\AppFramework\Middleware;
use OCP\ISession; use OCP\ISession;
class SessionMiddleware extends Middleware { class SessionMiddleware extends Middleware {
/** @var ControllerMethodReflector */ /** @var ControllerMethodReflector */
private $reflector; private $reflector;

View File

@ -79,7 +79,6 @@ class RouteConfig {
* The routes and resource will be registered to the \OCP\Route\IRouter * The routes and resource will be registered to the \OCP\Route\IRouter
*/ */
public function register() { public function register() {
// parse simple // parse simple
$this->processIndexRoutes($this->routes); $this->processIndexRoutes($this->routes);

View File

@ -30,7 +30,6 @@ use Psr\Log\LoggerInterface;
use function array_merge; use function array_merge;
class ScopedPsrLogger implements LoggerInterface { class ScopedPsrLogger implements LoggerInterface {
/** @var LoggerInterface */ /** @var LoggerInterface */
private $inner; private $inner;

View File

@ -30,7 +30,6 @@ use OCP\AppFramework\Services\IAppConfig;
use OCP\IConfig; use OCP\IConfig;
class AppConfig implements IAppConfig { class AppConfig implements IAppConfig {
/** @var IConfig */ /** @var IConfig */
private $config; private $config;

View File

@ -45,7 +45,6 @@ use function class_exists;
* SimpleContainer is a simple implementation of a container on basis of Pimple * SimpleContainer is a simple implementation of a container on basis of Pimple
*/ */
class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer { class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
/** @var Container */ /** @var Container */
private $container; private $container;

View File

@ -33,8 +33,6 @@ use OCP\AppFramework\Utility\ITimeFactory;
* Needed to mock calls to time() * Needed to mock calls to time()
*/ */
class TimeFactory implements ITimeFactory { class TimeFactory implements ITimeFactory {
/** /**
* @return int the result of a call to time() * @return int the result of a call to time()
*/ */

View File

@ -29,7 +29,6 @@ use OC\Authentication\Token\IToken;
use OCP\EventDispatcher\Event; use OCP\EventDispatcher\Event;
abstract class ARemoteWipeEvent extends Event { abstract class ARemoteWipeEvent extends Event {
/** @var IToken */ /** @var IToken */
private $token; private $token;

Some files were not shown because too many files have changed in this diff Show More