Skip to content

Commit

Permalink
chore: apply php-cs-fixer 3.62 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis committed Aug 19, 2024
1 parent 9c06046 commit c49ba6e
Show file tree
Hide file tree
Showing 14 changed files with 107 additions and 107 deletions.
2 changes: 1 addition & 1 deletion apps/dav/lib/Command/CleanupChunks.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return;
}

$output->writeln(sprintf("Cleaning %d chunks for %s", \count($filteredUploads), $user->getUID()));
$output->writeln(\sprintf("Cleaning %d chunks for %s", \count($filteredUploads), $user->getUID()));

$p = new ProgressBar($output);
$p->start(\count($filteredUploads));
Expand Down
8 changes: 4 additions & 4 deletions apps/dav/templates/exception.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
/** @var array $_ */
/** @var \OCP\IL10N $l */
/** @var array $_ */
/** @var \OCP\IL10N $l */

style('core', ['styles', 'header']);
?>
style('core', ['styles', 'header']);
?>
<span class="error error-wide">
<h2><strong><?php p($_['title']) ?></strong></h2>
<?php if (isset($_['hint']) && $_['hint']): ?>
Expand Down
32 changes: 16 additions & 16 deletions apps/updatenotification/templates/admin.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?php
script('updatenotification', 'admin');
script('updatenotification', 'admin');

/** @var array $_ */
/** @var bool $isNewVersionAvailable */
$isNewVersionAvailable = $_['isNewVersionAvailable'];
/** @var string $newVersionString */
$newVersionString = $_['newVersionString'];
/** @var string $lastCheckedDate */
$lastCheckedDate = $_['lastChecked'];
/** @var array $channels */
$channels = $_['channels'];
/** @var string $currentChannel */
$currentChannel = $_['currentChannel'];
/** @var string $changeLogUrl */
$changeLogUrl = $_['changeLogUrl'];
?>
/** @var array $_ */
/** @var bool $isNewVersionAvailable */
$isNewVersionAvailable = $_['isNewVersionAvailable'];
/** @var string $newVersionString */
$newVersionString = $_['newVersionString'];
/** @var string $lastCheckedDate */
$lastCheckedDate = $_['lastChecked'];
/** @var array $channels */
$channels = $_['channels'];
/** @var string $currentChannel */
$currentChannel = $_['currentChannel'];
/** @var string $changeLogUrl */
$changeLogUrl = $_['changeLogUrl'];

?>
<form id="oca_updatenotification_section" class="section">
<h2 id="updater" class="app-name"><?php p($l->t('Updater')); ?></h2>

Expand Down
4 changes: 2 additions & 2 deletions core/Command/App/ListApps.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$appDetailRecord = [];

if ($minimalView) {
$apps['enabled'][$app] = sprintf('%s%s', $app, isset($versions[$app]) ? ' '.$versions[$app] : '');
$apps['enabled'][$app] = \sprintf('%s%s', $app, isset($versions[$app]) ? ' '.$versions[$app] : '');
continue;
}

Expand All @@ -140,7 +140,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$appDetailRecord = [];

if ($minimalView) {
$apps['disabled'][$app] = sprintf('%s%s', $app, isset($versions[$app]) ? ' '.$versions[$app] : '');
$apps['disabled'][$app] = \sprintf('%s%s', $app, isset($versions[$app]) ? ' '.$versions[$app] : '');
continue;
}

Expand Down
8 changes: 4 additions & 4 deletions core/templates/exception.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
/** @var array $_ */
/** @var \OCP\IL10N $l */
/** @var array $_ */
/** @var \OCP\IL10N $l */

