Completed
Pull Request — develop (#47)
by
unknown
10:56
created
src/PhpSpreadsheet/Chart/Renderer/JpGraph.php 2 patches
Doc Comments   +62 added lines patch added patch discarded remove patch
@@ -60,6 +60,9 @@  discard block
 block discarded – undo
60 60
 
61 61
     private static $plotMark = 0;
62 62
 
63
+    /**
64
+     * @param string $markerID
65
+     */
63 66
     private function formatPointMarker($seriesPlot, $markerID)
64 67
     {
65 68
         $plotMarkKeys = array_keys(self::$markSet);
@@ -87,6 +90,9 @@  discard block
 block discarded – undo
87 90
         return $seriesPlot;
88 91
     }
89 92
 
93
+    /**
94
+     * @param integer $labelCount
95
+     */
90 96
     private function formatDataSetLabels($groupID, $datasetLabels, $labelCount, $rotation = '')
91 97
     {
92 98
         $datasetLabelFormatCode = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getFormatCode();
@@ -116,6 +122,9 @@  discard block
 block discarded – undo
116 122
         return $datasetLabels;
117 123
     }
118 124
 
125
+    /**
126
+     * @param integer $seriesCount
127
+     */
119 128
     private function percentageSumCalculation($groupID, $seriesCount)
120 129
     {
121 130
         //    Adjust our values to a percentage value across all series in the group
@@ -146,6 +155,9 @@  discard block
 block discarded – undo
146 155
         return $dataValues;
147 156
     }
148 157
 
158
+    /**
159
+     * @param \PhpOffice\PhpSpreadsheet\Chart\Title $captionElement
160
+     */
149 161
     private function getCaption($captionElement)
150 162
     {
151 163
         //    Read any caption
@@ -253,6 +265,9 @@  discard block
 block discarded – undo
253 265
         $this->renderTitle();
254 266
     }
255 267
 
268
+    /**
269
+     * @param integer $groupID
270
+     */
256 271
     private function renderPlotLine($groupID, $filled = false, $combination = false, $dimensions = '2d')
257 272
     {
258 273
         $grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
@@ -316,6 +331,9 @@  discard block
 block discarded – undo
316 331
         $this->graph->Add($groupPlot);
317 332
     }
318 333
 
334
+    /**
335
+     * @param integer $groupID
336
+     */
319 337
     private function renderPlotBar($groupID, $dimensions = '2d')
320 338
     {
321 339
         $rotation = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotDirection();
@@ -400,6 +418,10 @@  discard block
 block discarded – undo
400 418
         $this->graph->Add($groupPlot);
401 419
     }
402 420
 
421
+    /**
422
+     * @param integer $groupID
423
+     * @param boolean $bubble
424
+     */
403 425
     private function renderPlotScatter($groupID, $bubble)
404 426
     {
405 427
         $grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
@@ -445,6 +467,9 @@  discard block
 block discarded – undo
445 467
         }
446 468
     }
447 469
 
470
+    /**
471
+     * @param integer $groupID
472
+     */
448 473
     private function renderPlotRadar($groupID)
449 474
     {
450 475
         $radarStyle = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
@@ -483,6 +508,9 @@  discard block
 block discarded – undo
483 508
         }
484 509
     }
485 510
 
511
+    /**
512
+     * @param integer $groupID
513
+     */
486 514
     private function renderPlotContour($groupID)
487 515
     {
488 516
         $contourStyle = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
@@ -503,6 +531,9 @@  discard block
 block discarded – undo
503 531
         $this->graph->Add($seriesPlot);
504 532
     }
505 533
 
534
+    /**
535
+     * @param integer $groupID
536
+     */
506 537
     private function renderPlotStock($groupID)
507 538
     {
508 539
         $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
@@ -542,6 +573,9 @@  discard block
 block discarded – undo
542 573
         $this->graph->Add($seriesPlot);
543 574
     }
544 575
 
576
+    /**
577
+     * @param integer $groupCount
578
+     */
545 579
     private function renderAreaChart($groupCount, $dimensions = '2d')
546 580
     {
547 581
         require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_line.php';
@@ -553,6 +587,9 @@  discard block
 block discarded – undo
553 587
         }
554 588
     }
555 589
 
590
+    /**
591
+     * @param integer $groupCount
592
+     */
556 593
     private function renderLineChart($groupCount, $dimensions = '2d')
557 594
     {
558 595
         require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_line.php';
@@ -564,6 +601,9 @@  discard block
 block discarded – undo
564 601
         }
565 602
     }
566 603
 
604
+    /**
605
+     * @param integer $groupCount
606
+     */
567 607
     private function renderBarChart($groupCount, $dimensions = '2d')
568 608
     {
569 609
         require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_bar.php';
@@ -575,6 +615,9 @@  discard block
 block discarded – undo
575 615
         }
576 616
     }
577 617
 
618
+    /**
619
+     * @param integer $groupCount
620
+     */
578 621
     private function renderScatterChart($groupCount)
579 622
     {
580 623
         require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_scatter.php';
@@ -588,6 +631,9 @@  discard block
 block discarded – undo
588 631
         }
589 632
     }
590 633
 
634
+    /**
635
+     * @param integer $groupCount
636
+     */
591 637
     private function renderBubbleChart($groupCount)
592 638
     {
593 639
         require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_scatter.php';
@@ -599,6 +645,9 @@  discard block
 block discarded – undo
599 645
         }
600 646
     }
601 647
 
648
+    /**
649
+     * @param integer $groupCount
650
+     */
602 651
     private function renderPieChart($groupCount, $dimensions = '2d', $doughnut = false, $multiplePlots = false)
603 652
     {
604 653
         require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_pie.php';
@@ -675,6 +724,9 @@  discard block
 block discarded – undo
675 724
         }
676 725
     }
677 726
 
727
+    /**
728
+     * @param integer $groupCount
729
+     */
678 730
     private function renderRadarChart($groupCount)
679 731
     {
680 732
         require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_radar.php';
@@ -686,6 +738,9 @@  discard block
 block discarded – undo
686 738
         }
687 739
     }
688 740
 
741
+    /**
742
+     * @param integer $groupCount
743
+     */
689 744
     private function renderStockChart($groupCount)
690 745
     {
691 746
         require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_stock.php';
@@ -697,6 +752,10 @@  discard block
 block discarded – undo
697 752
         }
698 753
     }
699 754
 
755
+    /**
756
+     * @param integer $groupCount
757
+     * @param string|null $dimensions
758
+     */
700 759
     private function renderContourChart($groupCount, $dimensions)
701 760
     {
702 761
         require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_contour.php';
@@ -708,6 +767,9 @@  discard block
 block discarded – undo
708 767
         }
709 768
     }
710 769
 
770
+    /**
771
+     * @param integer $groupCount
772
+     */
711 773
     private function renderCombinationChart($groupCount, $dimensions, $outputDestination)
