Completed
Push — develop ( 539a89...685e29 )
by Adrien
11:28
created
src/PhpSpreadsheet/Writer/Excel2007/StringTable.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             // Create string lookup table
41 41
             $aStringTable = array();
42 42
             $cellCollection = null;
43
-            $aFlippedStringTable = null;    // For faster lookup
43
+            $aFlippedStringTable = null; // For faster lookup
44 44
 
45 45
             // Is an existing table given?
46 46
             if (($pExistingTable !== null) && is_array($pExistingTable)) {
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
             foreach ($pStringTable as $textElement) {
106 106
                 $objWriter->startElement('si');
107 107
 
108
-                if (! $textElement instanceof \PhpSpreadsheet\RichText) {
108
+                if (!$textElement instanceof \PhpSpreadsheet\RichText) {
109 109
                     $textToWrite = \PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($textElement);
110 110
                     $objWriter->startElement('t');
111 111
                     if ($textToWrite !== trim($textToWrite)) {
@@ -146,31 +146,31 @@  discard block
 block discarded – undo
146 146
         $elements = $pRichText->getRichTextElements();
147 147
         foreach ($elements as $element) {
148 148
             // r
149
-            $objWriter->startElement($prefix.'r');
149
+            $objWriter->startElement($prefix . 'r');
150 150
 
151 151
             // rPr
152 152
             if ($element instanceof \PhpSpreadsheet\RichText\Run) {
153 153
                 // rPr
154
-                $objWriter->startElement($prefix.'rPr');
154
+                $objWriter->startElement($prefix . 'rPr');
155 155
 
156 156
                 // rFont
157
-                $objWriter->startElement($prefix.'rFont');
157
+                $objWriter->startElement($prefix . 'rFont');
158 158
                 $objWriter->writeAttribute('val', $element->getFont()->getName());
159 159
                 $objWriter->endElement();
160 160
 
161 161
                 // Bold
162
-                $objWriter->startElement($prefix.'b');
162
+                $objWriter->startElement($prefix . 'b');
163 163
                 $objWriter->writeAttribute('val', ($element->getFont()->getBold() ? 'true' : 'false'));
164 164
                 $objWriter->endElement();
165 165
 
166 166
                 // Italic
167
-                $objWriter->startElement($prefix.'i');
167
+                $objWriter->startElement($prefix . 'i');
168 168
                 $objWriter->writeAttribute('val', ($element->getFont()->getItalic() ? 'true' : 'false'));
169 169
                 $objWriter->endElement();
170 170
 
171 171
                 // Superscript / subscript
172 172
                 if ($element->getFont()->getSuperScript() || $element->getFont()->getSubScript()) {
173
-                    $objWriter->startElement($prefix.'vertAlign');
173
+                    $objWriter->startElement($prefix . 'vertAlign');
174 174
                     if ($element->getFont()->getSuperScript()) {
175 175
                         $objWriter->writeAttribute('val', 'superscript');
176 176
                     } elseif ($element->getFont()->getSubScript()) {
@@ -180,22 +180,22 @@  discard block
 block discarded – undo
180 180
                 }
181 181
 
182 182
                 // Strikethrough
183
-                $objWriter->startElement($prefix.'strike');
183
+                $objWriter->startElement($prefix . 'strike');
184 184
                 $objWriter->writeAttribute('val', ($element->getFont()->getStrikethrough() ? 'true' : 'false'));
185 185
                 $objWriter->endElement();
186 186
 
187 187
                 // Color
188
-                $objWriter->startElement($prefix.'color');
188
+                $objWriter->startElement($prefix . 'color');
189 189
                 $objWriter->writeAttribute('rgb', $element->getFont()->getColor()->getARGB());
190 190
                 $objWriter->endElement();
191 191
 
192 192
                 // Size
193
-                $objWriter->startElement($prefix.'sz');
193
+                $objWriter->startElement($prefix . 'sz');
194 194
                 $objWriter->writeAttribute('val', $element->getFont()->getSize());
195 195
                 $objWriter->endElement();
196 196
 
197 197
                 // Underline
198
-                $objWriter->startElement($prefix.'u');
198
+                $objWriter->startElement($prefix . 'u');
199 199
                 $objWriter->writeAttribute('val', $element->getFont()->getUnderline());
200 200
                 $objWriter->endElement();
201 201
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
             }
204 204
 
205 205
             // t
206
-            $objWriter->startElement($prefix.'t');
206
+            $objWriter->startElement($prefix . 't');
207 207
             $objWriter->writeAttribute('xml:space', 'preserve');
208 208
             $objWriter->writeRawData(\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($element->getText()));
209 209
             $objWriter->endElement();
@@ -236,10 +236,10 @@  discard block
 block discarded – undo
236 236
         $elements = $pRichText->getRichTextElements();
237 237
         foreach ($elements as $element) {
238 238
             // r
239
-            $objWriter->startElement($prefix.'r');
239
+            $objWriter->startElement($prefix . 'r');
240 240
 
241 241
             // rPr
242
-            $objWriter->startElement($prefix.'rPr');
242
+            $objWriter->startElement($prefix . 'rPr');
243 243
 
244 244
             // Bold
245 245
             $objWriter->writeAttribute('b', ($element->getFont()->getBold() ? 1 : 0));
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
             $objWriter->writeAttribute('strike', ($element->getFont()->getStrikethrough() ? 'sngStrike' : 'noStrike'));
261 261
 
262 262
             // rFont
263
-            $objWriter->startElement($prefix.'latin');
263
+            $objWriter->startElement($prefix . 'latin');
264 264
                 $objWriter->writeAttribute('typeface', $element->getFont()->getName());
265 265
             $objWriter->endElement();
266 266
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
             $objWriter->endElement();
279 279
 
280 280
             // t
281
-            $objWriter->startElement($prefix.'t');
281
+            $objWriter->startElement($prefix . 't');
282 282
 //                    $objWriter->writeAttribute('xml:space', 'preserve');    //    Excel2010 accepts, Excel2007 complains
283 283
             $objWriter->writeRawData(\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($element->getText()));
284 284
             $objWriter->endElement();
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 
301 301
         // Loop through stringtable and add flipped items to $returnValue
302 302
         foreach ($stringTable as $key => $value) {
303
-            if (! $value instanceof \PhpSpreadsheet\RichText) {
303
+            if (!$value instanceof \PhpSpreadsheet\RichText) {
304 304
                 $returnValue[$value] = $key;
305 305
             } elseif ($value instanceof \PhpSpreadsheet\RichText) {
306 306
                 $returnValue[$value->getHashCode()] = $key;
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/Excel2007/Drawing.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             // Loop through charts and write the chart position
70 70
             if ($chartCount > 0) {
71 71
                 for ($c = 0; $c < $chartCount; ++$c) {
72
-                    $this->writeChart($objWriter, $pWorksheet->getChartByIndex($c), $c+$i);
72
+                    $this->writeChart($objWriter, $pWorksheet->getChartByIndex($c), $c + $i);
73 73
                 }
74 74
             }
75 75
         }
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
                 $objWriter->writeAttribute('macro', '');
115 115
                 $objWriter->startElement('xdr:nvGraphicFramePr');
116 116
                     $objWriter->startElement('xdr:cNvPr');
117
-                        $objWriter->writeAttribute('name', 'Chart '.$pRelationId);
117
+                        $objWriter->writeAttribute('name', 'Chart ' . $pRelationId);
118 118
                         $objWriter->writeAttribute('id', 1025 * $pRelationId);
119 119
                     $objWriter->endElement();
120 120
                     $objWriter->startElement('xdr:cNvGraphicFramePr');
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
                         $objWriter->startElement('c:chart');
141 141
                             $objWriter->writeAttribute('xmlns:c', 'http://schemas.openxmlformats.org/drawingml/2006/chart');
142 142
                             $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
143
-                            $objWriter->writeAttribute('r:id', 'rId'.$pRelationId);
143
+                            $objWriter->writeAttribute('r:id', 'rId' . $pRelationId);
144 144
                         $objWriter->endElement();
145 145
                     $objWriter->endElement();
146 146
                 $objWriter->endElement();
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
             // xdr:oneCellAnchor
167 167
             $objWriter->startElement('xdr:oneCellAnchor');
168 168
             // Image location
169
-            $aCoordinates         = \PhpSpreadsheet\Cell::coordinateFromString($pDrawing->getCoordinates());
170
-            $aCoordinates[0]     = \PhpSpreadsheet\Cell::columnIndexFromString($aCoordinates[0]);
169
+            $aCoordinates = \PhpSpreadsheet\Cell::coordinateFromString($pDrawing->getCoordinates());
170
+            $aCoordinates[0] = \PhpSpreadsheet\Cell::columnIndexFromString($aCoordinates[0]);
171 171
 
172 172
             // xdr:from
173 173
             $objWriter->startElement('xdr:from');
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
     public function allDrawings(\PhpSpreadsheet\SpreadSheet $spreadsheet = null)
571 571
     {
572 572
         // Get an array of all drawings
573
-        $aDrawings    = array();
573
+        $aDrawings = array();
574 574
 
575 575
         // Loop through PhpSpreadsheet
576 576
         $sheetCount = $spreadsheet->getSheetCount();
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/HTML.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 
439 439
             // calculate start of <tbody>, <thead>
440 440
             $tbodyStart = $rowMin;
441
-            $theadStart = $theadEnd   = 0; // default: no <thead>    no </thead>
441
+            $theadStart = $theadEnd = 0; // default: no <thead>    no </thead>
442 442
             if ($sheet->getPageSetup()->isRowsToRepeatAtTopSet()) {
443 443
                 $rowsToRepeatAtTop = $sheet->getPageSetup()->getRowsToRepeatAtTop();
444 444
 
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
             }
452 452
 
453 453
             // Loop through cells
454
-            $row = $rowMin-1;
454
+            $row = $rowMin - 1;
455 455
             while ($row++ < $rowMax) {
456 456
                 // <thead> ?
457 457
                 if ($row == $theadStart) {
@@ -589,9 +589,9 @@  discard block
 block discarded – undo
589 589
             $html .= '<tr>';
590 590
             for ($col = 'A'; $col != $colMax; ++$col) {
591 591
                 $html .= '<td>';
592
-                $html .= $this->writeImageInCell($pSheet, $col.$row);
592
+                $html .= $this->writeImageInCell($pSheet, $col . $row);
593 593
                 if ($this->includeCharts) {
594
-                    $html .= $this->writeChartInCell($pSheet, $col.$row);
594
+                    $html .= $this->writeChartInCell($pSheet, $col . $row);
595 595
                 }
596 596
                 $html .= '</td>';
597 597
             }
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
                             // base64 encode the binary data, then break it
649 649
                             // into chunks according to RFC 2045 semantics
650 650
                             $base64 = chunk_split(base64_encode($picture));
651
-                            $imageData = 'data:'.$imageDetails['mime'].';base64,' . $base64;
651
+                            $imageData = 'data:' . $imageDetails['mime'] . ';base64,' . $base64;
652 652
                         } else {
653 653
                             $imageData = $filename;
654 654
                         }
@@ -665,10 +665,10 @@  discard block
 block discarded – undo
665 665
                 if ($drawing->getCoordinates() != $coordinates) {
666 666
                     continue;
667 667
                 }
668
-                ob_start();                                //  Let's start output buffering.
669
-                imagepng($drawing->getImageResource());    //  This will normally output the image, but because of ob_start(), it won't.
670
-                $contents = ob_get_contents();             //  Instead, output above is saved to $contents
671
-                ob_end_clean();                            //  End the output buffer.
668
+                ob_start(); //  Let's start output buffering.
669
+                imagepng($drawing->getImageResource()); //  This will normally output the image, but because of ob_start(), it won't.
670
+                $contents = ob_get_contents(); //  Instead, output above is saved to $contents
671
+                ob_end_clean(); //  End the output buffer.
672 672
 
673 673
                 $dataUri = "data:image/jpeg;base64," . base64_encode($contents);
674 674
 
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
                 //  max-width: 100% ensures that image doesnt overflow containing cell
677 677
                 //  width: X sets width of supplied image.
678 678
                 //  As a result, images bigger than cell will be contained and images smaller will not get stretched
679
-                $html .= '<img src="'.$dataUri.'" style="max-width:100%;width:'.$drawing->getWidth().'px;" />';
679
+                $html .= '<img src="' . $dataUri . '" style="max-width:100%;width:' . $drawing->getWidth() . 'px;" />';
680 680
             }
681 681
         }
682 682
 
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
             if ($chart instanceof Spreadsheet_Chart) {
702 702
                 $chartCoordinates = $chart->getTopLeftPosition();
703 703
                 if ($chartCoordinates['cell'] == $coordinates) {
704
-                    $chartFileName = \Spreadsheet\Shared\File::sysGetTempDir().'/'.uniqid().'.png';
704
+                    $chartFileName = \Spreadsheet\Shared\File::sysGetTempDir() . '/' . uniqid() . '.png';
705 705
                     if (!$chart->render($chartFileName)) {
706 706
                         return;
707 707
                     }
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
                         // base64 encode the binary data, then break it
715 715
                         // into chunks according to RFC 2045 semantics
716 716
                         $base64 = chunk_split(base64_encode($picture));
717
-                        $imageData = 'data:'.$imageDetails['mime'].';base64,' . $base64;
717
+                        $imageData = 'data:' . $imageDetails['mime'] . ';base64,' . $base64;
718 718
 
719 719
                         $html .= '<div style="position: relative;">';
720 720
                         $html .= '<img style="position: absolute; z-index: 1; left: ' . $chartCoordinates['xOffset'] . 'px; top: ' . $chartCoordinates['yOffset'] . 'px; width: ' . $imageDetails[0] . 'px; height: ' . $imageDetails[1] . 'px;" src="' . $imageData . '" border="0" />' . PHP_EOL;
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
 
810 810
 
811 811
         // table { }
812
-        $css['table']['border-collapse']  = 'collapse';
812
+        $css['table']['border-collapse'] = 'collapse';
813 813
         if (!$this->isPdf) {
814 814
             $css['table']['page-break-after'] = 'always';
815 815
         }
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
         if ($textAlign = $this->mapHAlign($pStyle->getHorizontal())) {
968 968
             $css['text-align'] = $textAlign;
969 969
             if (in_array($textAlign, array('left', 'right'))) {
970
-                $css['padding-'.$textAlign] = (string)((int)$pStyle->getIndent() * 9).'px';
970
+                $css['padding-' . $textAlign] = (string) ((int) $pStyle->getIndent() * 9) . 'px';
971 971
             }
972 972
         }
973 973
 
@@ -1258,9 +1258,9 @@  discard block
 block discarded – undo
1258 1258
                         }
1259 1259
                         $cellData = htmlspecialchars($cellData);
1260 1260
                         if ($pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont()->getSuperScript()) {
1261
-                            $cellData = '<sup>'.$cellData.'</sup>';
1261
+                            $cellData = '<sup>' . $cellData . '</sup>';
1262 1262
                         } elseif ($pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont()->getSubScript()) {
1263
-                            $cellData = '<sub>'.$cellData.'</sub>';
1263
+                            $cellData = '<sub>' . $cellData . '</sub>';
1264 1264
                         }
1265 1265
                     }
1266 1266
 
@@ -1370,7 +1370,7 @@  discard block
 block discarded – undo
1370 1370
                     $html .= $cellData;
1371 1371
 
1372 1372
                     // Column end
1373
-                    $html .= '</'.$cellType.'>' . PHP_EOL;
1373
+                    $html .= '</' . $cellType . '>' . PHP_EOL;
1374 1374
                 }
1375 1375
 
1376 1376
                 // Next column
@@ -1515,7 +1515,7 @@  discard block
 block discarded – undo
1515 1515
         foreach ($sheetIndexes as $sheetIndex) {
1516 1516
             $sheet = $this->spreadsheet->getSheet($sheetIndex);
1517 1517
 
1518
-            $candidateSpannedRow  = array();
1518
+            $candidateSpannedRow = array();
1519 1519
 
1520 1520
             // loop through all Excel merged cells
1521 1521
             foreach ($sheet->getMergeCells() as $cells) {
@@ -1577,7 +1577,7 @@  discard block
 block discarded – undo
1577 1577
 
1578 1578
                         if (!in_array($baseCell, $adjustedBaseCells)) {
1579 1579
                             // subtract rowspan by 1
1580
-                            --$this->isBaseCell[$sheetIndex][ $baseCell[0] ][ $baseCell[1] ]['rowspan'];
1580
+                            --$this->isBaseCell[$sheetIndex][$baseCell[0]][$baseCell[1]]['rowspan'];
1581 1581
                             $adjustedBaseCells[] = $baseCell;
1582 1582
                         }
1583 1583
                     }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Chart.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -668,7 +668,7 @@
 block discarded – undo
668 668
             set_include_path(get_include_path() . PATH_SEPARATOR . $libraryPath);
669 669
         }
670 670
 
671
-        $rendererName = '\\PhpSpreadsheet\\Chart\\Renderer\\'.$libraryName;
671
+        $rendererName = '\\PhpSpreadsheet\\Chart\\Renderer\\' . $libraryName;
672 672
         $renderer = new $rendererName($this);
673 673
 
674 674
         if ($outputDestination == 'php://output') {
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Shared/Excel5.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -233,8 +233,8 @@  discard block
 block discarded – undo
233 233
         $y1 = $offsetY;
234 234
 
235 235
         // Initialise end cell to the same as the start cell
236
-        $col_end    = $col_start;  // Col containing lower right corner of object
237
-        $row_end    = $row_start;  // Row containing bottom right corner of object
236
+        $col_end    = $col_start; // Col containing lower right corner of object
237
+        $row_end    = $row_start; // Row containing bottom right corner of object
238 238
 
239 239
         // Zero the specified offset if greater than the cell dimensions
240 240
         if ($x1 >= self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start))) {
@@ -244,8 +244,8 @@  discard block
 block discarded – undo
244 244
             $y1 = 0;
245 245
         }
246 246
 
247
-        $width      = $width  + $x1 -1;
248
-        $height     = $height + $y1 -1;
247
+        $width      = $width + $x1 - 1;
248
+        $height     = $height + $y1 - 1;
249 249
 
250 250
         // Subtract the underlying cell widths to find the end cell of the image
251 251
         while ($width >= self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end))) {
@@ -264,21 +264,21 @@  discard block
 block discarded – undo
264 264
         if (self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) == 0) {
265 265
             return;
266 266
         }
267
-        if (self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end))   == 0) {
267
+        if (self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) == 0) {
268 268
             return;
269 269
         }
270 270
         if (self::sizeRow($sheet, $row_start + 1) == 0) {
271 271
             return;
272 272
         }
273
-        if (self::sizeRow($sheet, $row_end + 1)   == 0) {
273
+        if (self::sizeRow($sheet, $row_end + 1) == 0) {
274 274
             return;
275 275
         }
276 276
 
277 277
         // Convert the pixel values to the percentage value expected by Excel
278
-        $x1 = $x1     / self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start))   * 1024;
279
-        $y1 = $y1     / self::sizeRow($sheet, $row_start + 1)   *  256;
280
-        $x2 = ($width + 1)  / self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end))     * 1024; // Distance to right side of object
281
-        $y2 = ($height + 1) / self::sizeRow($sheet, $row_end + 1)     *  256; // Distance to bottom of object
278
+        $x1 = $x1 / self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) * 1024;
279
+        $y1 = $y1 / self::sizeRow($sheet, $row_start + 1) * 256;
280
+        $x2 = ($width + 1) / self::sizeCol($sheet, \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object
281
+        $y2 = ($height + 1) / self::sizeRow($sheet, $row_end + 1) * 256; // Distance to bottom of object
282 282
 
283 283
         $startCoordinates = \PhpSpreadsheet\Cell::stringFromColumnIndex($col_start) . ($row_start + 1);
284 284
         $endCoordinates = \PhpSpreadsheet\Cell::stringFromColumnIndex($col_end) . ($row_end + 1);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Shared/Font.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
     const CHARSET_ANSI_JAPANESE_SHIFTJIS    = 0x80;
46 46
     const CHARSET_ANSI_KOREAN_HANGUL        = 0x81;
47 47
     const CHARSET_ANSI_KOREAN_JOHAB         = 0x82;
48
-    const CHARSET_ANSI_CHINESE_SIMIPLIFIED  = 0x86;        //    gb2312
49
-    const CHARSET_ANSI_CHINESE_TRADITIONAL  = 0x88;        //    big5
48
+    const CHARSET_ANSI_CHINESE_SIMIPLIFIED  = 0x86; //    gb2312
49
+    const CHARSET_ANSI_CHINESE_TRADITIONAL  = 0x88; //    big5
50 50
     const CHARSET_ANSI_GREEK                = 0xA1;
51 51
     const CHARSET_ANSI_TURKISH              = 0xA2;
52 52
     const CHARSET_ANSI_VIETNAMESE           = 0xA3;
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
                 );
