@@ -68,7 +68,7 @@ |
||
68 | 68 | |
69 | 69 | protected function buildLogFile(string $logFile = ''):File { |
70 | 70 | $defaultLogFile = $this->systemConfig->getValue('datadirectory', \OC::$SERVERROOT.'/data').'/nextcloud.log'; |
71 | - if($logFile === '') { |
|
71 | + if ($logFile === '') { |
|
72 | 72 | $logFile = $this->systemConfig->getValue('logfile', $defaultLogFile); |
73 | 73 | } |
74 | 74 | $fallback = $defaultLogFile !== $logFile ? $defaultLogFile : ''; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | public function __construct(string $path, string $fallbackPath = '', SystemConfig $config) { |
57 | 57 | $this->logFile = $path; |
58 | 58 | if (!file_exists($this->logFile)) { |
59 | - if( |
|
59 | + if ( |
|
60 | 60 | ( |
61 | 61 | !is_writable(dirname($this->logFile)) |
62 | 62 | || !touch($this->logFile) |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $time = $time->format($format); |
99 | 99 | $url = ($request->getRequestUri() !== '') ? $request->getRequestUri() : '--'; |
100 | 100 | $method = is_string($request->getMethod()) ? $request->getMethod() : '--'; |
101 | - if($this->config->getValue('installed', false)) { |
|
101 | + if ($this->config->getValue('installed', false)) { |
|
102 | 102 | $user = \OC_User::getUser() ? \OC_User::getUser() : '--'; |
103 | 103 | } else { |
104 | 104 | $user = '--'; |
@@ -124,10 +124,10 @@ discard block |
||
124 | 124 | // PHP's json_encode only accept proper UTF-8 strings, loop over all |
125 | 125 | // elements to ensure that they are properly UTF-8 compliant or convert |
126 | 126 | // them manually. |
127 | - foreach($entry as $key => $value) { |
|
128 | - if(is_string($value)) { |
|
127 | + foreach ($entry as $key => $value) { |
|
128 | + if (is_string($value)) { |
|
129 | 129 | $testEncode = json_encode($value); |
130 | - if($testEncode === false) { |
|
130 | + if ($testEncode === false) { |
|
131 | 131 | $entry[$key] = utf8_encode($value); |
132 | 132 | } |
133 | 133 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | * @param int $offset |
156 | 156 | * @return array |
157 | 157 | */ |
158 | - public function getEntries(int $limit=50, int $offset=0):array { |
|
158 | + public function getEntries(int $limit = 50, int $offset = 0):array { |
|
159 | 159 | $minLevel = $this->config->getValue("loglevel", ILogger::WARN); |
160 | 160 | $entries = array(); |
161 | 161 | $handle = @fopen($this->logFile, 'rb'); |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $entriesCount = 0; |
167 | 167 | $lines = 0; |
168 | 168 | // Loop through each character of the file looking for new lines |
169 | - while ($pos >= 0 && ($limit === null ||$entriesCount < $limit)) { |
|
169 | + while ($pos >= 0 && ($limit === null || $entriesCount < $limit)) { |
|
170 | 170 | fseek($handle, $pos); |
171 | 171 | $ch = fgetc($handle); |
172 | 172 | if ($ch == "\n" || $pos == 0) { |