712 774
     {
713 775
         require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_line.php';
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 
545 545
     private function renderAreaChart($groupCount, $dimensions = '2d')
546 546
     {
547
-        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php';
547
+        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_line.php';
548 548
 
549 549
         $this->renderCartesianPlotArea();
550 550
 
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 
556 556
     private function renderLineChart($groupCount, $dimensions = '2d')
557 557
     {
558
-        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php';
558
+        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_line.php';
559 559
 
560 560
         $this->renderCartesianPlotArea();
561 561
 
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 
567 567
     private function renderBarChart($groupCount, $dimensions = '2d')
568 568
     {
569
-        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_bar.php';
569
+        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_bar.php';
570 570
 
571 571
         $this->renderCartesianPlotArea();
572 572
 
@@ -577,9 +577,9 @@  discard block
 block discarded – undo
577 577
 
578 578
     private function renderScatterChart($groupCount)
579 579
     {
580
-        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_scatter.php';
581
-        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_regstat.php';
582
-        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php';
580
+        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_scatter.php';
581
+        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_regstat.php';
582
+        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_line.php';
583 583
 
584 584
         $this->renderCartesianPlotArea('linlin');
585 585
 
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
 
591 591
     private function renderBubbleChart($groupCount)
592 592
     {
593
-        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_scatter.php';
593
+        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_scatter.php';
594 594
 
595 595
         $this->renderCartesianPlotArea('linlin');
596 596
 
@@ -601,9 +601,9 @@  discard block
 block discarded – undo
601 601
 
602 602
     private function renderPieChart($groupCount, $dimensions = '2d', $doughnut = false, $multiplePlots = false)
603 603
     {
604
-        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_pie.php';
604
+        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_pie.php';
605 605
         if ($dimensions == '3d') {
606
-            require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_pie3d.php';
606
+            require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_pie3d.php';
607 607
         }
608 608
 
609 609
         $this->renderPiePlotArea($doughnut);
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 
678 678
     private function renderRadarChart($groupCount)
679 679
     {
680
-        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_radar.php';
680
+        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_radar.php';
681 681
 
682 682
         $this->renderRadarPlotArea();
683 683
 
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
 
689 689
     private function renderStockChart($groupCount)
690 690
     {
691
-        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_stock.php';
691
+        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_stock.php';
692 692
 
693 693
         $this->renderCartesianPlotArea('intint');
694 694
 
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
 
700 700
     private function renderContourChart($groupCount, $dimensions)
701 701
     {
702
-        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_contour.php';
702
+        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_contour.php';
703 703
 
704 704
         $this->renderCartesianPlotArea('intint');
705 705
 
@@ -710,11 +710,11 @@  discard block
 block discarded – undo
710 710
 
711 711
     private function renderCombinationChart($groupCount, $dimensions, $outputDestination)
712 712
     {
713
-        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php';
714
-        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_bar.php';
715
-        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_scatter.php';
716
-        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_regstat.php';
717
-        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php';
713
+        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_line.php';
714
+        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_bar.php';
715
+        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_scatter.php';
716
+        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_regstat.php';
717
+        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . 'jpgraph_line.php';
718 718
 
719 719
         $this->renderCartesianPlotArea();
720 720
 
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
                 $this->renderStockChart($groupCount, $dimensions);
837 837
                 break;
838 838
             default:
839
-                echo $chartType.' is not yet implemented<br />';
839
+                echo $chartType . ' is not yet implemented<br />';
840 840
 
841 841
                 return false;
842 842
         }
@@ -855,6 +855,6 @@  discard block
 block discarded – undo
855 855
         $this->graph = null;
856 856
         $this->chart = $chart;
857 857
 
858
-        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath().'/jpgraph.php';
858
+        require_once \PhpOffice\PhpSpreadsheet\Settings::getChartRendererPath() . '/jpgraph.php';
859 859
     }
860 860
 }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Reader/Xlsx/Chart.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -204,6 +204,9 @@
 block discarded – undo
204 204
         return $chart;
205 205
     }
206 206
 
207
+    /**
208
+     * @param string $type
209
+     */
207 210
     private static function chartTitle($titleDetails, $namespacesChartMeta, $type)
208 211
     {
209 212
         $caption = [];
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/Xlsx/Chart.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -412,6 +412,8 @@  discard block
 block discarded – undo
412 412
      * @param  string $id1
413 413
      * @param  string $id2
414 414
      * @param  bool $isMultiLevelSeries
415
+     * @param null|Axis $xAxis
416
+     * @param null|Axis $yAxis
415 417
      *
416 418
      * @throws  \PhpSpreadsheet\Writer\Exception
417 419
      */
@@ -534,6 +536,10 @@  discard block
 block discarded – undo
534 536
      * @param  string $id1
535 537
      * @param  string $id2
536 538
      * @param  bool $isMultiLevelSeries
539
+     * @param null|Axis $xAxis
540
+     * @param null|Axis $yAxis
541
+     * @param null|GridLines $majorGridlines
542
+     * @param null|GridLines $minorGridlines
537 543
      *
538 544
      * @throws  \PhpSpreadsheet\Writer\Exception
539 545
      */
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
         $catIsMultiLevelSeries = $valIsMultiLevelSeries = false;
247 247
         $plotGroupingType = '';
248 248
         foreach ($chartTypes as $chartType) {
249
-            $objWriter->startElement('c:'.$chartType);
249
+            $objWriter->startElement('c:' . $chartType);
250 250
 
251 251
             $groupCount = $plotArea->getPlotGroupCount();
252 252
             for ($i = 0; $i < $groupCount; ++$i) {
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
 
848 848
         if (!is_null($xAxis->getFillProperty('value'))) {
849 849
             $objWriter->startElement('a:solidFill');
850
-            $objWriter->startElement('a:'.$xAxis->getFillProperty('type'));
850
+            $objWriter->startElement('a:' . $xAxis->getFillProperty('type'));
851 851
             $objWriter->writeAttribute('val', $xAxis->getFillProperty('value'));
852 852
             $objWriter->startElement('a:alpha');
853 853
             $objWriter->writeAttribute('val', $xAxis->getFillProperty('alpha'));
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
 
865 865
         if (!is_null($xAxis->getLineProperty('value'))) {
866 866
             $objWriter->startElement('a:solidFill');
867
-            $objWriter->startElement('a:'.$xAxis->getLineProperty('type'));
867
+            $objWriter->startElement('a:' . $xAxis->getLineProperty('type'));
868 868
             $objWriter->writeAttribute('val', $xAxis->getLineProperty('value'));
869 869
             $objWriter->startElement('a:alpha');
870 870
             $objWriter->writeAttribute('val', $xAxis->getLineProperty('alpha'));
@@ -1304,13 +1304,13 @@  discard block
 block discarded – undo
1304 1304
 
1305 1305
             $objWriter->endElement();
1306 1306
         } else {
1307
-            $objWriter->startElement('c:'.$dataType.'Ref');
1307
+            $objWriter->startElement('c:' . $dataType . 'Ref');
1308 1308
 
1309 1309
             $objWriter->startElement('c:f');
1310 1310
             $objWriter->writeRawData($plotSeriesValues->getDataSource());
1311 1311
             $objWriter->endElement();
1312 1312
 
1313
-            $objWriter->startElement('c:'.$dataType.'Cache');
1313
+            $objWriter->startElement('c:' . $dataType . 'Cache');
1314 1314
 
1315 1315
             if (($groupType != DataSeries::TYPE_PIECHART) && ($groupType != DataSeries::TYPE_PIECHART_3D) && ($groupType != DataSeries::TYPE_DONUTCHART)) {
1316 1316
                 if (($plotSeriesValues->getFormatCode() !== null) && ($plotSeriesValues->getFormatCode() !== '')) {
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Writer/Xlsx.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -140,8 +140,8 @@
 block discarded – undo
140 140
         }
141 141
 
142 142
         $hashTablesArray = ['stylesConditionalHashTable', 'fillHashTable', 'fontHashTable',
143
-                                  'bordersHashTable', 'numFmtHashTable', 'drawingHashTable',
144
-                                  'styleHashTable',
143
+                                    'bordersHashTable', 'numFmtHashTable', 'drawingHashTable',
144
+                                    'styleHashTable',
145 145
                                 ];
146 146
 
147 147
         // Set HashTable variables
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
             // Try opening the ZIP file
239 239
             if ($objZip->open($pFilename, $zipOverWrite) !== true) {
240 240
                 if ($objZip->open($pFilename, $zipCreate) !== true) {
241
-                    throw new \PhpOffice\PhpSpreadsheet\Writer\WriteException('Could not open '.$pFilename.' for writing.');
241
+                    throw new \PhpOffice\PhpSpreadsheet\Writer\WriteException('Could not open ' . $pFilename . ' for writing.');
242 242
                 }
243 243
             }
244 244
 
@@ -264,13 +264,13 @@  discard block
 block discarded – undo
264 264
                 $tmpRibbonTarget = $this->spreadSheet->getRibbonXMLData('target');
265 265
                 $objZip->addFromString($tmpRibbonTarget, $this->spreadSheet->getRibbonXMLData('data'));
266 266
                 if ($this->spreadSheet->hasRibbonBinObjects()) {
267
-                    $tmpRootPath = dirname($tmpRibbonTarget).'/';
267
+                    $tmpRootPath = dirname($tmpRibbonTarget) . '/';
268 268
                     $ribbonBinObjects = $this->spreadSheet->getRibbonBinObjects('data'); //the files to write
269 269
                     foreach ($ribbonBinObjects as $aPath => $aContent) {
270
-                        $objZip->addFromString($tmpRootPath.$aPath, $aContent);
270
+                        $objZip->addFromString($tmpRootPath . $aPath, $aContent);
271 271
                     }
272 272
                     //the rels for files
273
-                    $objZip->addFromString($tmpRootPath.'_rels/'.basename($tmpRibbonTarget).'.rels', $this->getWriterPart('RelsRibbonObjects')->writeRibbonRelationships($this->spreadSheet));
273
+                    $objZip->addFromString($tmpRootPath . '_rels/' . basename($tmpRibbonTarget) . '.rels', $this->getWriterPart('RelsRibbonObjects')->writeRibbonRelationships($this->spreadSheet));
274 274
                 }
275 275
             }
276 276
 
@@ -301,12 +301,12 @@  discard block
 block discarded – undo
301 301
             $chartCount = 0;
302 302
             // Add worksheets
303 303
             for ($i = 0; $i < $this->spreadSheet->getSheetCount(); ++$i) {
304
-                $objZip->addFromString('xl/worksheets/sheet'.($i + 1).'.xml', $this->getWriterPart('Worksheet')->writeWorksheet($this->spreadSheet->getSheet($i), $this->stringTable, $this->includeCharts));
304
+                $objZip->addFromString('xl/worksheets/sheet' . ($i + 1) . '.xml', $this->getWriterPart('Worksheet')->writeWorksheet($this->spreadSheet->getSheet($i), $this->stringTable, $this->includeCharts));
305 305
                 if ($this->includeCharts) {
306 306
                     $charts = $this->spreadSheet->getSheet($i)->getChartCollection();
307 307
                     if (count($charts) > 0) {
308 308
                         foreach ($charts as $chart) {
309
-                            $objZip->addFromString('xl/charts/chart'.($chartCount + 1).'.xml', $this->getWriterPart('Chart')->writeChart($chart, $this->preCalculateFormulas));
309
+                            $objZip->addFromString('xl/charts/chart' . ($chartCount + 1) . '.xml', $this->getWriterPart('Chart')->writeChart($chart, $this->preCalculateFormulas));
310 310
                             ++$chartCount;
311 311
                         }
312 312
                     }
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
             // Add worksheet relationships (drawings, ...)
318 318
             for ($i = 0; $i < $this->spreadSheet->getSheetCount(); ++$i) {
319 319
                 // Add relationships
320
-                $objZip->addFromString('xl/worksheets/_rels/sheet'.($i + 1).'.xml.rels', $this->getWriterPart('Rels')->writeWorksheetRelationships($this->spreadSheet->getSheet($i), ($i + 1), $this->includeCharts));
320
+                $objZip->addFromString('xl/worksheets/_rels/sheet' . ($i + 1) . '.xml.rels', $this->getWriterPart('Rels')->writeWorksheetRelationships($this->spreadSheet->getSheet($i), ($i + 1), $this->includeCharts));
321 321
 
322 322
                 $drawings = $this->spreadSheet->getSheet($i)->getDrawingCollection();
323 323
                 $drawingCount = count($drawings);
@@ -328,32 +328,32 @@  discard block
 block discarded – undo
328 328
                 // Add drawing and image relationship parts
329 329
                 if (($drawingCount > 0) || ($chartCount > 0)) {
330 330
                     // Drawing relationships
331
-                    $objZip->addFromString('xl/drawings/_rels/drawing'.($i + 1).'.xml.rels', $this->getWriterPart('Rels')->writeDrawingRelationships($this->spreadSheet->getSheet($i), $chartRef1, $this->includeCharts));
331
+                    $objZip->addFromString('xl/drawings/_rels/drawing' . ($i + 1) . '.xml.rels', $this->getWriterPart('Rels')->writeDrawingRelationships($this->spreadSheet->getSheet($i), $chartRef1, $this->includeCharts));
332 332
 
333 333
                     // Drawings
334
-                    $objZip->addFromString('xl/drawings/drawing'.($i + 1).'.xml', $this->getWriterPart('Drawing')->writeDrawings($this->spreadSheet->getSheet($i), $chartRef2, $this->includeCharts));
334
+                    $objZip->addFromString('xl/drawings/drawing' . ($i + 1) . '.xml', $this->getWriterPart('Drawing')->writeDrawings($this->spreadSheet->getSheet($i), $chartRef2, $this->includeCharts));
335 335
                 }
336 336
 
337 337
                 // Add comment relationship parts
338 338
                 if (count($this->spreadSheet->getSheet($i)->getComments()) > 0) {
339 339
                     // VML Comments
340
-                    $objZip->addFromString('xl/drawings/vmlDrawing'.($i + 1).'.vml', $this->getWriterPart('Comments')->writeVMLComments($this->spreadSheet->getSheet($i)));
340
+                    $objZip->addFromString('xl/drawings/vmlDrawing' . ($i + 1) . '.vml', $this->getWriterPart('Comments')->writeVMLComments($this->spreadSheet->getSheet($i)));
341 341
 
342 342
                     // Comments
343
-                    $objZip->addFromString('xl/comments'.($i + 1).'.xml', $this->getWriterPart('Comments')->writeComments($this->spreadSheet->getSheet($i)));
343
+                    $objZip->addFromString('xl/comments' . ($i + 1) . '.xml', $this->getWriterPart('Comments')->writeComments($this->spreadSheet->getSheet($i)));
344 344
                 }
345 345
 
346 346
                 // Add header/footer relationship parts
347 347
                 if (count($this->spreadSheet->getSheet($i)->getHeaderFooter()->getImages()) > 0) {
348 348
                     // VML Drawings
349
-                    $objZip->addFromString('xl/drawings/vmlDrawingHF'.($i + 1).'.vml', $this->getWriterPart('Drawing')->writeVMLHeaderFooterImages($this->spreadSheet->getSheet($i)));
349
+                    $objZip->addFromString('xl/drawings/vmlDrawingHF' . ($i + 1) . '.vml', $this->getWriterPart('Drawing')->writeVMLHeaderFooterImages($this->spreadSheet->getSheet($i)));
350 350
 
351 351
                     // VML Drawing relationships
352
-                    $objZip->addFromString('xl/drawings/_rels/vmlDrawingHF'.($i + 1).'.vml.rels', $this->getWriterPart('Rels')->writeHeaderFooterDrawingRelationships($this->spreadSheet->getSheet($i)));
352
+                    $objZip->addFromString('xl/drawings/_rels/vmlDrawingHF' . ($i + 1) . '.vml.rels', $this->getWriterPart('Rels')->writeHeaderFooterDrawingRelationships($this->spreadSheet->getSheet($i)));
353 353
 
354 354
                     // Media
355 355
                     foreach ($this->spreadSheet->getSheet($i)->getHeaderFooter()->getImages() as $image) {
356
-                        $objZip->addFromString('xl/media/'.$image->getIndexedFilename(), file_get_contents($image->getPath()));
356
+                        $objZip->addFromString('xl/media/' . $image->getIndexedFilename(), file_get_contents($image->getPath()));
357 357
                     }
358 358
                 }
359 359
             }
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
                         $imageContents = file_get_contents($imagePath);
378 378
                     }
379 379
 
380
-                    $objZip->addFromString('xl/media/'.str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents);
380
+                    $objZip->addFromString('xl/media/' . str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents);
381 381
                 } elseif ($this->getDrawingHashTable()->getByIndex($i) instanceof MemoryDrawing) {
382 382
                     ob_start();
383 383
                     call_user_func(
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
                     $imageContents = ob_get_contents();
388 388
                     ob_end_clean();
389 389
 
390
-                    $objZip->addFromString('xl/media/'.str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents);
390
+                    $objZip->addFromString('xl/media/' . str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents);
391 391
                 }
392 392
             }
393 393
 
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Reader/Xls.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5157,7 +5157,7 @@  discard block
 block discarded – undo
5157 5157
      * is in one piece.
5158 5158
      * Moves to next current position in data stream to start of next record different from a CONtINUE record
5159 5159
      *
5160
-     * @return array
5160
+     * @return integer|null
5161 5161
      */
5162 5162
     private function getSplicedRecordData()
5163 5163
     {
@@ -5421,7 +5421,7 @@  discard block
 block discarded – undo
5421 5421
      * @param string $formulaData Formula data
5422 5422
      * @param string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas
5423 5423
      * @throws Exception
5424
-     * @return array
5424
+     * @return string
5425 5425
      */
5426 5426
     private function getNextToken($formulaData, $baseCell = 'A1')
5427 5427
     {
@@ -6989,7 +6989,7 @@  discard block
 block discarded – undo
6989 6989
      * section 2.5.15
6990 6990
      *
6991 6991
      * @param string $subData
6992
-     * @return array
6992
+     * @return string
6993 6993
      */
6994 6994
     private function readBIFF8CellRangeAddressList($subData)
6995 6995
     {
@@ -7100,7 +7100,7 @@  discard block
 block discarded – undo
7100 7100
      * section 2.5.8
7101 7101
      *
7102 7102
      * @param string $arrayData
7103
-     * @return array
7103
+     * @return string
7104 7104
      */
7105 7105
     private static function readBIFF8ConstantArray($arrayData)
7106 7106
     {
@@ -7138,7 +7138,7 @@  discard block
 block discarded – undo
7138 7138
      * returns e.g. array('value' => '5', 'size' => 9)
7139 7139
      *
7140 7140
      * @param string $valueData
7141
-     * @return array
7141
+     * @return string
7142 7142
      */
7143 7143
     private static function readBIFF8Constant($valueData)
7144 7144
     {
Please login to merge, or discard this patch.
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
     {
425 425
         // Check if file exists
426 426
         if (!file_exists($pFilename)) {
427
-            throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.');
427
+            throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.');
428 428
         }
429 429
 
430 430
         try {
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
     {
452 452
         // Check if file exists
453 453
         if (!file_exists($pFilename)) {
454
-            throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.');
454
+            throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.');
455 455
         }
456 456
 
457 457
         $worksheetNames = [];
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
     {
509 509
         // Check if file exists
510 510
         if (!file_exists($pFilename)) {
511
-            throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.');
511
+            throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.');
512 512
         }
513 513
 
514 514
         $worksheetInfo = [];
@@ -1085,7 +1085,7 @@  discard block
 block discarded – undo
1085 1085
                     list($column, $row) = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($cell);
1086 1086
                     if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($column, $row, $this->phpSheet->getTitle())) {
1087 1087
                         $formula = $this->getFormulaFromStructure($this->sharedFormulas[$baseCell], $cell);
1088
-                        $this->phpSheet->getCell($cell)->setValueExplicit('='.$formula, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_FORMULA);
1088
+                        $this->phpSheet->getCell($cell)->setValueExplicit('=' . $formula, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_FORMULA);
1089 1089
                     }
1090 1090
                 }
1091 1091
             }
@@ -1124,7 +1124,7 @@  discard block
 block discarded – undo
1124 1124
                             $sheetName = trim($explodes[0], "'");
1125 1125
                             if (count($explodes) == 2) {
1126 1126
                                 if (strpos($explodes[1], ':') === false) {
1127
-                                    $explodes[1] = $explodes[1].':'.$explodes[1];
1127
+                                    $explodes[1] = $explodes[1] . ':' . $explodes[1];
1128 1128
                                 }
1129 1129
                                 $extractedRanges[] = str_replace('$', '', $explodes[1]); // C7:J66
1130 1130
                             }
@@ -1594,7 +1594,7 @@  discard block
 block discarded – undo
1594 1594
                 //    Concatenate this extension with the currently set comment for the cell
1595 1595
                 $comment = $this->phpSheet->getComment($cellAddress);
1596 1596
                 $commentText = $comment->getText()->getPlainText();
1597
-                $comment->setText($this->parseRichText($commentText.$noteText));
1597
+                $comment->setText($this->parseRichText($commentText . $noteText));
1598 1598
             } else {
1599 1599
                 //    Set comment for the cell
1600 1600
                 $this->phpSheet->getComment($cellAddress)->setText($this->parseRichText($noteText));
@@ -1819,7 +1819,7 @@  discard block
 block discarded – undo
1819 1819
         $salt = $key->RC4($salt_data);
1820 1820
         $hashedsalt = $key->RC4($hashedsalt_data);
1821 1821
 
1822
-        $salt .= "\x80".str_repeat("\0", 47);
1822
+        $salt .= "\x80" . str_repeat("\0", 47);
1823 1823
         $salt[56] = "\x80";
1824 1824
 
1825 1825
         $md5->reset();
@@ -2753,7 +2753,7 @@  discard block
 block discarded – undo
2753 2753
 
2754 2754
             // offset: var; size: $flen; formula data
2755 2755
             $offset = 14 + $string['size'];
2756
-            $formulaStructure = pack('v', $flen).substr($recordData, $offset);
2756
+            $formulaStructure = pack('v', $flen) . substr($recordData, $offset);
2757 2757
 
2758 2758
             try {
2759 2759
                 $formula = $this->getFormulaFromStructure($formulaStructure);
@@ -2919,7 +2919,7 @@  discard block
 block discarded – undo
2919 2919
                         // this fragment uncompressed
2920 2920
                         $newstr = '';
2921 2921
                         for ($j = 0; $j < strlen($retstr); ++$j) {
2922
-                            $newstr .= $retstr[$j].chr(0);
2922
+                            $newstr .= $retstr[$j] . chr(0);
2923 2923
                         }
2924 2924
                         $retstr = $newstr;
2925 2925
                         $len = min($charsLeft * 2, $limitpos - $pos);
@@ -3562,7 +3562,7 @@  discard block
 block discarded – undo
3562 3562
             $rknum = self::getInt4d($recordData, 6);
3563 3563
             $numValue = self::getIEEE754($rknum);
3564 3564
 
3565
-            $cell = $this->phpSheet->getCell($columnString.($row + 1));
3565
+            $cell = $this->phpSheet->getCell($columnString . ($row + 1));
3566 3566
             if (!$this->readDataOnly) {
3567 3567
                 // add style information
3568 3568
                 $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]);
@@ -3639,13 +3639,13 @@  discard block
 block discarded – undo
3639 3639
                     }
3640 3640
                 }
3641 3641
                 if ($this->readEmptyCells || trim($richText->getPlainText()) !== '') {
3642
-                    $cell = $this->phpSheet->getCell($columnString.($row + 1));
3642
+                    $cell = $this->phpSheet->getCell($columnString . ($row + 1));
3643 3643
                     $cell->setValueExplicit($richText, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
3644 3644
                     $emptyCell = false;
3645 3645
                 }
3646 3646
             } else {
3647 3647
                 if ($this->readEmptyCells || trim($this->sst[$index]['value']) !== '') {
3648
-                    $cell = $this->phpSheet->getCell($columnString.($row + 1));
3648
+                    $cell = $this->phpSheet->getCell($columnString . ($row + 1));
3649 3649
                     $cell->setValueExplicit($this->sst[$index]['value'], \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
3650 3650
                     $emptyCell = false;
3651 3651
                 }
@@ -3697,7 +3697,7 @@  discard block
 block discarded – undo
3697 3697
 
3698 3698
                 // offset: var; size: 4; RK value
3699 3699
                 $numValue = self::getIEEE754(self::getInt4d($recordData, $offset + 2));
3700
-                $cell = $this->phpSheet->getCell($columnString.($row + 1));
3700
+                $cell = $this->phpSheet->getCell($columnString . ($row + 1));
3701 3701
                 if (!$this->readDataOnly) {
3702 3702
                     // add style
3703 3703
                     $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]);
@@ -3741,7 +3741,7 @@  discard block
 block discarded – undo
3741 3741
 
3742 3742
             $numValue = self::extractNumber(substr($recordData, 6, 8));
3743 3743
 
3744
-            $cell = $this->phpSheet->getCell($columnString.($row + 1));
3744
+            $cell = $this->phpSheet->getCell($columnString . ($row + 1));
3745 3745
             if (!$this->readDataOnly) {
3746 3746
                 // add cell style
3747 3747
                 $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]);
@@ -3797,14 +3797,14 @@  discard block
 block discarded – undo
3797 3797
             // get the base cell, grab tExp token
3798 3798
             $baseRow = self::getInt2d($formulaStructure, 3);
3799 3799
             $baseCol = self::getInt2d($formulaStructure, 5);
3800
-            $this->_baseCell = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol).($baseRow + 1);
3800
+            $this->_baseCell = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol) . ($baseRow + 1);
3801 3801
         }
3802 3802
 
3803 3803
         // Read cell?
3804 3804
         if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) {
3805 3805
             if ($isPartOfSharedFormula) {
3806 3806
                 // formula is added to this cell after the sheet has been read
3807
-                $this->sharedFormulaParts[$columnString.($row + 1)] = $this->_baseCell;
3807
+                $this->sharedFormulaParts[$columnString . ($row + 1)] = $this->_baseCell;
3808 3808
             }
3809 3809
 
3810 3810
             // offset: 16: size: 4; not used
@@ -3849,7 +3849,7 @@  discard block
 block discarded – undo
3849 3849
                 $value = self::extractNumber(substr($recordData, 6, 8));
3850 3850
             }
3851 3851
 
3852
-            $cell = $this->phpSheet->getCell($columnString.($row + 1));
3852
+            $cell = $this->phpSheet->getCell($columnString . ($row + 1));
3853 3853
             if (!$this->readDataOnly) {
3854 3854
                 // add cell style
3855 3855
                 $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]);
@@ -3864,7 +3864,7 @@  discard block
 block discarded – undo
3864 3864
                         throw new Exception('Not BIFF8. Can only read BIFF8 formulas');
3865 3865
                     }
3866 3866
                     $formula = $this->getFormulaFromStructure($formulaStructure); // get formula in human language
3867
-                    $cell->setValueExplicit('='.$formula, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_FORMULA);
3867
+                    $cell->setValueExplicit('=' . $formula, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_FORMULA);
3868 3868
                 } catch (\PhpOffice\PhpSpreadsheet\Exception $e) {
3869 3869
                     $cell->setValueExplicit($value, $dataType);
3870 3870
                 }
@@ -3970,7 +3970,7 @@  discard block
 block discarded – undo
3970 3970
             // offset: 7; size: 1; 0=boolean; 1=error
3971 3971
             $isError = ord($recordData{7});
3972 3972
 
3973
-            $cell = $this->phpSheet->getCell($columnString.($row + 1));
3973
+            $cell = $this->phpSheet->getCell($columnString . ($row + 1));
3974 3974
             switch ($isError) {
3975 3975
                 case 0: // boolean
3976 3976
                     $value = (bool) $boolErr;
@@ -4024,7 +4024,7 @@  discard block
 block discarded – undo
4024 4024
                 // Read cell?
4025 4025
                 if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) {
4026 4026
                     $xfIndex = self::getInt2d($recordData, 4 + 2 * $i);
4027
-                    $this->phpSheet->getCell($columnString.($row + 1))->setXfIndex($this->mapCellXfIndex[$xfIndex]);
4027
+                    $this->phpSheet->getCell($columnString . ($row + 1))->setXfIndex($this->mapCellXfIndex[$xfIndex]);
4028 4028
                 }
4029 4029
             }
4030 4030
         }
@@ -4072,7 +4072,7 @@  discard block
 block discarded – undo
4072 4072
                 $value = $string['value'];
4073 4073
             }
4074 4074
             if ($this->readEmptyCells || trim($value) !== '') {
4075
-                $cell = $this->phpSheet->getCell($columnString.($row + 1));
4075
+                $cell = $this->phpSheet->getCell($columnString . ($row + 1));
4076 4076
                 $cell->setValueExplicit($value, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
4077 4077
 
4078 4078
                 if (!$this->readDataOnly) {
@@ -4108,7 +4108,7 @@  discard block
 block discarded – undo
4108 4108
 
4109 4109
             // add style information
4110 4110
             if (!$this->readDataOnly && $this->readEmptyCells) {
4111
-                $this->phpSheet->getCell($columnString.($row + 1))->setXfIndex($this->mapCellXfIndex[$xfIndex]);
4111
+                $this->phpSheet->getCell($columnString . ($row + 1))->setXfIndex($this->mapCellXfIndex[$xfIndex]);
4112 4112
             }
4113 4113
         }
4114 4114
     }
@@ -4316,7 +4316,7 @@  discard block
 block discarded – undo
4316 4316
 
4317 4317
             if ($this->frozen) {
4318 4318
                 // frozen panes
4319
-                $this->phpSheet->freezePane(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($px).($py + 1));
4319
+                $this->phpSheet->freezePane(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($px) . ($py + 1));
4320 4320
             } else {
4321 4321
                 // unfrozen panes; split windows; not supported by PhpSpreadsheet core
4322 4322
             }
@@ -4740,7 +4740,7 @@  discard block
 block discarded – undo
4740 4740
 
4741 4741
         // offset: var; size: $sz1; formula data for first condition (without size field)
4742 4742
         $formula1 = substr($recordData, $offset, $sz1);
4743
-        $formula1 = pack('v', $sz1).$formula1; // prepend the length
4743
+        $formula1 = pack('v', $sz1) . $formula1; // prepend the length
4744 4744
         try {
4745 4745
             $formula1 = $this->getFormulaFromStructure($formula1);
4746 4746
 
@@ -4762,7 +4762,7 @@  discard block
 block discarded – undo
4762 4762
 
4763 4763
         // offset: var; size: $sz2; formula data for second condition (without size field)
4764 4764
         $formula2 = substr($recordData, $offset, $sz2);
4765
-        $formula2 = pack('v', $sz2).$formula2; // prepend the length
4765
+        $formula2 = pack('v', $sz2) . $formula2; // prepend the length
4766 4766
         try {
4767 4767
             $formula2 = $this->getFormulaFromStructure($formula2);
4768 4768
         } catch (\PhpOffice\PhpSpreadsheet\Exception $e) {
@@ -5304,7 +5304,7 @@  discard block
 block discarded – undo
5304 5304
                             $ops[] = array_pop($formulaStrings);
5305 5305
                         }
5306 5306
                         $ops = array_reverse($ops);
5307
-                        $formulaStrings[] = "$space1$space0{$token['data']['function']}(".implode(',', $ops).')';
5307
+                        $formulaStrings[] = "$space1$space0{$token['data']['function']}(" . implode(',', $ops) . ')';
5308 5308
                         unset($space0, $space1);
5309 5309
                     } else {
5310 5310
                         // add-in function
@@ -5314,7 +5314,7 @@  discard block
 block discarded – undo
5314 5314
                         }
5315 5315
                         $ops = array_reverse($ops);
5316 5316
                         $function = array_pop($formulaStrings);
5317
-                        $formulaStrings[] = "$space1$space0$function(".implode(',', $ops).')';
5317
+                        $formulaStrings[] = "$space1$space0$function(" . implode(',', $ops) . ')';
5318 5318
                         unset($space0, $space1);
5319 5319
                     }
5320 5320
                     break;
@@ -5325,7 +5325,7 @@  discard block
 block discarded – undo
5325 5325
                     break;
5326 5326
                 case 'tArray': // array constant
5327 5327
                     $constantArray = self::readBIFF8ConstantArray($additionalData);
5328
-                    $formulaStrings[] = $space1.$space0.$constantArray['value'];
5328
+                    $formulaStrings[] = $space1 . $space0 . $constantArray['value'];
5329 5329
                     $additionalData = substr($additionalData, $constantArray['size']); // bite of chunk of additional data
5330 5330
                     unset($space0, $space1);
5331 5331
                     break;
@@ -6639,7 +6639,7 @@  discard block
 block discarded – undo
6639 6639
                 break;
6640 6640
             // Unknown cases    // don't know how to deal with
6641 6641
             default:
6642
-                throw new Exception('Unrecognized token '.sprintf('%02X', $id).' in formula');
6642
+                throw new Exception('Unrecognized token ' . sprintf('%02X', $id) . ' in formula');
6643 6643
                 break;
6644 6644
         }
6645 6645
 
@@ -6670,14 +6670,14 @@  discard block
 block discarded – undo
6670 6670
 
6671 6671
         // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index)
6672 6672
         if (!(0x4000 & self::getInt2d($cellAddressStructure, 2))) {
6673
-            $column = '$'.$column;
6673
+            $column = '$' . $column;
6674 6674
         }
6675 6675
         // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index)
6676 6676
         if (!(0x8000 & self::getInt2d($cellAddressStructure, 2))) {
6677
-            $row = '$'.$row;
6677
+            $row = '$' . $row;
6678 6678
         }
6679 6679
 
6680
-        return $column.$row;
6680
+        return $column . $row;
6681 6681
     }
6682 6682
 
6683 6683
     /**
@@ -6706,7 +6706,7 @@  discard block
 block discarded – undo
6706 6706
         // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index)
6707 6707
         if (!(0x4000 & self::getInt2d($cellAddressStructure, 2))) {
6708 6708
             $column = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($colIndex);
6709
-            $column = '$'.$column;
6709
+            $column = '$' . $column;
6710 6710
         } else {
6711 6711
             $colIndex = ($colIndex <= 127) ? $colIndex : $colIndex - 256;
6712 6712
             $column = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($baseCol + $colIndex);
@@ -6714,13 +6714,13 @@  discard block
 block discarded – undo
6714 6714
 
6715 6715
         // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index)
6716 6716
         if (!(0x8000 & self::getInt2d($cellAddressStructure, 2))) {
6717
-            $row = '$'.$row;
6717
+            $row = '$' . $row;
6718 6718
         } else {
6719 6719
             $rowIndex = ($rowIndex <= 32767) ? $rowIndex : $rowIndex - 65536;
6720 6720
             $row = $baseRow + $rowIndex;
6721 6721
         }
6722 6722
 
6723
-        return $column.$row;
6723
+        return $column . $row;
6724 6724
     }
6725 6725
 
6726 6726
     /**
@@ -6832,12 +6832,12 @@  discard block
 block discarded – undo
6832 6832
 
6833 6833
         // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index)
6834 6834
         if (!(0x4000 & self::getInt2d($subData, 4))) {
6835
-            $fc = '$'.$fc;
6835
+            $fc = '$' . $fc;
6836 6836
         }
6837 6837
 
6838 6838
         // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index)
6839 6839
         if (!(0x8000 & self::getInt2d($subData, 4))) {
6840
-            $fr = '$'.$fr;
6840
+            $fr = '$' . $fr;
6841 6841
         }
6842 6842
 
6843 6843
         // offset: 6; size: 2; index to last column or column offset + relative flags
@@ -6847,12 +6847,12 @@  discard block
 block discarded – undo
6847 6847
 
6848 6848
         // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index)
6849 6849
         if (!(0x4000 & self::getInt2d($subData, 6))) {
6850
-            $lc = '$'.$lc;
6850
+            $lc = '$' . $lc;
6851 6851
         }
6852 6852
 
6853 6853
         // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index)
6854 6854
         if (!(0x8000 & self::getInt2d($subData, 6))) {
6855
-            $lr = '$'.$lr;
6855
+            $lr = '$' . $lr;
6856 6856
         }
6857 6857
 
6858 6858
         return "$fc$fr:$lc$lr";
@@ -6891,7 +6891,7 @@  discard block
 block discarded – undo
6891 6891
         if (!(0x4000 & self::getInt2d($subData, 4))) {
6892 6892
             // absolute column index
6893 6893
             $fc = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($fcIndex);
6894
-            $fc = '$'.$fc;
6894
+            $fc = '$' . $fc;
6895 6895
         } else {
6896 6896
             // column offset
6897 6897
             $fcIndex = ($fcIndex <= 127) ? $fcIndex : $fcIndex - 256;
@@ -6902,7 +6902,7 @@  discard block
 block discarded – undo
6902 6902
         if (!(0x8000 & self::getInt2d($subData, 4))) {
6903 6903
             // absolute row index
6904 6904
             $fr = $frIndex + 1;
6905
-            $fr = '$'.$fr;
6905
+            $fr = '$' . $fr;
6906 6906
         } else {
6907 6907
             // row offset
6908 6908
             $frIndex = ($frIndex <= 32767) ? $frIndex : $frIndex - 65536;
@@ -6920,7 +6920,7 @@  discard block
 block discarded – undo
6920 6920
         if (!(0x4000 & self::getInt2d($subData, 6))) {
6921 6921
             // absolute column index
6922 6922
             $lc = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($lcIndex);
6923
-            $lc = '$'.$lc;
6923
+            $lc = '$' . $lc;
6924 6924
         } else {
6925 6925
             // column offset
6926 6926
             $lcIndex = ($lcIndex <= 127) ? $lcIndex : $lcIndex - 256;
@@ -6931,7 +6931,7 @@  discard block
 block discarded – undo
6931 6931
         if (!(0x8000 & self::getInt2d($subData, 6))) {
6932 6932
             // absolute row index
6933 6933
             $lr = $lrIndex + 1;
6934
-            $lr = '$'.$lr;
6934
+            $lr = '$' . $lr;
6935 6935
         } else {
6936 6936
             // row offset
6937 6937
             $lrIndex = ($lrIndex <= 32767) ? $lrIndex : $lrIndex - 65536;
@@ -7086,7 +7086,7 @@  discard block
 block discarded – undo
7086 7086
             }
7087 7087
             $matrixChunks[] = implode(',', $items); // looks like e.g. '1,"hello"'
7088 7088
         }
7089
-        $matrix = '{'.implode(';', $matrixChunks).'}';
7089
+        $matrix = '{' . implode(';', $matrixChunks) . '}';
7090 7090
 
7091 7091
         return [
7092 7092
             'value' => $matrix,
@@ -7121,7 +7121,7 @@  discard block
 block discarded – undo
7121 7121
             case 0x02: // string value
7122 7122
                 // offset: 1; size: var; Unicode string, 16-bit string length
7123 7123
                 $string = self::readUnicodeStringLong(substr($valueData, 1));
7124
-                $value = '"'.$string['value'].'"';
7124
+                $value = '"' . $string['value'] . '"';
7125 7125
                 $size = 1 + $string['size'];
7126 7126
                 break;
7127 7127
             case 0x04: // boolean
@@ -7309,7 +7309,7 @@  discard block
 block discarded – undo
7309 7309
      */
7310 7310
     private static function UTF8toExcelDoubleQuoted($value)
7311 7311
     {
7312
-        return '"'.str_replace('"', '""', $value).'"';
7312
+        return '"' . str_replace('"', '""', $value) . '"';
7313 7313
     }
7314 7314
 
7315 7315
     /**
@@ -7400,7 +7400,7 @@  discard block
 block discarded – undo
7400 7400
         $uncompressedString = '';
7401 7401
         $strLen = strlen($string);
7402 7402
         for ($i = 0; $i < $strLen; ++$i) {
7403
-            $uncompressedString .= $string[$i]."\0";
7403
+            $uncompressedString .= $string[$i] . "\0";
7404 7404
         }
7405 7405
 
7406 7406
         return $uncompressedString;
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Reader/Xls/MD5.php 2 patches
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -190,6 +190,11 @@
 block discarded – undo
190 190
         return ($Y ^ ($X | (~ $Z))) ; // Y XOR (X OR NOT Z)
191 191
     }
192 192
 
193
+    /**
194
+     * @param string[] $func
195
+     * @param integer $s
196
+     * @param integer $t
197
+     */
193 198
     private static function step($func, &$A, $B, $C, $D, $M, $s, $t)
194 199
     {
195 200
         $A = ($A + call_user_func($func, $B, $C, $D) + $M + $t) & 0xffffffff;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -200,6 +200,6 @@
 block discarded – undo
200 200
     {
201 201
         $binary = str_pad(decbin($decimal), 32, '0', STR_PAD_LEFT);
202 202
 
203
-        return bindec(substr($binary, $bits).substr($binary, 0, $bits));
203
+        return bindec(substr($binary, $bits) . substr($binary, 0, $bits));
204 204
     }
205 205
 }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Reader/HTML.php 2 patches
Doc Comments   +13 added lines patch added patch discarded remove patch
@@ -168,16 +168,25 @@  discard block
 block discarded – undo
168 168
         return fread($this->fileHandle, $blockSize);
169 169
     }
170 170
 
171
+    /**
172
+     * @param string $data
173
+     */
171 174
     private static function startsWithTag($data)
172 175
     {
173 176
         return '<' === substr(trim($data), 0, 1);
174 177
     }
175 178
 
179
+    /**
180
+     * @param string $data
181
+     */
176 182
     private static function endsWithTag($data)
177 183
     {
178 184
         return '>' === substr(trim($data), -1, 1);
179 185
     }
180 186
 
187
+    /**
188
+     * @param string $data
189
+     */
181 190
     private static function containsTags($data)
182 191
     {
183 192
         return strlen($data) !== strlen(strip_tags($data));
@@ -249,6 +258,10 @@  discard block
 block discarded – undo
249 258
         return array_pop($this->nestedColumn);
250 259
     }
251 260
 
261
+    /**
262
+     * @param \PhpOffice\PhpSpreadsheet\Worksheet $sheet
263
+     * @param integer $row
264
+     */
252 265
     protected function flushCell($sheet, $column, $row, &$cellContent)
253 266
     {
254 267
         if (is_string($cellContent)) {
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -265,13 +265,13 @@  discard block
 block discarded – undo
265 265
                 //    Only actually write it if there's content in the string
266 266
                 //    Write to worksheet to be done here...
267 267
                 //    ... we return the cell so we can mess about with styles more easily
268
-                $sheet->setCellValue($column.$row, $cellContent, true);
268
+                $sheet->setCellValue($column . $row, $cellContent, true);
269 269
                 $this->dataArray[$row][$column] = $cellContent;
270 270
             }
271 271
         } else {
272 272
             //    We have a Rich Text run
273 273
             //    TODO
274
-            $this->dataArray[$row][$column] = 'RICH TEXT: '.$cellContent;
274
+            $this->dataArray[$row][$column] = 'RICH TEXT: ' . $cellContent;
275 275
         }
276 276
         $cellContent = (string) '';
277 277
     }
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
                         $this->flushCell($sheet, $column, $row, $cellContent);
338 338
                         ++$row;
339 339
                         if (isset($this->formats[$child->nodeName])) {
340
-                            $sheet->getStyle($column.$row)->applyFromArray($this->formats[$child->nodeName]);
340
+                            $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]);
341 341
                         } else {
342 342
                             $cellContent = '----------';
343 343
                             $this->flushCell($sheet, $column, $row, $cellContent);
@@ -358,9 +358,9 @@  discard block
 block discarded – undo
358 358
                         foreach ($attributeArray as $attributeName => $attributeValue) {
359 359
                             switch ($attributeName) {
360 360
                                 case 'href':
361
-                                    $sheet->getCell($column.$row)->getHyperlink()->setUrl($attributeValue);
361
+                                    $sheet->getCell($column . $row)->getHyperlink()->setUrl($attributeValue);
362 362
                                     if (isset($this->formats[$child->nodeName])) {
363
-                                        $sheet->getStyle($column.$row)->applyFromArray($this->formats[$child->nodeName]);
363
+                                        $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]);
364 364
                                     }
365 365
                                     break;
366 366
                             }
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
                             $this->flushCell($sheet, $column, $row, $cellContent);