512 512
                 break;
513 513
             default:
514
-                throw new \PhpSpreadsheet\Exception('Unknown font name "'. $name .'". Cannot map to TrueType font file');
514
+                throw new \PhpSpreadsheet\Exception('Unknown font name "' . $name . '". Cannot map to TrueType font file');
515 515
                 break;
516 516
         }
517 517
 
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Shared/CodePage.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -40,117 +40,117 @@
 block discarded – undo
40 40
     {
41 41
         switch ($codePage) {
42 42
             case 367:
43
-                return 'ASCII';    //    ASCII
43
+                return 'ASCII'; //    ASCII
44 44
             case 437:
45
-                return 'CP437';    //    OEM US
45
+                return 'CP437'; //    OEM US
46 46
             case 720:
47
-                throw new \PhpSpreadsheet\Exception('Code page 720 not supported.');    //    OEM Arabic
47
+                throw new \PhpSpreadsheet\Exception('Code page 720 not supported.'); //    OEM Arabic
48 48
             case 737:
49
-                return 'CP737';    //    OEM Greek
49
+                return 'CP737'; //    OEM Greek
50 50
             case 775:
51
-                return 'CP775';    //    OEM Baltic
51
+                return 'CP775'; //    OEM Baltic
52 52
             case 850:
53
-                return 'CP850';    //    OEM Latin I
53
+                return 'CP850'; //    OEM Latin I
54 54
             case 852:
55
-                return 'CP852';    //    OEM Latin II (Central European)
55
+                return 'CP852'; //    OEM Latin II (Central European)
56 56
             case 855:
57
-                return 'CP855';    //    OEM Cyrillic
57
+                return 'CP855'; //    OEM Cyrillic
58 58
             case 857:
59
-                return 'CP857';    //    OEM Turkish
59
+                return 'CP857'; //    OEM Turkish
60 60
             case 858:
61
-                return 'CP858';    //    OEM Multilingual Latin I with Euro
61
+                return 'CP858'; //    OEM Multilingual Latin I with Euro
62 62
             case 860:
63
-                return 'CP860';    //    OEM Portugese
63
+                return 'CP860'; //    OEM Portugese
64 64
             case 861:
65
-                return 'CP861';    //    OEM Icelandic
65
+                return 'CP861'; //    OEM Icelandic
66 66
             case 862:
67
-                return 'CP862';    //    OEM Hebrew
67
+                return 'CP862'; //    OEM Hebrew
68 68
             case 863:
69
-                return 'CP863';    //    OEM Canadian (French)
69
+                return 'CP863'; //    OEM Canadian (French)
70 70
             case 864:
71
-                return 'CP864';    //    OEM Arabic
71
+                return 'CP864'; //    OEM Arabic
72 72
             case 865:
73
-                return 'CP865';    //    OEM Nordic
73
+                return 'CP865'; //    OEM Nordic
74 74
             case 866:
75
-                return 'CP866';    //    OEM Cyrillic (Russian)
75
+                return 'CP866'; //    OEM Cyrillic (Russian)
76 76
             case 869:
77
-                return 'CP869';    //    OEM Greek (Modern)
77
+                return 'CP869'; //    OEM Greek (Modern)
78 78
             case 874:
79
-                return 'CP874';    //    ANSI Thai
79
+                return 'CP874'; //    ANSI Thai
80 80
             case 932:
81
-                return 'CP932';    //    ANSI Japanese Shift-JIS
81
+                return 'CP932'; //    ANSI Japanese Shift-JIS
82 82
             case 936:
83
-                return 'CP936';    //    ANSI Chinese Simplified GBK
83
+                return 'CP936'; //    ANSI Chinese Simplified GBK
84 84
             case 949:
85
-                return 'CP949';    //    ANSI Korean (Wansung)
85
+                return 'CP949'; //    ANSI Korean (Wansung)
86 86
             case 950:
87
-                return 'CP950';    //    ANSI Chinese Traditional BIG5
87
+                return 'CP950'; //    ANSI Chinese Traditional BIG5
88 88
             case 1200:
89 89
                 return 'UTF-16LE'; //    UTF-16 (BIFF8)
90 90
             case 1250:
91
-                return 'CP1250';   //    ANSI Latin II (Central European)
91
+                return 'CP1250'; //    ANSI Latin II (Central European)
92 92
             case 1251:
93
-                return 'CP1251';   //    ANSI Cyrillic
93
+                return 'CP1251'; //    ANSI Cyrillic
94 94
             case 0:
95 95
                 //    CodePage is not always correctly set when the xls file was saved by Apple's Numbers program
96 96
             case 1252:
97
-                return 'CP1252';   //    ANSI Latin I (BIFF4-BIFF7)
97
+                return 'CP1252'; //    ANSI Latin I (BIFF4-BIFF7)
98 98
             case 1253:
99
-                return 'CP1253';   //    ANSI Greek
99
+                return 'CP1253'; //    ANSI Greek
100 100
             case 1254:
101
-                return 'CP1254';   //    ANSI Turkish
101
+                return 'CP1254'; //    ANSI Turkish
102 102
             case 1255:
103
-                return 'CP1255';   //    ANSI Hebrew
103
+                return 'CP1255'; //    ANSI Hebrew
104 104
             case 1256:
105
-                return 'CP1256';   //    ANSI Arabic
105
+                return 'CP1256'; //    ANSI Arabic
106 106
             case 1257:
107
-                return 'CP1257';   //    ANSI Baltic
107
+                return 'CP1257'; //    ANSI Baltic
108 108
             case 1258:
109
-                return 'CP1258';   //    ANSI Vietnamese
109
+                return 'CP1258'; //    ANSI Vietnamese
110 110
             case 1361:
111
-                return 'CP1361';   //    ANSI Korean (Johab)
111
+                return 'CP1361'; //    ANSI Korean (Johab)
112 112
             case 10000:
113
-                return 'MAC';      //    Apple Roman
113
+                return 'MAC'; //    Apple Roman
114 114
             case 10001:
115
-                return 'CP932';    //    Macintosh Japanese
115
+                return 'CP932'; //    Macintosh Japanese
116 116
             case 10002:
117
-                return 'CP950';    //    Macintosh Chinese Traditional
117
+                return 'CP950'; //    Macintosh Chinese Traditional
118 118
             case 10003:
119
-                return 'CP1361';   //    Macintosh Korean
119
+                return 'CP1361'; //    Macintosh Korean
120 120
             case 10004:
121 121
                 return 'MACARABIC'; //    Apple Arabic
122 122
             case 10005:
123 123
                 return 'MACHEBREW'; //    Apple Hebrew
124 124
             case 10006:
125
-                return 'MACGREEK';  //    Macintosh Greek
125
+                return 'MACGREEK'; //    Macintosh Greek
126 126
             case 10007:
127
-                return 'MACCYRILLIC';  //    Macintosh Cyrillic
127
+                return 'MACCYRILLIC'; //    Macintosh Cyrillic
128 128
             case 10008:
129
-                return 'CP936';  //    Macintosh - Simplified Chinese (GB 2312)
129
+                return 'CP936'; //    Macintosh - Simplified Chinese (GB 2312)
130 130
             case 10010:
131
-                return 'MACROMANIA';    //    Macintosh Romania
131
+                return 'MACROMANIA'; //    Macintosh Romania
132 132
             case 10017:
133
-                return 'MACUKRAINE';    //    Macintosh Ukraine
133
+                return 'MACUKRAINE'; //    Macintosh Ukraine
134 134
             case 10021:
135
-                return 'MACTHAI';    //    Macintosh Thai
135
+                return 'MACTHAI'; //    Macintosh Thai
136 136
             case 10029:
137
-                return 'MACCENTRALEUROPE';  //    Macintosh Central Europe
137
+                return 'MACCENTRALEUROPE'; //    Macintosh Central Europe
138 138
             case 10079:
139
-                return 'MACICELAND';  //    Macintosh Icelandic
139
+                return 'MACICELAND'; //    Macintosh Icelandic
140 140
             case 10081:
141
-                return 'MACTURKISH';  //    Macintosh Turkish
141
+                return 'MACTURKISH'; //    Macintosh Turkish
142 142
             case 10082:
143
-                return 'MACCROATIAN';    //    Macintosh Croatian
143
+                return 'MACCROATIAN'; //    Macintosh Croatian
144 144
             case 21010:
145
-                return 'UTF-16LE';  //    UTF-16 (BIFF8) This isn't correct, but some Excel writer libraries erroneously use Codepage 21010 for UTF-16LE
145
+                return 'UTF-16LE'; //    UTF-16 (BIFF8) This isn't correct, but some Excel writer libraries erroneously use Codepage 21010 for UTF-16LE
146 146
             case 32768:
147
-                return 'MAC';      //    Apple Roman
147
+                return 'MAC'; //    Apple Roman
148 148
             case 32769:
149
-                throw new \PhpSpreadsheet\Exception('Code page 32769 not supported.');  //    ANSI Latin I (BIFF2-BIFF3)
149
+                throw new \PhpSpreadsheet\Exception('Code page 32769 not supported.'); //    ANSI Latin I (BIFF2-BIFF3)
150 150
             case 65000:
151
-                return 'UTF-7';    //    Unicode (UTF-7)
151
+                return 'UTF-7'; //    Unicode (UTF-7)
152 152
             case 65001:
153
-                return 'UTF-8';    //    Unicode (UTF-8)
153
+                return 'UTF-8'; //    Unicode (UTF-8)
154 154
         }
155 155
         throw new \PhpSpreadsheet\Exception('Unknown codepage: ' . $codePage);
156 156
     }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Shared/Trend/Trend.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             trigger_error("Trend(): Number of elements in coordinate arrays do not match.", E_USER_ERROR);
