Passed
Push — 1.10.x ( 51b3f0...0b3bd8 )
by Yannick
116:33 queued 61:35
created
main/inc/lib/phpdocx/classes/CreateText.inc 1 patch
Braces   +26 added lines, -18 removed lines patch added patch discarded remove patch
@@ -109,14 +109,18 @@  discard block
 block discarded – undo
109 109
                 !empty($args[1]['wordWrap'])
110 110
             ) {
111 111
                 $this->generatePPR();
112
-                if (!empty($args[1]['jc']))
113
-                    $this->generateJC($args[1]['jc']);
114
-                if (!empty($args[1]['pageBreakBefore']))
115
-                    $this->generatePAGEBREAKBEFORE($args[1]['pageBreakBefore']);
116
-                if (!empty($args[1]['widowControl']))
117
-                    $this->generateWIDOWCONTROL($args[1]['widowControl']);
118
-                if (!empty($args[1]['wordWrap']))
119
-                    $this->generateWORDWRAP($args[1]['wordWrap']);
112
+                if (!empty($args[1]['jc'])) {
113
+                                    $this->generateJC($args[1]['jc']);
114
+                }
115
+                if (!empty($args[1]['pageBreakBefore'])) {
116
+                                    $this->generatePAGEBREAKBEFORE($args[1]['pageBreakBefore']);
117
+                }
118
+                if (!empty($args[1]['widowControl'])) {
119
+                                    $this->generateWIDOWCONTROL($args[1]['widowControl']);
120
+                }
121
+                if (!empty($args[1]['wordWrap'])) {
122
+                                    $this->generateWORDWRAP($args[1]['wordWrap']);
123
+                }
120 124
             }
121 125
             $this->generateR();
122 126
             if (
@@ -166,16 +170,20 @@  discard block
 block discarded – undo
166 170
         if (!empty($args[1]['val']) && !empty($args[0])) {
167 171
             $this->generateP();
168 172
             $this->generatePPR();
169
-            if ($args[1]['type'] == 'subtitle')
170
-                $this->generatePSTYLE('Subttulo' . $args[1]['val']);
171
-            else
172
-                $this->generatePSTYLE('Ttulo' . $args[1]['val']);
173
-            if (!empty($args[1]['pageBreakBefore']))
174
-                $this->generatePAGEBREAKBEFORE($args[1]['pageBreakBefore']);
175
-            if (!empty($args[1]['widowControl']))
176
-                $this->generateWIDOWCONTROL($args[1]['widowControl']);
177
-            if (!empty($args[1]['wordWrap']))
178
-                $this->generateWORDWRAP($args[1]['wordWrap']);
173
+            if ($args[1]['type'] == 'subtitle') {
174
+                            $this->generatePSTYLE('Subttulo' . $args[1]['val']);
175
+            } else {
176
+                            $this->generatePSTYLE('Ttulo' . $args[1]['val']);
177
+            }
178
+            if (!empty($args[1]['pageBreakBefore'])) {
179
+                            $this->generatePAGEBREAKBEFORE($args[1]['pageBreakBefore']);
180
+            }
181
+            if (!empty($args[1]['widowControl'])) {
182
+                            $this->generateWIDOWCONTROL($args[1]['widowControl']);
183
+            }
184
+            if (!empty($args[1]['wordWrap'])) {
185
+                            $this->generateWORDWRAP($args[1]['wordWrap']);
186
+            }
179 187
             self::$_idTitle++;
180 188
             $this->generateBOOKMARKSTART(
181 189
                 self::$_idTitle, '_Toc' . (self::$_idTitle + self::IDTITLE)
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/classes/CreateExcelSheet.inc 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -132,8 +132,9 @@  discard block
 block discarded – undo
132 132
             break;
133 133
         }
134 134
         foreach ($dats as $ind => $val) {
135
-            if ($ind == '0')
136
-                continue;
135
+            if ($ind == '0') {
136
+                            continue;
137
+            }
137 138
             $this->generateROW($row, $sizeCols);
138 139
             $col = 1;
139 140
             $letra = 'A';
@@ -142,8 +143,9 @@  discard block
 block discarded – undo
142 143
             $letra++;
143 144
             foreach ($val as $valores) {
144 145
                 $s = '';
145
-                if ($col != $sizeCols)
146
-                    $s = 1;
146
+                if ($col != $sizeCols) {
147
+                                    $s = 1;
148
+                }
147 149
                 $this->generateC($letra . $row, $s);
148 150
                 $this->generateV($valores);
149 151
                 $col++;
@@ -187,8 +189,9 @@  discard block
 block discarded – undo
187 189
     protected function generateDIMENSION($sizeX, $sizeY)
188 190
     {
189 191
         $char = 'A';
190
-        for ($i = 0; $i < $sizeY; $i++)
191
-            $char++;
192
+        for ($i = 0; $i < $sizeY; $i++) {
193
+                    $char++;
194
+        }
192 195
         $sizeX += $sizeY;
193 196
         $xml = '<dimension ref="A1:' . $char . $sizeX .
194 197
                 '"></dimension>__GENERATEWORKSHEET__';
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/classes/CreateDocx.inc 1 patch
Braces   +17 added lines, -20 removed lines patch added patch discarded remove patch
@@ -838,8 +838,7 @@  discard block
 block discarded – undo
838 838
                     'Images must have "data" and "type" values.'
839 839
                 );
840 840
             }
841
-        }
842
-        catch (Exception $e) {
841
+        } catch (Exception $e) {
843 842
             self::$log->fatal($e->getMessage());
844 843
             exit();
845 844
         }
@@ -902,26 +901,25 @@  discard block
 block discarded – undo
902 901
                         $this->generateDEFAULT(
903 902
                             $dir['extension'], $attrImage['mime']
904 903
                         );
905
-                        if ((string) $image != '')
906
-                            $this->_wordRelsDocumentRelsC .=
904
+                        if ((string) $image != '') {
905
+                                                    $this->_wordRelsDocumentRelsC .=
907 906
                                 $this->generateRELATIONSHIP(
908 907
                                     'rId' . self::$intIdWord, 'image',
909 908
                                     'media/image' . self::$intIdWord . '.'
910 909
                                     . $dir['extension']
911 910
                                 );
911
+                        }
912 912
                     } else {
913 913
                         throw new Exception('Image format is not supported.');
914 914
                     }
915
-                }
916
-                catch (Exception $e) {
915
+                } catch (Exception $e) {
917 916
                     self::$log->fatal($e->getMessage());
918 917
                     exit();
919 918
                 }