391 391
 
392 392
                             if (isset($this->formats[$child->nodeName])) {
393
-                                $sheet->getStyle($column.$row)->applyFromArray($this->formats[$child->nodeName]);
393
+                                $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]);
394 394
                             }
395 395
 
396 396
                             ++$row;
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
                     case 'td':
441 441
                         $this->processDomElement($child, $sheet, $row, $column, $cellContent);
442 442
 
443
-                        while (isset($this->rowspan[$column.$row])) {
443
+                        while (isset($this->rowspan[$column . $row])) {
444 444
                             ++$column;
445 445
                         }
446 446
 
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
                             for ($i = 0; $i < $attributeArray['colspan'] - 1; ++$i) {
453 453
                                 ++$columnTo;
454 454
                             }
455
-                            $range = $column.$row.':'.$columnTo.($row + $attributeArray['rowspan'] - 1);
455
+                            $range = $column . $row . ':' . $columnTo . ($row + $attributeArray['rowspan'] - 1);
456 456
                             foreach (\PhpOffice\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($range) as $value) {
457 457
                                 $this->rowspan[$value] = true;
458 458
                             }
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
                             $column = $columnTo;
461 461
                         } elseif (isset($attributeArray['rowspan'])) {
462 462
                             //create merging rowspan
463
-                            $range = $column.$row.':'.$column.($row + $attributeArray['rowspan'] - 1);
463
+                            $range = $column . $row . ':' . $column . ($row + $attributeArray['rowspan'] - 1);
464 464
                             foreach (\PhpOffice\PhpSpreadsheet\Cell::extractAllCellReferencesInRange($range) as $value) {
465 465
                                 $this->rowspan[$value] = true;
466 466
                             }
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
                             for ($i = 0; $i < $attributeArray['colspan'] - 1; ++$i) {
472 472
                                 ++$columnTo;
473 473
                             }
474
-                            $sheet->mergeCells($column.$row.':'.$columnTo.$row);
474
+                            $sheet->mergeCells($column . $row . ':' . $columnTo . $row);
475 475
                             $column = $columnTo;
476 476
                         }