87 87
         }
88 88
 
89
-        $key = md5($trendType.$const.serialize($yValues).serialize($xValues));
89
+        $key = md5($trendType . $const . serialize($yValues) . serialize($xValues));
90 90
         //    Determine which Trend method has been requested
91 91
         switch ($trendType) {
92 92
             //    Instantiate and return the class for the requested Trend method
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             case self::TREND_EXPONENTIAL:
96 96
             case self::TREND_POWER:
97 97
                 if (!isset(self::$trendCache[$key])) {
98
-                    $className = '\PhpSpreadsheet\Shared\Trend\\'.$trendType.'BestFit';
98
+                    $className = '\PhpSpreadsheet\Shared\Trend\\' . $trendType . 'BestFit';
99 99
                     self::$trendCache[$key] = new $className($yValues, $xValues, $const);
100 100
                 }
101 101
                 return self::$trendCache[$key];
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
                 //    If the request is to determine the best fit regression, then we test each Trend line in turn
115 115
                 //    Start by generating an instance of each available Trend method
116 116
                 foreach (self::$trendTypes as $trendMethod) {
117
-                    $className = '\PhpSpreadsheet\Shared\Trend\\'.$trendType.'BestFit';
117
+                    $className = '\PhpSpreadsheet\Shared\Trend\\' . $trendType . 'BestFit';
118 118
                     $bestFit[$trendMethod] = new $className($yValues, $xValues, $const);
119 119
                     $bestFitValue[$trendMethod] = $bestFit[$trendMethod]->getGoodnessOfFit();
120 120
                 }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Cell/AdvancedValueBinder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             }