style('core', ['styles', 'header']);
?>
style('core', ['styles', 'header']);
?>
<span class="error error-wide">
<h2><strong><?php p($l->t('Internal Server Error')) ?></strong></h2>
<p><?php p($l->t('The server encountered an internal error and was unable to complete your request.')) ?></p>
Expand Down
8 changes: 4 additions & 4 deletions core/templates/layout.noscript.warning.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<div id="nojavascript">
<div>
<?php print_unescaped(\str_replace(
['{linkstart}', '{linkend}'],
['<a href="http://enable-javascript.com/" target="_blank" rel="noreferrer">', '</a>'],
$l->t('This application requires JavaScript for correct operation. Please {linkstart}enable JavaScript{linkend} and reload the page.')
)); ?>
['{linkstart}', '{linkend}'],
['<a href="http://enable-javascript.com/" target="_blank" rel="noreferrer">', '</a>'],
$l->t('This application requires JavaScript for correct operation. Please {linkstart}enable JavaScript{linkend} and reload the page.')
)); ?>
</div>
</div>
</noscript>
6 changes: 3 additions & 3 deletions core/templates/update.admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
} else {
?>
<h2 class="title"><?php p($l->t(
'%s will be updated to version %s',
[$_['productName'], $_['version']]
)); ?></h2>
'%s will be updated to version %s',
[$_['productName'], $_['version']]
)); ?></h2>
<?php
} ?>
<?php if (!empty($_['appsToUpgrade'])) {
Expand Down
6 changes: 3 additions & 3 deletions settings/templates/panels/personal/quota.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<p id="quotatext">
<?php if ($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?>
<?php p($l->t(
'You are using %s',
[$_['usage']]
));?>
'You are using %s',
[$_['usage']]
));?>
<?php else: ?>
<?php p($l->t(
'You are using %s of %s (%s %%)',
Expand Down
114 changes: 57 additions & 57 deletions tests/lib/Encryption/ManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,63 +187,63 @@ public function testSetDefaultEncryptionModule() {
$this->assertEquals('ID1', $this->manager->getDefaultEncryptionModuleId());
}

// /**
// * @expectedException \OC\Encryption\Exceptions\ModuleAlreadyExistsException
// * @expectedExceptionMessage Id "0" already used by encryption module "TestDummyModule0"
// */
// public function testModuleRegistration() {
// $config = $this->createMock('\OCP\IConfig');
// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
// $em = $this->createMock('\OCP\Encryption\IEncryptionModule');
// $em->expects($this->any())->method('getId')->willReturn(0);
// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
// $m = new Manager($config);
// $m->registerEncryptionModule($em);
// $this->assertTrue($m->isEnabled());
// $m->registerEncryptionModule($em);
// }
//
// public function testModuleUnRegistration() {
// $config = $this->createMock('\OCP\IConfig');
// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
// $em = $this->createMock('\OCP\Encryption\IEncryptionModule');
// $em->expects($this->any())->method('getId')->willReturn(0);
// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
// $m = new Manager($config);
// $m->registerEncryptionModule($em);
// $this->assertTrue($m->isEnabled());
// $m->unregisterEncryptionModule($em);
// $this->assertFalse($m->isEnabled());
// }
//
// /**
// * @expectedException \OC\Encryption\Exceptions\ModuleDoesNotExistsException
// * @expectedExceptionMessage Module with id: unknown does not exist.
// */
// public function testGetEncryptionModuleUnknown() {
// $config = $this->createMock('\OCP\IConfig');
// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
// $em = $this->createMock('\OCP\Encryption\IEncryptionModule');
// $em->expects($this->any())->method('getId')->willReturn(0);
// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
// $m = new Manager($config);
// $m->registerEncryptionModule($em);
// $this->assertTrue($m->isEnabled());
// $m->getEncryptionModule('unknown');
// }
//
// public function testGetEncryptionModule() {
// $config = $this->createMock('\OCP\IConfig');
// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
// $em = $this->createMock('\OCP\Encryption\IEncryptionModule');
// $em->expects($this->any())->method('getId')->willReturn(0);
// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
// $m = new Manager($config);
// $m->registerEncryptionModule($em);
// $this->assertTrue($m->isEnabled());
// $en0 = $m->getEncryptionModule(0);
// $this->assertEquals(0, $en0->getId());
// }
// /**
// * @expectedException \OC\Encryption\Exceptions\ModuleAlreadyExistsException
// * @expectedExceptionMessage Id "0" already used by encryption module "TestDummyModule0"
// */
// public function testModuleRegistration() {
// $config = $this->createMock('\OCP\IConfig');
// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
// $em = $this->createMock('\OCP\Encryption\IEncryptionModule');
// $em->expects($this->any())->method('getId')->willReturn(0);
// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
// $m = new Manager($config);
// $m->registerEncryptionModule($em);
// $this->assertTrue($m->isEnabled());
// $m->registerEncryptionModule($em);
// }
//
// public function testModuleUnRegistration() {
// $config = $this->createMock('\OCP\IConfig');
// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
// $em = $this->createMock('\OCP\Encryption\IEncryptionModule');
// $em->expects($this->any())->method('getId')->willReturn(0);
// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
// $m = new Manager($config);
// $m->registerEncryptionModule($em);
// $this->assertTrue($m->isEnabled());
// $m->unregisterEncryptionModule($em);
// $this->assertFalse($m->isEnabled());
// }
//
// /**
// * @expectedException \OC\Encryption\Exceptions\ModuleDoesNotExistsException
// * @expectedExceptionMessage Module with id: unknown does not exist.
// */
// public function testGetEncryptionModuleUnknown() {
// $config = $this->createMock('\OCP\IConfig');
// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
// $em = $this->createMock('\OCP\Encryption\IEncryptionModule');
// $em->expects($this->any())->method('getId')->willReturn(0);
// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
// $m = new Manager($config);
// $m->registerEncryptionModule($em);
// $this->assertTrue($m->isEnabled());
// $m->getEncryptionModule('unknown');
// }
//
// public function testGetEncryptionModule() {
// $config = $this->createMock('\OCP\IConfig');
// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
// $em = $this->createMock('\OCP\Encryption\IEncryptionModule');
// $em->expects($this->any())->method('getId')->willReturn(0);
// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
// $m = new Manager($config);
// $m->registerEncryptionModule($em);
// $this->assertTrue($m->isEnabled());
// $en0 = $m->getEncryptionModule(0);
// $this->assertEquals(0, $en0->getId());
// }

protected function addNewEncryptionModule(Manager $manager, $id) {
$encryptionModule = $this->createMock('\OCP\Encryption\IEncryptionModule');
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Files/Cache/UpdaterLegacyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,14 @@ public function testRenameWithMountPoints() {
$this->assertIsString($cachedData['etag']);
$this->assertNotSame($substorageCachedData['etag'], $cachedData['etag']);
// rename can cause mtime change - invalid assert
// $this->assertEquals($mtime, $cachedData['mtime']);
// $this->assertEquals($mtime, $cachedData['mtime']);

$cachedData = $view->getFileInfo('folder');
$this->assertIsString($folderCachedData['etag']);
$this->assertIsString($cachedData['etag']);
$this->assertNotSame($folderCachedData['etag'], $cachedData['etag']);
// rename can cause mtime change - invalid assert
// $this->assertEquals($mtime, $cachedData['mtime']);
// $this->assertEquals($mtime, $cachedData['mtime']);
}

public function testTouch() {
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/Files/FilesystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,14 +371,14 @@ public function testHooks() {
$rootView->mkdir('/' . $user);
$rootView->mkdir('/' . $user . '/files');

// \OC\Files\Filesystem::file_put_contents('/foo', 'foo');
// \OC\Files\Filesystem::file_put_contents('/foo', 'foo');
Filesystem::mkdir('/bar');
// \OC\Files\Filesystem::file_put_contents('/bar//foo', 'foo');
// \OC\Files\Filesystem::file_put_contents('/bar//foo', 'foo');

$tmpFile = \OC::$server->getTempManager()->getTemporaryFile();
\file_put_contents($tmpFile, 'foo');
$fh = \fopen($tmpFile, 'r');
// \OC\Files\Filesystem::file_put_contents('/bar//foo', $fh);
// \OC\Files\Filesystem::file_put_contents('/bar//foo', $fh);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions tests/lib/Files/Storage/Wrapper/EncryptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -920,10 +920,10 @@ public function testCopyBetweenStorage($encryptionEnabled, $mountPointEncryption
->method('isEnabled')
->willReturn($encryptionEnabled);
// FIXME can not overwrite the return after definition
// $this->mount
// ->method('getOption')
// ->withConsecutive('encrypt', true)
// ->willReturn($mountPointEncryptionEnabled);
// $this->mount
// ->method('getOption')
// ->withConsecutive('encrypt', true)
// ->willReturn($mountPointEncryptionEnabled);
global $mockedMountPointEncryptionEnabled;
$mockedMountPointEncryptionEnabled = $mountPointEncryptionEnabled;

Expand Down
6 changes: 3 additions & 3 deletions tests/lib/User/SessionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ public function testLoginValidPasswordEnabled() {
unset($managerMethods[$i]);
}
}
// $manager = $this->getMockBuilder(Manager::class)
// ->setMethods($managerMethods)
// ->getMock();
// $manager = $this->getMockBuilder(Manager::class)
// ->setMethods($managerMethods)
// ->getMock();

$manager = $this->createMock(Manager::class);
$user = $this->createMock(IUser::class);
Expand Down
2 changes: 1 addition & 1 deletion vendor-bin/owncloud-codestyle/composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"require": {
"owncloud/coding-standard": "^5.1"
"owncloud/coding-standard": "^5.3"
}
}

0 comments on commit c49ba6e

Please sign in to comment.