920 919
             } else {
921 920
                 throw new Exception('Image does not exist.');
922 921
             }
923
-        }
924
-        catch (Exception $e) {
922
+        } catch (Exception $e) {
925 923
             self::$log->fatal($e->getMessage());
926 924
             exit();
927 925
         }
@@ -1363,8 +1361,7 @@  discard block
 block discarded – undo
1363 1361
                     'Images must have "data" and "type" values.'
1364 1362
                 );
1365 1363
             }
1366
-        }
1367
-        catch (Exception $e) {
1364
+        } catch (Exception $e) {
1368 1365
             self::$log->fatal($e->getMessage());
1369 1366
             exit();
1370 1367
         }
@@ -1422,26 +1419,25 @@  discard block
 block discarded – undo
1422 1419
                         $this->generateDEFAULT(
1423 1420
                             $dir['extension'], $attrImage['mime']
1424 1421
                         );
1425
-                        if ((string) $image != '')
1426
-                            $this->_wordRelsDocumentRelsC .=
1422
+                        if ((string) $image != '') {
1423
+                                                    $this->_wordRelsDocumentRelsC .=
1427 1424
                                 $this->generateRELATIONSHIP(
1428 1425
                                     'rId' . self::$intIdWord, 'image',
1429 1426
                                     'media/image' . self::$intIdWord . '.'
1430 1427
                                     . $dir['extension']
1431 1428
                                 );
1429
+                        }
1432 1430
                     } else {
1433 1431
                         throw new Exception('Image format is not supported.');
1434 1432
                     }
1435
-                }
1436
-                catch (Exception $e) {
1433
+                } catch (Exception $e) {
1437 1434
                     self::$log->fatal($e->getMessage());
1438 1435
                     exit();
1439 1436
                 }
1440 1437
             } else {
1441 1438
                 throw new Exception('Image does not exist.');
1442 1439
             }
1443
-        }
1444
-        catch (Exception $e) {
1440
+        } catch (Exception $e) {
1445 1441
             self::$log->fatal($e->getMessage());
1446 1442
             exit();
1447 1443
         }