56 56
 
57 57
             // Check for number in scientific format
58
-            if (preg_match('/^'.\PhpSpreadsheet\Calculation::CALCULATION_REGEXP_NUMBER.'$/', $value)) {
58
+            if (preg_match('/^' . \PhpSpreadsheet\Calculation::CALCULATION_REGEXP_NUMBER . '$/', $value)) {
59 59
                 $cell->setValueExplicit((float) $value, DataType::TYPE_NUMERIC);
60 60
                 return true;
61 61
             }
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             $currencyCode = \PhpSpreadsheet\Shared\StringHelper::getCurrencyCode();
101 101
             $decimalSeparator = \PhpSpreadsheet\Shared\StringHelper::getDecimalSeparator();
102 102
             $thousandsSeparator = \PhpSpreadsheet\Shared\StringHelper::getThousandsSeparator();
103
-            if (preg_match('/^'.preg_quote($currencyCode).' *(\d{1,3}('.preg_quote($thousandsSeparator).'\d{3})*|(\d+))('.preg_quote($decimalSeparator).'\d{2})?$/', $value)) {
103
+            if (preg_match('/^' . preg_quote($currencyCode) . ' *(\d{1,3}(' . preg_quote($thousandsSeparator) . '\d{3})*|(\d+))(' . preg_quote($decimalSeparator) . '\d{2})?$/', $value)) {
104 104
                 // Convert value to number
105 105
                 $value = (float) trim(str_replace(array($currencyCode, $thousandsSeparator, $decimalSeparator), array('', '', '.'), $value));
106 106
                 $cell->setValueExplicit($value, DataType::TYPE_NUMERIC);
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
                 return true;
113 113
             } elseif (preg_match('/^\$ *(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$/', $value)) {
114 114
                 // Convert value to number
115
-                $value = (float) trim(str_replace(array('$',','), '', $value));
115
+                $value = (float) trim(str_replace(array('$', ','), '', $value));
116 116
                 $cell->setValueExplicit($value, DataType::TYPE_NUMERIC);
117 117
                 // Set style
118 118
                 $cell->getWorksheet()->getStyle($cell->getCoordinate())
Please login to merge, or discard this patch.