@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $time = $time->format($format); |
58 | 58 | $url = ($request->getRequestUri() !== '') ? $request->getRequestUri() : '--'; |
59 | 59 | $method = is_string($request->getMethod()) ? $request->getMethod() : '--'; |
60 | - if($this->config->getValue('installed', false)) { |
|
60 | + if ($this->config->getValue('installed', false)) { |
|
61 | 61 | $user = \OC_User::getUser() ? \OC_User::getUser() : '--'; |
62 | 62 | } else { |
63 | 63 | $user = '--'; |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | // PHP's json_encode only accept proper UTF-8 strings, loop over all |
89 | 89 | // elements to ensure that they are properly UTF-8 compliant or convert |
90 | 90 | // them manually. |
91 | - foreach($entry as $key => $value) { |
|
92 | - if(is_string($value)) { |
|
91 | + foreach ($entry as $key => $value) { |
|
92 | + if (is_string($value)) { |
|
93 | 93 | $testEncode = json_encode($value); |
94 | - if($testEncode === false) { |
|
94 | + if ($testEncode === false) { |
|
95 | 95 | $entry[$key] = utf8_encode($value); |
96 | 96 | } |
97 | 97 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | parent::__construct($config); |
60 | 60 | $this->logFile = $path; |
61 | 61 | if (!file_exists($this->logFile)) { |
62 | - if( |
|
62 | + if ( |
|
63 | 63 | ( |
64 | 64 | !is_writable(dirname($this->logFile)) |
65 | 65 | || !touch($this->logFile) |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | * @param int $offset |
107 | 107 | * @return array |
108 | 108 | */ |
109 | - public function getEntries(int $limit=50, int $offset=0):array { |
|
109 | + public function getEntries(int $limit = 50, int $offset = 0):array { |
|
110 | 110 | $minLevel = $this->config->getValue("loglevel", ILogger::WARN); |
111 | 111 | $entries = array(); |
112 | 112 | $handle = @fopen($this->logFile, 'rb'); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $entriesCount = 0; |
118 | 118 | $lines = 0; |
119 | 119 | // Loop through each character of the file looking for new lines |
120 | - while ($pos >= 0 && ($limit === null ||$entriesCount < $limit)) { |
|
120 | + while ($pos >= 0 && ($limit === null || $entriesCount < $limit)) { |
|
121 | 121 | fseek($handle, $pos); |
122 | 122 | $ch = fgetc($handle); |
123 | 123 | if ($ch == "\n" || $pos == 0) { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | public function __construct(SystemConfig $config) { |
58 | 58 | parent::__construct($config); |
59 | - if(!function_exists('sd_journal_send')) { |
|
59 | + if (!function_exists('sd_journal_send')) { |
|
60 | 60 | throw new HintException( |
61 | 61 | 'PHP extension php-systemd is not available.', |
62 | 62 | 'Please install and enable PHP extension systemd if you wish to log to the Systemd journal.'); |
@@ -75,6 +75,6 @@ discard block |
||
75 | 75 | $journal_level = $this->levels[$level]; |
76 | 76 | sd_journal_send('PRIORITY='.$journal_level, |
77 | 77 | 'SYSLOG_IDENTIFIER='.$this->syslogId, |
78 | - 'MESSAGE=' . $this->logDetailsAsJSON($app, $message, $level)); |
|
78 | + 'MESSAGE='.$this->logDetailsAsJSON($app, $message, $level)); |
|
79 | 79 | } |
80 | 80 | } |