Skip to content

Commit 1575062

Browse files
committed
cs fixed
Signed-off-by: akhil <akhil.potukuchi@gmail.com>
1 parent 72f48a1 commit 1575062

5 files changed

Lines changed: 31 additions & 31 deletions

File tree

lib/Controller/ApiController.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ public function __construct($appName,
7979
SessionStatistics $sessionStatistics) {
8080
parent::__construct($appName, $request);
8181

82-
$this->os = $os;
83-
$this->systemStatistics = $systemStatistics;
84-
$this->storageStatistics = $storageStatistics;
85-
$this->phpStatistics = $phpStatistics;
82+
$this->os = $os;
83+
$this->systemStatistics = $systemStatistics;
84+
$this->storageStatistics = $storageStatistics;
85+
$this->phpStatistics = $phpStatistics;
8686
$this->databaseStatistics = $databaseStatistics;
87-
$this->shareStatistics = $shareStatistics;
88-
$this->sessionStatistics = $sessionStatistics;
87+
$this->shareStatistics = $shareStatistics;
88+
$this->sessionStatistics = $sessionStatistics;
8989
}
9090

9191
/**
@@ -96,14 +96,14 @@ public function __construct($appName,
9696
public function info() {
9797
return new DataResponse([
9898
'nextcloud' => [
99-
'system' => $this->systemStatistics->getSystemStatistics(),
99+
'system' => $this->systemStatistics->getSystemStatistics(),
100100
'storage' => $this->storageStatistics->getStorageStatistics(),
101-
'shares' => $this->shareStatistics->getShareStatistics()
101+
'shares' => $this->shareStatistics->getShareStatistics()
102102
],
103103
'server' => [
104104
'webserver' => $this->getWebserver(),
105-
'php' => $this->phpStatistics->getPhpStatistics(),
106-
'database' => $this->databaseStatistics->getDatabaseStatistics()
105+
'php' => $this->phpStatistics->getPhpStatistics(),
106+
'database' => $this->databaseStatistics->getDatabaseStatistics()
107107
],
108108
'activeUsers' => $this->sessionStatistics->getSessionStatistics()
109109
]);
@@ -113,8 +113,8 @@ public function info() {
113113
* @return DataResponse
114114
*/
115115
public function BasicData(): DataResponse {
116-
$servertime = $this->os->getTime();
117-
$uptime = $this->formatUptime($this->os->getUptime());
116+
$servertime = $this->os->getTime();
117+
$uptime = $this->formatUptime($this->os->getUptime());
118118

119119
return new DataResponse([
120120
'servertime' => $servertime,

lib/OperatingSystems/DefaultOs.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ public function getNetworkInterfaces() {
147147
$result = [];
148148

149149
foreach ($interfaces as $interface) {
150-
$iface = [];
150+
$iface = [];
151151
$iface['interface'] = basename($interface);
152-
$iface['mac'] = shell_exec('ip addr show dev ' . $iface['interface'] . ' | grep "link/ether " | cut -d \' \' -f 6 | cut -f 1 -d \'/\'');
153-
$iface['ipv4'] = shell_exec('ip addr show dev ' . $iface['interface'] . ' | grep "inet " | cut -d \' \' -f 6 | cut -f 1 -d \'/\'');
154-
$iface['ipv6'] = shell_exec('ip -o -6 addr show ' . $iface['interface'] . ' | sed -e \'s/^.*inet6 \([^ ]\+\).*/\1/\'');
152+
$iface['mac'] = shell_exec('ip addr show dev ' . $iface['interface'] . ' | grep "link/ether " | cut -d \' \' -f 6 | cut -f 1 -d \'/\'');
153+
$iface['ipv4'] = shell_exec('ip addr show dev ' . $iface['interface'] . ' | grep "inet " | cut -d \' \' -f 6 | cut -f 1 -d \'/\'');
154+
$iface['ipv6'] = shell_exec('ip -o -6 addr show ' . $iface['interface'] . ' | sed -e \'s/^.*inet6 \([^ ]\+\).*/\1/\'');
155155
if ($iface['interface'] !== 'lo') {
156156
$iface['status'] = shell_exec('cat /sys/class/net/' . $iface['interface'] . '/operstate');
157-
$iface['speed'] = shell_exec('cat /sys/class/net/' . $iface['interface'] . '/speed');
157+
$iface['speed'] = shell_exec('cat /sys/class/net/' . $iface['interface'] . '/speed');
158158
if ($iface['speed'] !== '') {
159159
$iface['speed'] = $iface['speed'] . 'Mbps';
160160
} else {
@@ -169,7 +169,7 @@ public function getNetworkInterfaces() {
169169
}
170170
} else {
171171
$iface['status'] = 'up';
172-
$iface['speed'] = 'unknown';
172+
$iface['speed'] = 'unknown';
173173
$iface['duplex'] = '';
174174
}
175175
$result[] = $iface;

lib/OperatingSystems/FreeBSD.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,13 @@ public function getNetworkInterfaces() {
153153
preg_match_all("/^(?<=(?!\t)).*(?=:)/m", $ifconfig, $interfaces);
154154

155155
foreach ($interfaces[0] as $interface) {
156-
$iface = [];
156+
$iface = [];
157157
$iface['interface'] = $interface;
158-
$intface = $this->executeCommand('/sbin/ifconfig ' . $iface['interface']);
158+
$intface = $this->executeCommand('/sbin/ifconfig ' . $iface['interface']);
159159
preg_match_all("/(?<=inet ).\S*/m", $intface, $ipv4);
160160
preg_match_all("/(?<=inet6 )((.*(?=%))|(.\S*))/m", $intface, $ipv6);
161-
$iface['ipv4'] = implode(' ', $ipv4[0]);
162-
$iface['ipv6'] = implode(' ', $ipv6[0]);
161+
$iface['ipv4'] = implode(' ', $ipv4[0]);
162+
$iface['ipv6'] = implode(' ', $ipv6[0]);
163163

164164
if ($iface['interface'] !== 'lo0') {
165165
preg_match_all("/(?<=ether ).*/m", $intface, $mac);
@@ -168,7 +168,7 @@ public function getNetworkInterfaces() {
168168
preg_match("/(?<=\<).*(?=-)/m", $intface, $duplex);
169169

170170
$iface['mac'] = implode(' ', $mac[0]);
171-
$iface['speed'] = $speed[0];
171+
$iface['speed'] = $speed[0];
172172

173173
if (isset($status[0])) {
174174
$iface['status'] = $status[0];
@@ -194,7 +194,7 @@ public function getNetworkInterfaces() {
194194
}
195195
} else {
196196
$iface['status'] = 'active';
197-
$iface['speed'] = 'unknown';
197+
$iface['speed'] = 'unknown';
198198
$iface['duplex'] = '';
199199
}
200200
$result[] = $iface;

lib/SystemStatistics.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ protected function getMemoryUsage() {
117117
$return = array_map('intval', $return);
118118
if ($return === array_filter($return, 'is_int')) {
119119
return [
120-
'mem_total' => (int)$return[0]/1024,
120+
'mem_total' => (int)$return[0] / 1024,
121121
'mem_free' => (int)$return[1] * ($return[2] + $return[3] + $return[4]) / 1024,
122122
'swap_free' => (isset($swapFree)) ? $swapFree : 'N/A',
123123
'swap_total' => (isset($swapTotal)) ? $swapTotal : 'N/A'

tests/lib/SessionStatisticsTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ protected function setUp(): void {
7070
}
7171

7272
private function addDummyValues() {
73-
$this->addDummyValuesWithLastLogin($this->currentTime - $this->offset5Minutes +1, 10);
74-
$this->addDummyValuesWithLastLogin($this->currentTime - $this->offset1Hour +1, 20);
75-
$this->addDummyValuesWithLastLogin($this->currentTime - $this->offset1Day +1, 30);
76-
$this->addDummyValuesWithLastLogin($this->currentTime - $this->offset7Days +1, 40);
77-
$this->addDummyValuesWithLastLogin($this->currentTime - $this->offset30Days +1, 50);
73+
$this->addDummyValuesWithLastLogin($this->currentTime - $this->offset5Minutes + 1, 10);
74+
$this->addDummyValuesWithLastLogin($this->currentTime - $this->offset1Hour + 1, 20);
75+
$this->addDummyValuesWithLastLogin($this->currentTime - $this->offset1Day + 1, 30);
76+
$this->addDummyValuesWithLastLogin($this->currentTime - $this->offset7Days + 1, 40);
77+
$this->addDummyValuesWithLastLogin($this->currentTime - $this->offset30Days + 1, 50);
7878
}
7979

8080
private function addDummyValuesWithLastLogin($lastActivity, $numOfEntries) {
@@ -87,7 +87,7 @@ private function addDummyValuesWithLastLogin($lastActivity, $numOfEntries) {
8787
'login_name' => $query->createNamedParameter('user-' . ($numOfEntries + $i % 2)),
8888
'password' => $query->createNamedParameter('password'),
8989
'name' => $query->createNamedParameter('user agent'),
90-
'token' => $query->createNamedParameter('token-' . ($i + $numOfEntries*10)),
90+
'token' => $query->createNamedParameter('token-' . ($i + $numOfEntries * 10)),
9191
'type' => $query->createNamedParameter(0),
9292
'last_activity' => $query->createNamedParameter($lastActivity),
9393
'last_check' => $query->createNamedParameter($lastActivity),

0 commit comments

Comments
 (0)