@@ -2429,13 +2425,14 @@  discard block
 block discarded – undo
2429 2425
     private function generateRELATIONSHIP()
2430 2426
     {
2431 2427
         $arrArgs = func_get_args();
2432
-        if ($arrArgs[1] == 'vbaProject')
2433
-            $strType =
2428
+        if ($arrArgs[1] == 'vbaProject') {
2429
+                    $strType =
2434 2430
             'http://schemas.microsoft.com/office/2006/relationships/vbaProject';
2435
-        else
2436
-            $strType = 
2431
+        } else {
2432
+                    $strType = 
2437 2433
             'http://schemas.openxmlformats.org/officeDocument/2006/' .
2438 2434
             'relationships/' . $arrArgs[1];
2435
+        }
2439 2436
 
2440 2437
         return '<Relationship Id="' . $arrArgs[0] . '" Type="' . $strType .
2441 2438
                '" Target="' . $arrArgs[2] . '"></Relationship>';
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/classes/CreateStyle.inc 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -143,8 +143,9 @@  discard block
 block discarded – undo
143 143
             isset($args[0][0]['ilvl']) ||
144 144
             isset($args[0][0]['ind_left'])) {
145 145
             $this->generatePPR();
146
-            if ($args[0][0]['keepNext'] == 1)
147
-                $this->generateKEEPNEXT();
146
+            if ($args[0][0]['keepNext'] == 1) {
147
+                            $this->generateKEEPNEXT();
148
+            }
148 149
 
149 150
             if (!empty($args[0][0]['keepLines'])) {
150 151
                 $this->generateKEEPLINES($args[0][0]['keepLines']);
@@ -220,13 +221,14 @@  discard block
 block discarded – undo
220 221
             if (!empty($args[0][0]['rFonts_asciiTheme']) &&
221 222
                 !empty($args[0][0]['rFonts_eastAsiaTheme']) &&
222 223
                 !empty($args[0][0]['rFonts_hAnsiTheme']) &&
223
-                !empty($args[0][0]['rFonts_cstheme']))
224
-                $this->generateRFONTS(
224
+                !empty($args[0][0]['rFonts_cstheme'])) {
225
+                            $this->generateRFONTS(
225 226
                     $args[0][0]['rFonts_asciiTheme'],
226 227
                     $args[0][0]['rFonts_eastAsiaTheme'],
227 228
                     $args[0][0]['rFonts_hAnsiTheme'],
228 229
                     $args[0][0]['rFonts_cstheme']
229 230
                 );
231
+            }
230 232
 
231 233
             if (!empty($args[0][0]['rFonts_ascii']) &&
232 234
                 !empty($args[0][0]['rFonts_hAnsi']) &&
@@ -1547,14 +1549,16 @@  discard block
 block discarded – undo
1547 1549
         $this->_xml .= '<' . CreateElement::NAMESPACEWORD .
1548 1550
             ':style ' . CreateElement::NAMESPACEWORD .
1549 1551
             ':type="' . $type . '"';
1550
-        if ($default != '')
1551
-            $this->_xml .= ' ' . CreateElement::NAMESPACEWORD .
1552
+        if ($default != '') {
1553
+                    $this->_xml .= ' ' . CreateElement::NAMESPACEWORD .
1552 1554
                 ':default="' . $default . '"';
1555
+        }
1553 1556
         $this->_xml .= ' ' . CreateElement::NAMESPACEWORD .
1554 1557
             ':styleId="' . $styleId . '"';
1555
-        if ($customStyle != '')
1556
-            $this->_xml .= ' ' . CreateElement::NAMESPACEWORD .
1558
+        if ($customStyle != '') {
1559
+                    $this->_xml .= ' ' . CreateElement::NAMESPACEWORD .
1557 1560
                 ':customStyle="' . $customStyle . '"';
1561
+        }
1558 1562
         $this->_xml .= '>__GENERATESTYLE__</' .
1559 1563
             CreateElement::NAMESPACEWORD . ':style>';
1560 1564
     }
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/classes/TransformDoc.inc 1 patch
Braces   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -137,8 +137,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/lib/log4php/Logger.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,9 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/lib/log4php/helpers/LoggerPatternParser.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -252,8 +252,9 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/lib/log4php/configurators/LoggerConfiguratorXml.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -138,8 +138,9 @@
 block discarded – undo
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
     
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderRollingFile.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -121,8 +121,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.