@@ -137,8 +137,9 @@ discard block |
||
137 | 137 | ); |
138 | 138 | $arrAbsolutes = array(); |
139 | 139 | foreach ($parts as $datParts) { |
140 | - if ('.' == $datParts) |
|
141 | - continue; |
|
140 | + if ('.' == $datParts) { |
|
141 | + continue; |
|
142 | + } |
|
142 | 143 | if ('..' == $datParts) { |
143 | 144 | array_pop($arrAbsolutes); |
144 | 145 | } else { |
@@ -179,8 +180,7 @@ discard block |
||
179 | 180 | $partsFile = explode('/', $this->strFile); |
180 | 181 | $divideFile = explode('.', array_pop($partsFile)); |
181 | 182 | $fileName = array_shift($divideFile); |
182 | - } |
|
183 | - catch (Exception $e) { |
|
183 | + } catch (Exception $e) { |
|
184 | 184 | $fileName = 'file'; |
185 | 185 | } |
186 | 186 | return $fileName; |
@@ -282,8 +282,7 @@ discard block |
||
282 | 282 | $domPDF->render(); |
283 | 283 | $fileName = $this->getFileName() . '.pdf'; |
284 | 284 | $domPDF->stream($fileName); |
285 | - } |
|
286 | - catch (Exception $err) { |
|
285 | + } catch (Exception $err) { |
|
287 | 286 | echo 'Unable to generate PDF file. '; |
288 | 287 | echo $err; |
289 | 288 | } |
@@ -26,7 +26,9 @@ |
||
26 | 26 | * |
27 | 27 | * @var string |
28 | 28 | */ |
29 | -if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__)); |
|
29 | +if (!defined('LOG4PHP_DIR')) { |
|
30 | + define('LOG4PHP_DIR', dirname(__FILE__)); |
|
31 | +} |
|
30 | 32 | |
31 | 33 | spl_autoload_register(array('Logger', 'autoload')); |
32 | 34 |
@@ -252,8 +252,9 @@ |
||
252 | 252 | $dateFormatStr = self::DATE_FORMAT_ISO8601; // ISO8601_DATE_FORMAT; |
253 | 253 | $dOpt = $this->extractOption(); |
254 | 254 | |
255 | - if($dOpt !== null) |
|
256 | - $dateFormatStr = $dOpt; |
|
255 | + if($dOpt !== null) { |
|
256 | + $dateFormatStr = $dOpt; |
|
257 | + } |
|
257 | 258 | |
258 | 259 | if($dateFormatStr == 'ISO8601') { |
259 | 260 | $df = self::DATE_FORMAT_ISO8601; |
@@ -138,8 +138,9 @@ |
||
138 | 138 | private function doConfigure($url = '', LoggerHierarchy $repository) |
139 | 139 | { |
140 | 140 | $xmlData = ''; |
141 | - if (!empty($url)) |
|
142 | - $xmlData = implode('', file($url, 1)); |
|
141 | + if (!empty($url)) { |
|
142 | + $xmlData = implode('', file($url, 1)); |
|
143 | + } |
|
143 | 144 | return $this->doConfigureByString($xmlData, $repository); |
144 | 145 | } |
145 | 146 |
@@ -121,8 +121,9 @@ discard block |
||
121 | 121 | $fileName = $this->getExpandedFileName(); |
122 | 122 | // Delete the oldest file, to keep Windows happy. |
123 | 123 | $file = $fileName . '.' . $this->maxBackupIndex; |
124 | - if(is_writable($file)) |
|
125 | - unlink($file); |
|
124 | + if(is_writable($file)) { |
|
125 | + unlink($file); |
|
126 | + } |
|
126 | 127 | // Map {(maxBackupIndex - 1), ..., 2, 1} to {maxBackupIndex, ..., 3, 2} |
127 | 128 | for($i = $this->maxBackupIndex - 1; $i >= 1; $i--) { |
128 | 129 | $file = $fileName . "." . $i; |
@@ -150,7 +151,9 @@ discard block |
||
150 | 151 | // As LoggerAppenderFile does not create the directory, it has to exist. |
151 | 152 | // realpath() fails if the argument does not exist so the filename is separated. |
152 | 153 | $this->expandedFileName = realpath(dirname($fileName)); |
153 | - if ($this->expandedFileName === false) throw new Exception("Directory of $fileName does not exist!"); |
|
154 | + if ($this->expandedFileName === false) { |
|
155 | + throw new Exception("Directory of $fileName does not exist!"); |
|
156 | + } |
|
154 | 157 | $this->expandedFileName .= '/'.basename($fileName); |
155 | 158 | } |
156 | 159 |
@@ -155,8 +155,9 @@ |
||
155 | 155 | |
156 | 156 | function close() |
157 | 157 | { |
158 | - if ($this->db !== null) |
|
159 | - $this->db->Close(); |
|
158 | + if ($this->db !== null) { |
|
159 | + $this->db->Close(); |
|
160 | + } |
|
160 | 161 | $this->closed = true; |
161 | 162 | } |
162 | 163 |
@@ -176,7 +176,9 @@ |
||
176 | 176 | */ |
177 | 177 | public function append(LoggerLoggingEvent $event) { |
178 | 178 | // TODO: Can't activateOptions() simply throw an Exception if it encounters problems? |
179 | - if ( ! $this->canAppend) return; |
|
179 | + if ( ! $this->canAppend) { |
|
180 | + return; |
|
181 | + } |
|
180 | 182 | |
181 | 183 | try { |
182 | 184 | if (empty($this->sql)) { |
@@ -207,8 +207,9 @@ |
||
207 | 207 | $sbuf .= "<th>Thread</th>" . PHP_EOL; |
208 | 208 | $sbuf .= "<th>Level</th>" . PHP_EOL; |
209 | 209 | $sbuf .= "<th>Category</th>" . PHP_EOL; |
210 | - if ($this->locationInfo) |
|
211 | - $sbuf .= "<th>File:Line</th>" . PHP_EOL; |
|
210 | + if ($this->locationInfo) { |
|
211 | + $sbuf .= "<th>File:Line</th>" . PHP_EOL; |
|
212 | + } |
|
212 | 213 | $sbuf .= "<th>Message</th>" . PHP_EOL; |
213 | 214 | $sbuf .= "</tr>" . PHP_EOL; |
214 | 215 |
@@ -1200,9 +1200,9 @@ |
||
1200 | 1200 | $navigation_items = self::get_navigation_items(false); |
1201 | 1201 | $html = ''; |
1202 | 1202 | if (!empty($navigation_items)) { |
1203 | - if ($orientation == SHORTCUTS_HORIZONTAL) |
|
1204 | - $style_id = "toolshortcuts_horizontal"; |
|
1205 | - else { |
|
1203 | + if ($orientation == SHORTCUTS_HORIZONTAL) { |
|
1204 | + $style_id = "toolshortcuts_horizontal"; |
|
1205 | + } else { |
|
1206 | 1206 | $style_id = "toolshortcuts_vertical"; |
1207 | 1207 | } |
1208 | 1208 | $html .= '<div id="'.$style_id.'">'; |