477 477
                         ++$column;
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
     {
505 505
         // Validate
506 506
         if (!$this->canRead($pFilename)) {
507
-            throw new Exception($pFilename.' is an Invalid HTML file.');
507
+            throw new Exception($pFilename . ' is an Invalid HTML file.');
508 508
         }
509 509
 
510 510
         // Create new sheet
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
         //    Reload the HTML file into the DOM object
519 519
         $loaded = $dom->loadHTML(mb_convert_encoding($this->securityScanFile($pFilename), 'HTML-ENTITIES', 'UTF-8'));
520 520
         if ($loaded === false) {
521
-            throw new Exception('Failed to load '.$pFilename.' as a DOM Document');
521
+            throw new Exception('Failed to load ' . $pFilename . ' as a DOM Document');
522 522
         }
523 523
 
524 524
         //    Discard white space
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
      */
567 567
     public function securityScan($xml)
568 568
     {
569
-        $pattern = '/\\0?'.implode('\\0?', str_split('<!ENTITY')).'\\0?/';
569
+        $pattern = '/\\0?' . implode('\\0?', str_split('<!ENTITY')) . '\\0?/';
570 570
         if (preg_match($pattern, $xml)) {
571 571
             throw new Exception('Detected use of ENTITY in XML, spreadsheet file load() aborted to prevent XXE/XEE attacks');
572 572
         }
Please login to merge, or discard this patch.
docs/Examples/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@
 block discarded – undo
34 34
             $h1Text = $out[1];
35 35
             $h2Text = (preg_match($h2Pattern, $fileData, $out)) ? $out[1] : '';
36 36
 
37
-            echo '<a href="',$exampleFile,'">',$h1Text,'</a><br />';
37
+            echo '<a href="', $exampleFile, '">', $h1Text, '</a><br />';
38 38
             if (($h2Text > '') &&
39 39
                 (pathinfo($exampleType, PATHINFO_BASENAME) != 'Calculations')) {
40
-                echo $h2Text,'<br />';
40
+                echo $h2Text, '<br />';
41 41
             }
42 42
         }
43 43
     }
Please login to merge, or discard this patch.
docs/Examples/Reading WorkBook Data/exampleWorkBookReader03.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 echo '<b>Custom Properties: </b><br />';
42 42
 /*  Loop through the list of custom properties  **/
43 43
 foreach ($customPropertyList as $customPropertyName) {
44
-    echo '<b>',$customPropertyName,': </b>';
44
+    echo '<b>', $customPropertyName, ': </b>';
45 45
     /*  Retrieve the property value  **/
46 46
     $propertyValue = $objPHPExcel->getProperties()->getCustomPropertyValue($customPropertyName);
47 47
     /*  Retrieve the property type  **/
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             break;
69 69
     }
70 70
 
71
-    echo $propertyValue,' (',$propertyType,')<br />';
71
+    echo $propertyValue, ' (', $propertyType, ')<br />';
72 72
 }
73 73
 
74 74
 ?>
Please login to merge, or discard this patch.