Skip to content

Commit

Permalink
Merge pull request #670 from nextcloud/dependabot/composer/nextcloud/…
Browse files Browse the repository at this point in the history
…coding-standard-1.2.3
  • Loading branch information
dependabot[bot] authored Aug 25, 2024
2 parents f6084ae + 1dad763 commit 394e80f
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 38 deletions.
24 changes: 12 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/DatabaseStatistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ protected function databaseSize(): string {
$result->closeCursor();
break;
}
return ($database_size !== false) ? (string) $database_size : 'N/A';
return ($database_size !== false) ? (string)$database_size : 'N/A';
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/OperatingSystems/FreeBSD.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function getNetworkInfo(): array {
$netstat = $this->executeCommand('netstat -rn');
preg_match_all("/(?<=^default)\s*[0-9a-fA-f\.:]+/m", $netstat, $gw);
if (count($gw[0]) > 0) {
$result['gateway'] = implode(", ", array_map("trim", $gw[0]));
$result['gateway'] = implode(', ', array_map('trim', $gw[0]));
}
} catch (RuntimeException) {
// okay
Expand Down Expand Up @@ -148,7 +148,7 @@ public function getNetworkInterfaces(): array {
continue;
}

preg_match("/(?<=ether ).*/m", $details, $mac);
preg_match('/(?<=ether ).*/m', $details, $mac);
if (isset($mac[0])) {
$netInterface->setMAC($mac[0]);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Settings/AdminSection.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public function getName(): string {

/**
* @return int whether the form should be rather on the top or bottom of
* the settings navigation. The sections are arranged in ascending order of
* the priority values. It is required to return a value between 0 and 99.
* the settings navigation. The sections are arranged in ascending order of
* the priority values. It is required to return a value between 0 and 99.
*
* keep the server setting at the top, right after "overview" and "basic settings"
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/Settings/AdminSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ public function getSection(): string {

/**
* @return int whether the form should be rather on the top or bottom of
* the admin section. The forms are arranged in ascending order of the
* priority values. It is required to return a value between 0 and 100.
* the admin section. The forms are arranged in ascending order of the
* priority values. It is required to return a value between 0 and 100.
*
* keep the server setting at the top, right after "server settings"
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/ShareStatistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected function countEntries(string $tableName): int {
$row = $result->fetch();
$result->closeCursor();

return (int) $row['num_entries'];
return (int)$row['num_entries'];
}

/**
Expand All @@ -84,6 +84,6 @@ protected function countShares(int $type, bool $noPassword = false): int {
$row = $result->fetch();
$result->closeCursor();

return (int) $row['num_entries'];
return (int)$row['num_entries'];
}
}
4 changes: 2 additions & 2 deletions lib/StorageStatistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function countUserEntries(): int {
$result = $query->executeQuery();
$row = $result->fetch();
$result->closeCursor();
return (int) $row['num_entries'];
return (int)$row['num_entries'];
}

protected function getCountOf(string $table): int {
Expand Down Expand Up @@ -92,6 +92,6 @@ protected function countStorages(string $type): int {
$result = $query->executeQuery();
$row = $result->fetch();
$result->closeCursor();
return (int) $row['num_entries'];
return (int)$row['num_entries'];
}
}
2 changes: 1 addition & 1 deletion lib/SystemStatistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function getSystemStatistics(bool $skipApps = false, bool $skipUpdate = t
*/
protected function getServerUpdateInfo(): array {
$updateInfo = [
'lastupdatedat' => (int) $this->config->getAppValue('core', 'lastupdatedat'),
'lastupdatedat' => (int)$this->config->getAppValue('core', 'lastupdatedat'),
'available' => false,
];

Expand Down
22 changes: 11 additions & 11 deletions tests/lib/ApiControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ class ApiControllerTest extends \Test\TestCase {
/** @var Os|\PHPUnit\Framework\MockObject\MockObject */
private $os;

/** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */
/** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */
private $request;

/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
private $config;

/** @var IGroupManager|\PHPUnit\Framework\MockObject\MockObject */
Expand Down Expand Up @@ -142,9 +142,9 @@ public function testAuthFailureWithToken() {
->willReturn('invalidtoken');

$this->config->expects($this->once())
->method('getAppValue')
->with('serverinfo', 'token', null)
->willReturn('megatoken');
->method('getAppValue')
->with('serverinfo', 'token', null)
->willReturn('megatoken');
$response = $this->getController(null)->info();

$this->assertEquals(['message' => 'Unauthorized'], $response->getData());
Expand All @@ -158,9 +158,9 @@ public function testAuthSuccessWithToken() {
->willReturn('megatoken');

$this->config->expects($this->once())
->method('getAppValue')
->with('serverinfo', 'token', null)
->willReturn('megatoken');
->method('getAppValue')
->with('serverinfo', 'token', null)
->willReturn('megatoken');
$response = $this->getController(null)->info();

$this->assertEquals(Http::STATUS_OK, $response->getStatus());
Expand All @@ -173,9 +173,9 @@ public function testIn() {
->willReturn('megatoken');

$this->config->expects($this->once())
->method('getAppValue')
->with('serverinfo', 'token', null)
->willReturn('megatoken');
->method('getAppValue')
->with('serverinfo', 'token', null)
->willReturn('megatoken');
$response = $this->getController(null)->info();

$this->assertEquals(Http::STATUS_OK, $response->getStatus());
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/SessionStatisticsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
* @package OCA\ServerInfo\Tests
*/
class SessionStatisticsTest extends TestCase {
/** @var ITimeFactory | \PHPUnit_Framework_MockObject_MockObject */
/** @var ITimeFactory | \PHPUnit_Framework_MockObject_MockObject */
private $timeFactory;

/** @var IDBConnection */
/** @var IDBConnection */
private $connection;

/** @var SessionStatistics */
/** @var SessionStatistics */
private $instance;

private $table = 'authtoken';
Expand Down

0 comments on commit 394e80f

Please sign in to comment.