Completed
Branch develop (b42baf)
by Adrien
11:23
created
Examples/33chartcreate-radar.php 2 patches
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -43,21 +43,21 @@  discard block
 block discarded – undo
43 43
 $objPHPExcel = new \PHPExcel\Spreadsheet();
44 44
 $objWorksheet = $objPHPExcel->getActiveSheet();
45 45
 $objWorksheet->fromArray(
46
-	array(
47
-		array('',	2010,	2011,	2012),
48
-		array('Jan',   47,   45,		71),
49
-		array('Feb',   56,   73,		86),
50
-		array('Mar',   52,   61,		69),
51
-		array('Apr',   40,   52,		60),
52
-		array('May',   42,   55,		71),
53
-		array('Jun',   58,   63,		76),
54
-		array('Jul',   53,   61,		89),
55
-		array('Aug',   46,   69,		85),
56
-		array('Sep',   62,   75,		81),
57
-		array('Oct',   51,   70,		96),
58
-		array('Nov',   55,   66,		89),
59
-		array('Dec',   68,   62,		0),
60
-	)
46
+    array(
47
+        array('',	2010,	2011,	2012),
48
+        array('Jan',   47,   45,		71),
49
+        array('Feb',   56,   73,		86),
50
+        array('Mar',   52,   61,		69),
51
+        array('Apr',   40,   52,		60),
52
+        array('May',   42,   55,		71),
53
+        array('Jun',   58,   63,		76),
54
+        array('Jul',   53,   61,		89),
55
+        array('Aug',   46,   69,		85),
56
+        array('Sep',   62,   75,		81),
57
+        array('Oct',   51,   70,		96),
58
+        array('Nov',   55,   66,		89),
59
+        array('Dec',   68,   62,		0),
60
+    )
61 61
 );
62 62
 
63 63
 
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
 //		Data values
70 70
 //		Data Marker
71 71
 $dataSeriesLabels = array(
72
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	2011
73
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1),	//	2012
72
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	2011
73
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1),	//	2012
74 74
 );
75 75
 //	Set the X-Axis Labels
76 76
 //		Datatype
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
 //		Data values
81 81
 //		Data Marker
82 82
 $xAxisTickValues = array(
83
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', NULL, 12),	//	Jan to Dec
84
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', NULL, 12),	//	Jan to Dec
83
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', NULL, 12),	//	Jan to Dec
84
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', NULL, 12),	//	Jan to Dec
85 85
 );
86 86
 //	Set the Data values for each data series we want to plot
87 87
 //		Datatype
@@ -91,21 +91,21 @@  discard block
 block discarded – undo
91 91
 //		Data values
92 92
 //		Data Marker
93 93
 $dataSeriesValues = array(
94
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$13', NULL, 12),
95
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$13', NULL, 12),
94
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$13', NULL, 12),
95
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$13', NULL, 12),
96 96
 );
97 97
 
98 98
 //	Build the dataseries
99 99
 $series = new \PHPExcel\Chart\DataSeries(
100
-	\PHPExcel\Chart\DataSeries::TYPE_RADARCHART,	// plotType
101
-	NULL,											// plotGrouping (Radar charts don't have any grouping)
102
-	range(0, count($dataSeriesValues)-1),			// plotOrder
103
-	$dataSeriesLabels,								// plotLabel
104
-	$xAxisTickValues,								// plotCategory
105
-	$dataSeriesValues,								// plotValues
100
+    \PHPExcel\Chart\DataSeries::TYPE_RADARCHART,	// plotType
101
+    NULL,											// plotGrouping (Radar charts don't have any grouping)
102
+    range(0, count($dataSeriesValues)-1),			// plotOrder
103
+    $dataSeriesLabels,								// plotLabel
104
+    $xAxisTickValues,								// plotCategory
105
+    $dataSeriesValues,								// plotValues
106 106
     NULL,                                           // plotDirection
107
-	NULL,											// smooth line
108
-	\PHPExcel\Chart\DataSeries::STYLE_MARKER		// plotStyle
107
+    NULL,											// smooth line
108
+    \PHPExcel\Chart\DataSeries::STYLE_MARKER		// plotStyle
109 109
 );
110 110
 
111 111
 //	Set up a layout object for the Pie chart
@@ -121,14 +121,14 @@  discard block
 block discarded – undo
121 121
 
122 122
 //	Create the chart
123 123
 $chart = new \PHPExcel\Chart(
124
-	'chart1',		// name
125
-	$title,			// title
126
-	$legend,		// legend
127
-	$plotArea,		// plotArea
128
-	true,			// plotVisibleOnly
129
-	0,				// displayBlanksAs
130
-	NULL,			// xAxisLabel
131
-	NULL			// yAxisLabel		- Radar charts don't have a Y-Axis
124
+    'chart1',		// name
125
+    $title,			// title
126
+    $legend,		// legend
127
+    $plotArea,		// plotArea
128
+    true,			// plotVisibleOnly
129
+    0,				// displayBlanksAs
130
+    NULL,			// xAxisLabel
131
+    NULL			// yAxisLabel		- Radar charts don't have a Y-Axis
132 132
 );
133 133
 
134 134
 //	Set the position where the chart should appear in the worksheet
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 ini_set('display_startup_errors', TRUE);
7 7
 date_default_timezone_set('Europe/London');
8 8
 
9
-define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
9
+define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
10 10
 
11 11
 date_default_timezone_set('Europe/London');
12 12
 
@@ -44,19 +44,19 @@  discard block
 block discarded – undo
44 44
 $objWorksheet = $objPHPExcel->getActiveSheet();
45 45
 $objWorksheet->fromArray(
46 46
 	array(
47
-		array('',	2010,	2011,	2012),
48
-		array('Jan',   47,   45,		71),
49
-		array('Feb',   56,   73,		86),
50
-		array('Mar',   52,   61,		69),
51
-		array('Apr',   40,   52,		60),
52
-		array('May',   42,   55,		71),
53
-		array('Jun',   58,   63,		76),
54
-		array('Jul',   53,   61,		89),
55
-		array('Aug',   46,   69,		85),
56
-		array('Sep',   62,   75,		81),
57
-		array('Oct',   51,   70,		96),
58
-		array('Nov',   55,   66,		89),
59
-		array('Dec',   68,   62,		0),
47
+		array('', 2010, 2011, 2012),
48
+		array('Jan', 47, 45, 71),
49
+		array('Feb', 56, 73, 86),
50
+		array('Mar', 52, 61, 69),
51
+		array('Apr', 40, 52, 60),
52
+		array('May', 42, 55, 71),
53
+		array('Jun', 58, 63, 76),
54
+		array('Jul', 53, 61, 89),
55
+		array('Aug', 46, 69, 85),
56
+		array('Sep', 62, 75, 81),
57
+		array('Oct', 51, 70, 96),
58
+		array('Nov', 55, 66, 89),
59
+		array('Dec', 68, 62, 0),
60 60
 	)
61 61
 );
62 62
 
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
 //		Data values
70 70
 //		Data Marker
71 71
 $dataSeriesLabels = array(
72
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	2011
73
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1),	//	2012
72
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1), //	2011
73
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1), //	2012
74 74
 );
75 75
 //	Set the X-Axis Labels
76 76
 //		Datatype
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
 //		Data values
81 81
 //		Data Marker
82 82
 $xAxisTickValues = array(
83
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', NULL, 12),	//	Jan to Dec
84
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', NULL, 12),	//	Jan to Dec
83
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', NULL, 12), //	Jan to Dec
84
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', NULL, 12), //	Jan to Dec
85 85
 );
86 86
 //	Set the Data values for each data series we want to plot
87 87
 //		Datatype
@@ -97,14 +97,14 @@  discard block
 block discarded – undo
97 97
 
98 98
 //	Build the dataseries
99 99
 $series = new \PHPExcel\Chart\DataSeries(
100
-	\PHPExcel\Chart\DataSeries::TYPE_RADARCHART,	// plotType
101
-	NULL,											// plotGrouping (Radar charts don't have any grouping)
102
-	range(0, count($dataSeriesValues)-1),			// plotOrder
103
-	$dataSeriesLabels,								// plotLabel
104
-	$xAxisTickValues,								// plotCategory
105
-	$dataSeriesValues,								// plotValues
106
-    NULL,                                           // plotDirection
107
-	NULL,											// smooth line
100
+	\PHPExcel\Chart\DataSeries::TYPE_RADARCHART, // plotType
101
+	NULL, // plotGrouping (Radar charts don't have any grouping)
102
+	range(0, count($dataSeriesValues) - 1), // plotOrder
103
+	$dataSeriesLabels, // plotLabel
104
+	$xAxisTickValues, // plotCategory
105
+	$dataSeriesValues, // plotValues
106
+    NULL, // plotDirection
107
+	NULL, // smooth line
108 108
 	\PHPExcel\Chart\DataSeries::STYLE_MARKER		// plotStyle
109 109
 );
110 110
 
@@ -121,13 +121,13 @@  discard block
 block discarded – undo
121 121
 
122 122
 //	Create the chart
123 123
 $chart = new \PHPExcel\Chart(
124
-	'chart1',		// name
125
-	$title,			// title
126
-	$legend,		// legend
127
-	$plotArea,		// plotArea
128
-	true,			// plotVisibleOnly
129
-	0,				// displayBlanksAs
130
-	NULL,			// xAxisLabel
124
+	'chart1', // name
125
+	$title, // title
126
+	$legend, // legend
127
+	$plotArea, // plotArea
128
+	true, // plotVisibleOnly
129
+	0, // displayBlanksAs
130
+	NULL, // xAxisLabel
131 131
 	NULL			// yAxisLabel		- Radar charts don't have a Y-Axis
132 132
 );
133 133
 
@@ -140,16 +140,16 @@  discard block
 block discarded – undo
140 140
 
141 141
 
142 142
 // Save Excel 2007 file
143
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
143
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
144 144
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
145 145
 $objWriter->setIncludeCharts(TRUE);
146 146
 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
147
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
147
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
148 148
 
149 149
 
150 150
 // Echo memory peak usage
151
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
151
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
152 152
 
153 153
 // Echo done
154
-echo date('H:i:s') , " Done writing file" , EOL;
155
-echo 'File has been created in ' , getcwd() , EOL;
154
+echo date('H:i:s'), " Done writing file", EOL;
155
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Chart/Renderer/JpGraph.php 1 patch
Doc Comments   +62 added lines patch added patch discarded remove patch
@@ -62,6 +62,9 @@  discard block
 block discarded – undo
62 62
     private static $plotMark = 0;
63 63
 
64 64
 
65
+    /**
66
+     * @param string $markerID
67
+     */
65 68
     private function formatPointMarker($seriesPlot, $markerID)
66 69
     {
67 70
         $plotMarkKeys = array_keys(self::$markSet);
@@ -90,6 +93,9 @@  discard block
 block discarded – undo
90 93
     }
91 94
 
92 95
 
96
+    /**
97
+     * @param integer $labelCount
98
+     */
93 99
     private function formatDataSetLabels($groupID, $datasetLabels, $labelCount, $rotation = '')
94 100
     {
95 101
         $datasetLabelFormatCode = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getFormatCode();
@@ -120,6 +126,9 @@  discard block
 block discarded – undo
120 126
     }
121 127
 
122 128
 
129
+    /**
130
+     * @param integer $seriesCount
131
+     */
123 132
     private function percentageSumCalculation($groupID, $seriesCount)
124 133
     {
125 134
         //    Adjust our values to a percentage value across all series in the group
@@ -152,6 +161,9 @@  discard block
 block discarded – undo
152 161
     }
153 162
 
154 163
 
164
+    /**
165
+     * @param \PhpSpreadsheet\Chart\Title $captionElement
166
+     */
155 167
     private function getCaption($captionElement)
156 168
     {
157 169
         //    Read any caption
@@ -264,6 +276,9 @@  discard block
 block discarded – undo
264 276
     }
265 277
 
266 278
 
279
+    /**
280
+     * @param integer $groupID
281
+     */
267 282
     private function renderPlotLine($groupID, $filled = false, $combination = false, $dimensions = '2d')
268 283
     {
269 284
         $grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
@@ -328,6 +343,9 @@  discard block
 block discarded – undo
328 343
     }
329 344
 
330 345
 
346
+    /**
347
+     * @param integer $groupID
348
+     */
331 349
     private function renderPlotBar($groupID, $dimensions = '2d')
332 350
     {
333 351
         $rotation = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotDirection();
@@ -414,6 +432,10 @@  discard block
 block discarded – undo
414 432
     }
415 433
 
416 434
 
435
+    /**
436
+     * @param integer $groupID
437
+     * @param boolean $bubble
438
+     */
417 439
     private function renderPlotScatter($groupID, $bubble)
418 440
     {
419 441
         $grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
@@ -460,6 +482,9 @@  discard block
 block discarded – undo
460 482
     }
461 483
 
462 484
 
485
+    /**
486
+     * @param integer $groupID
487
+     */
463 488
     private function renderPlotRadar($groupID)
464 489
     {
465 490
         $radarStyle = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
@@ -499,6 +524,9 @@  discard block
 block discarded – undo
499 524
     }
500 525
 
501 526
 
527
+    /**
528
+     * @param integer $groupID
529
+     */
502 530
     private function renderPlotContour($groupID)
503 531
     {
504 532
         $contourStyle = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
@@ -520,6 +548,9 @@  discard block
 block discarded – undo
520 548
     }
521 549
 
522 550
 
551
+    /**
552
+     * @param integer $groupID
553
+     */
523 554
     private function renderPlotStock($groupID)
524 555
     {
525 556
         $seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
@@ -560,6 +591,9 @@  discard block
 block discarded – undo
560 591
     }
561 592
 
562 593
 
594
+    /**
595
+     * @param integer $groupCount
596
+     */
563 597
     private function renderAreaChart($groupCount, $dimensions = '2d')
564 598
     {
565 599
         require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php');
@@ -572,6 +606,9 @@  discard block
 block discarded – undo
572 606
     }
573 607
 
574 608
 
609
+    /**
610
+     * @param integer $groupCount
611
+     */
575 612
     private function renderLineChart($groupCount, $dimensions = '2d')
576 613
     {
577 614
         require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php');
@@ -584,6 +621,9 @@  discard block
 block discarded – undo
584 621
     }
585 622
 
586 623
 
624
+    /**
625
+     * @param integer $groupCount
626
+     */
587 627
     private function renderBarChart($groupCount, $dimensions = '2d')
588 628
     {
589 629
         require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_bar.php');
@@ -596,6 +636,9 @@  discard block
 block discarded – undo
596 636
     }
597 637
 
598 638
 
639
+    /**
640
+     * @param integer $groupCount
641
+     */
599 642
     private function renderScatterChart($groupCount)
600 643
     {
601 644
         require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_scatter.php');
@@ -610,6 +653,9 @@  discard block
 block discarded – undo
610 653
     }
611 654
 
612 655
 
656
+    /**
657
+     * @param integer $groupCount
658
+     */
613 659
     private function renderBubbleChart($groupCount)
614 660
     {
615 661
         require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_scatter.php');
@@ -622,6 +668,9 @@  discard block
 block discarded – undo
622 668
     }
623 669
 
624 670
 
671
+    /**
672
+     * @param integer $groupCount
673
+     */
625 674
     private function renderPieChart($groupCount, $dimensions = '2d', $doughnut = false, $multiplePlots = false)
626 675
     {
627 676
         require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_pie.php');
@@ -699,6 +748,9 @@  discard block
 block discarded – undo
699 748
     }
700 749
 
701 750
 
751
+    /**
752
+     * @param integer $groupCount
753
+     */
702 754
     private function renderRadarChart($groupCount)
703 755
     {
704 756
         require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_radar.php');
@@ -711,6 +763,9 @@  discard block
 block discarded – undo
711 763
     }
712 764
 
713 765
 
766
+    /**
767
+     * @param integer $groupCount
768
+     */
714 769
     private function renderStockChart($groupCount)
715 770
     {
716 771
         require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_stock.php');
@@ -723,6 +778,10 @@  discard block
 block discarded – undo
723 778
     }
724 779
 
725 780
 
781
+    /**
782
+     * @param integer $groupCount
783
+     * @param string|null $dimensions
784
+     */
726 785
     private function renderContourChart($groupCount, $dimensions)
727 786
     {
728 787
         require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_contour.php');
@@ -735,6 +794,9 @@  discard block
 block discarded – undo
735 794
     }
736 795
 
737 796
 
797
+    /**
798
+     * @param integer $groupCount
799
+     */
738 800
     private function renderCombinationChart($groupCount, $dimensions, $outputDestination)
739 801
     {
740 802
         require_once(\PhpSpreadsheet\Settings::getChartRendererPath().'jpgraph_line.php');
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Worksheet/RowDimension.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
     /**
102 102
      * Set Row Height
103 103
      *
104
-     * @param float $pValue
104
+     * @param integer $pValue
105 105
      * @return RowDimension
106 106
      */
107 107
     public function setRowHeight($pValue = -1)
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Shared/OLE.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -266,7 +266,7 @@
 block discarded – undo
266 266
     public function _readPpsWks($blockId)
267 267
     {
268 268
         $fh = $this->getStream($blockId);
269
-        for ($pos = 0;; $pos += 128) {
269
+        for ($pos = 0; ; $pos += 128) {
270 270
             fseek($fh, $pos, SEEK_SET);
271 271
             $nameUtf16 = fread($fh, 64);
272 272
             $nameLength = self::_readInt2($fh);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Style/Fill.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
     /**
102 102
      * Set Row Height
103 103
      *
104
-     * @param float $pValue
104
+     * @param integer $pValue
105 105
      * @return RowDimension
106 106
      */
107 107
     public function setRowHeight($pValue = -1)
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Style/Font.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
     /**
102 102
      * Set Row Height
103 103
      *
104
-     * @param float $pValue
104
+     * @param integer $pValue
105 105
      * @return RowDimension
106 106
      */
107 107
     public function setRowHeight($pValue = -1)
Please login to merge, or discard this patch.
Examples/03formulas.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,12 +45,12 @@
 block discarded – undo
45 45
 echo date('H:i:s') , " Set document properties" , EOL;
46 46
 $objPHPExcel->getProperties()
47 47
     ->setCreator("Maarten Balliauw")
48
-	->setLastModifiedBy("Maarten Balliauw")
49
-	->setTitle("Office 2007 XLSX Test Document")
50
-	->setSubject("Office 2007 XLSX Test Document")
51
-	->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
52
-	->setKeywords("office 2007 openxml php")
53
-	->setCategory("Test result file");
48
+    ->setLastModifiedBy("Maarten Balliauw")
49
+    ->setTitle("Office 2007 XLSX Test Document")
50
+    ->setSubject("Office 2007 XLSX Test Document")
51
+    ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
52
+    ->setKeywords("office 2007 openxml php")
53
+    ->setCategory("Test result file");
54 54
 
55 55
 // Set default font
56 56
 echo date('H:i:s') , " Set default font" , EOL;
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -31,18 +31,18 @@  discard block
 block discarded – undo
31 31
 ini_set('display_startup_errors', TRUE);
32 32
 date_default_timezone_set('Europe/London');
33 33
 
34
-define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
34
+define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
35 35
 
36 36
 /** Include PhpSpreadsheet */
37 37
 require_once dirname(__FILE__) . '/../src/Bootstrap.php';
38 38
 
39 39
 
40 40
 // Create new PhpSpreadsheet object
41
-echo date('H:i:s') , " Create new PhpSpreadsheet object" , EOL;
41
+echo date('H:i:s'), " Create new PhpSpreadsheet object", EOL;
42 42
 $objPhpSpreadsheet = new \PhpSpreadsheet\Spreadsheet();
43 43
 
44 44
 // Set document properties
45
-echo date('H:i:s') , " Set document properties" , EOL;
45
+echo date('H:i:s'), " Set document properties", EOL;
46 46
 $objPhpSpreadsheet->getProperties()->setCreator("Maarten Balliauw")
47 47
 	->setLastModifiedBy("Maarten Balliauw")
48 48
 	->setTitle("Office 2007 XLSX Test Document")
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
 
55 55
 // Add some data, we will use some formulas here
56
-echo date('H:i:s') , " Add some data" , EOL;
56
+echo date('H:i:s'), " Add some data", EOL;
57 57
 $objPhpSpreadsheet->getActiveSheet()
58 58
     ->setCellValue('A5', 'Sum:');
59 59
 
@@ -62,55 +62,55 @@  discard block
 block discarded – undo
62 62
     ->setCellValue('B3', 7)
63 63
     ->setCellValue('B4', 13)
64 64
     ->setCellValue('B5', '=SUM(B2:B4)');
65
-echo date('H:i:s') , " Sum of Range #1 is " ,
65
+echo date('H:i:s'), " Sum of Range #1 is ",
66 66
 $objPhpSpreadsheet->getActiveSheet()
67 67
     ->getCell('B5')
68
-    ->getCalculatedValue() , EOL;
68
+    ->getCalculatedValue(), EOL;
69 69
 
70 70
 $objPhpSpreadsheet->getActiveSheet()->setCellValue('C1', 'Range #2')
71 71
     ->setCellValue('C2', 5)
72 72
     ->setCellValue('C3', 11)
73 73
     ->setCellValue('C4', 17)
74 74
     ->setCellValue('C5', '=SUM(C2:C4)');
75
-echo date('H:i:s') , " Sum of Range #2 is " ,
75
+echo date('H:i:s'), " Sum of Range #2 is ",
76 76
 $objPhpSpreadsheet->getActiveSheet()
77 77
     ->getCell('C5')
78
-    ->getCalculatedValue() , EOL;
78
+    ->getCalculatedValue(), EOL;
79 79
 
80 80
 $objPhpSpreadsheet->getActiveSheet()
81 81
     ->setCellValue('A7', 'Total of both ranges:');
82 82
 $objPhpSpreadsheet->getActiveSheet()
83 83
     ->setCellValue('B7', '=SUM(B5:C5)');
84
-echo date('H:i:s') , " Sum of both Ranges is " ,
84
+echo date('H:i:s'), " Sum of both Ranges is ",
85 85
 $objPhpSpreadsheet->getActiveSheet()
86 86
     ->getCell('B7')
87
-    ->getCalculatedValue() , EOL;
87
+    ->getCalculatedValue(), EOL;
88 88
 
89 89
 $objPhpSpreadsheet->getActiveSheet()
90 90
     ->setCellValue('A8', 'Minimum of both ranges:');
91 91
 $objPhpSpreadsheet->getActiveSheet()
92 92
     ->setCellValue('B8', '=MIN(B2:C4)');
93
-echo date('H:i:s') , " Minimum value in either Range is " ,
93
+echo date('H:i:s'), " Minimum value in either Range is ",
94 94
 $objPhpSpreadsheet->getActiveSheet()
95 95
     ->getCell('B8')
96
-    ->getCalculatedValue() , EOL;
96
+    ->getCalculatedValue(), EOL;
97 97
 
98 98
 $objPhpSpreadsheet->getActiveSheet()
99 99
     ->setCellValue('A9', 'Maximum of both ranges:');
100 100
 $objPhpSpreadsheet->getActiveSheet()
101 101
     ->setCellValue('B9', '=MAX(B2:C4)');
102
-echo date('H:i:s') , " Maximum value in either Range is " ,
102
+echo date('H:i:s'), " Maximum value in either Range is ",
103 103
 $objPhpSpreadsheet->getActiveSheet()
104 104
     ->getCell('B9')
105
-    ->getCalculatedValue() , EOL;
105
+    ->getCalculatedValue(), EOL;
106 106
 
107 107
 $objPhpSpreadsheet->getActiveSheet()
108 108
     ->setCellValue('A10', 'Average of both ranges:');
109 109
 $objPhpSpreadsheet->getActiveSheet()
110 110
     ->setCellValue('B10', '=AVERAGE(B2:C4)');
111
-echo date('H:i:s') , " Average value of both Ranges is " ,
111
+echo date('H:i:s'), " Average value of both Ranges is ",
112 112
 $objPhpSpreadsheet->getActiveSheet()
113
-    ->getCell('B10')->getCalculatedValue() , EOL;
113
+    ->getCell('B10')->getCalculatedValue(), EOL;
114 114
 
115 115
 
116 116
 $objPhpSpreadsheet->getActiveSheet()
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
 
121 121
 // Rename worksheet
122
-echo date('H:i:s') , " Rename worksheet" , EOL;
122
+echo date('H:i:s'), " Rename worksheet", EOL;
123 123
 $objPhpSpreadsheet->getActiveSheet()
124 124
     ->setTitle('Formulas');
125 125
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
 
131 131
 // Save Excel 2007 file
132
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
132
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
133 133
 $callStartTime = microtime(true);
134 134
 
135 135
 $objWriter = \PhpSpreadsheet\IOFactory::createWriter($objPhpSpreadsheet, 'Excel2007');
@@ -146,14 +146,14 @@  discard block
 block discarded – undo
146 146
 $callEndTime = microtime(true);
147 147
 $callTime = $callEndTime - $callStartTime;
148 148
 
149
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
150
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
149
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
150
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
151 151
 // Echo memory usage
152
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
152
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
153 153
 
154 154
 
155 155
 // Save Excel 95 file
156
-echo date('H:i:s') , " Write to Excel5 format" , EOL;
156
+echo date('H:i:s'), " Write to Excel5 format", EOL;
157 157
 $callStartTime = microtime(true);
158 158
 
159 159
 $objWriter = \PhpSpreadsheet\IOFactory::createWriter($objPhpSpreadsheet, 'Excel5');
@@ -161,15 +161,15 @@  discard block
 block discarded – undo
161 161
 $callEndTime = microtime(true);
162 162
 $callTime = $callEndTime - $callStartTime;
163 163
 
164
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
165
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
164
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
165
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
166 166
 // Echo memory usage
167
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
167
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
168 168
 
169 169
 
170 170
 // Echo memory peak usage
171
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
171
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
172 172
 
173 173
 // Echo done
174
-echo date('H:i:s') , " Done writing files" , EOL;
175
-echo 'Files have been created in ' , getcwd() , EOL;
174
+echo date('H:i:s'), " Done writing files", EOL;
175
+echo 'Files have been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/01simple.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
 ini_set('display_startup_errors', TRUE);
31 31
 date_default_timezone_set('Europe/London');
32 32
 
33
-define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
33
+define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
34 34
 
35 35
 /** Include PhpSpreadsheet */
36 36
 require_once dirname(__FILE__) . '/../src/Bootstrap.php';
37 37
 
38 38
 
39 39
 // Create new Spreadsheet object
40
-echo date('H:i:s') , " Create new Spreadsheet object" , EOL;
40
+echo date('H:i:s'), " Create new Spreadsheet object", EOL;
41 41
 $objPhpSpreadsheet = new \PhpSpreadsheet\Spreadsheet();
42 42
 
43 43
 // Set document properties
44
-echo date('H:i:s') , " Set document properties" , EOL;
44
+echo date('H:i:s'), " Set document properties", EOL;
45 45
 $objPhpSpreadsheet->getProperties()
46 46
     ->setCreator("Maarten Balliauw")
47 47
 	->setLastModifiedBy("Maarten Balliauw")
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
 
55 55
 // Add some data
56
-echo date('H:i:s') , " Add some data" , EOL;
56
+echo date('H:i:s'), " Add some data", EOL;
57 57
 $objPhpSpreadsheet->setActiveSheetIndex(0)
58 58
     ->setCellValue('A1', 'Hello')
59 59
     ->setCellValue('B2', 'world!')
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
 
69 69
 $objPhpSpreadsheet->getActiveSheet()
70
-    ->setCellValue('A8',"Hello\nWorld");
70
+    ->setCellValue('A8', "Hello\nWorld");
71 71
 $objPhpSpreadsheet->getActiveSheet()
72 72
     ->getRowDimension(8)
73 73
     ->setRowHeight(-1);
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
 
95 95
 // Rename worksheet
96
-echo date('H:i:s') , " Rename worksheet" , EOL;
96
+echo date('H:i:s'), " Rename worksheet", EOL;
97 97
 $objPhpSpreadsheet->getActiveSheet()
98 98
     ->setTitle('Simple');
99 99
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 
104 104
 
105 105
 // Save Excel 2007 file
106
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
106
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
107 107
 $callStartTime = microtime(true);
108 108
 
109 109
 $objWriter = \PhpSpreadsheet\IOFactory::createWriter($objPhpSpreadsheet, 'Excel2007');
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
 $callEndTime = microtime(true);
112 112
 $callTime = $callEndTime - $callStartTime;
113 113
 
114
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
115
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
114
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
115
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
116 116
 // Echo memory usage
117
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
117
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
118 118
 
119 119
 
120 120
 // Save Excel 95 file
121
-echo date('H:i:s') , " Write to Excel5 format" , EOL;
121
+echo date('H:i:s'), " Write to Excel5 format", EOL;
122 122
 $callStartTime = microtime(true);
123 123
 
124 124
 $objWriter = \PhpSpreadsheet\IOFactory::createWriter($objPhpSpreadsheet, 'Excel5');
@@ -126,15 +126,15 @@  discard block
 block discarded – undo
126 126
 $callEndTime = microtime(true);
127 127
 $callTime = $callEndTime - $callStartTime;
128 128
 
129
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
130
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
129
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
130
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
131 131
 // Echo memory usage
132
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
132
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
133 133
 
134 134
 
135 135
 // Echo memory peak usage
136
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
136
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
137 137
 
138 138
 // Echo done
139
-echo date('H:i:s') , " Done writing files" , EOL;
140
-echo 'Files have been created in ' , getcwd() , EOL;
139
+echo date('H:i:s'), " Done writing files", EOL;
140
+echo 'Files have been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,12 +43,12 @@
 block discarded – undo
43 43
 // Set document properties
44 44
 echo date('H:i:s') , " Set document properties" , EOL;
45 45
 $objPhpSpreadsheet->getProperties()->setCreator("Maarten Balliauw")
46
-	->setLastModifiedBy("Maarten Balliauw")
47
-	->setTitle("PhpSpreadsheet Test Document")
48
-	->setSubject("PhpSpreadsheet Test Document")
49
-	->setDescription("Test document for PhpSpreadsheet, generated using PHP classes.")
50
-	->setKeywords("office PhpSpreadsheet php")
51
-	->setCategory("Test result file");
46
+    ->setLastModifiedBy("Maarten Balliauw")
47
+    ->setTitle("PhpSpreadsheet Test Document")
48
+    ->setSubject("PhpSpreadsheet Test Document")
49
+    ->setDescription("Test document for PhpSpreadsheet, generated using PHP classes.")
50
+    ->setKeywords("office PhpSpreadsheet php")
51
+    ->setCategory("Test result file");
52 52
 
53 53
 
54 54
 // Add some data
Please login to merge, or discard this patch.
Examples/01simplePCLZip.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,12 +43,12 @@
 block discarded – undo
43 43
 // Set document properties
44 44
 echo date('H:i:s') , " Set document properties" , EOL;
45 45
 $objPhpSpreadsheet->getProperties()->setCreator("Maarten Balliauw")
46
-	->setLastModifiedBy("Maarten Balliauw")
47
-	->setTitle("PhpSpreadsheet Test Document")
48
-	->setSubject("PhpSpreadsheet Test Document")
49
-	->setDescription("Test document for PhpSpreadsheet, generated using PHP classes.")
50
-	->setKeywords("office PhpSpreadsheet php")
51
-	->setCategory("Test result file");
46
+    ->setLastModifiedBy("Maarten Balliauw")
47
+    ->setTitle("PhpSpreadsheet Test Document")
48
+    ->setSubject("PhpSpreadsheet Test Document")
49
+    ->setDescription("Test document for PhpSpreadsheet, generated using PHP classes.")
50
+    ->setKeywords("office PhpSpreadsheet php")
51
+    ->setCategory("Test result file");
52 52
 
53 53
 
54 54
 // Add some data
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
 ini_set('display_startup_errors', TRUE);
31 31
 date_default_timezone_set('Europe/London');
32 32
 
33
-define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
33
+define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
34 34
 
35 35
 /** Include PhpSpreadsheet */
36 36
 require_once dirname(__FILE__) . '/../src/Bootstrap.php';
37 37
 
38 38
 
39 39
 // Create new PhpSpreadsheet object
40
-echo date('H:i:s') , " Create new PhpSpreadsheet object" , EOL;
40
+echo date('H:i:s'), " Create new PhpSpreadsheet object", EOL;
41 41
 $objPhpSpreadsheet = new \PhpSpreadsheet\Spreadsheet();
42 42
 
43 43
 // Set document properties
44
-echo date('H:i:s') , " Set document properties" , EOL;
44
+echo date('H:i:s'), " Set document properties", EOL;
45 45
 $objPhpSpreadsheet->getProperties()->setCreator("Maarten Balliauw")
46 46
 	->setLastModifiedBy("Maarten Balliauw")
47 47
 	->setTitle("PhpSpreadsheet Test Document")
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 
54 54
 // Add some data
55
-echo date('H:i:s') , " Add some data" , EOL;
55
+echo date('H:i:s'), " Add some data", EOL;
56 56
 $objPhpSpreadsheet->setActiveSheetIndex(0)
57 57
     ->setCellValue('A1', 'Hello')
58 58
     ->setCellValue('B2', 'world!')
@@ -65,13 +65,13 @@  discard block
 block discarded – undo
65 65
     ->setCellValue('A5', 'éàèùâêîôûëïüÿäöüç');
66 66
 
67 67
 
68
-$objPhpSpreadsheet->getActiveSheet()->setCellValue('A8',"Hello\nWorld");
68
+$objPhpSpreadsheet->getActiveSheet()->setCellValue('A8', "Hello\nWorld");
69 69
 $objPhpSpreadsheet->getActiveSheet()->getRowDimension(8)->setRowHeight(-1);
70 70
 $objPhpSpreadsheet->getActiveSheet()->getStyle('A8')->getAlignment()->setWrapText(true);
71 71
 
72 72
 
73 73
 // Rename worksheet
74
-echo date('H:i:s') , " Rename worksheet" , EOL;
74
+echo date('H:i:s'), " Rename worksheet", EOL;
75 75
 $objPhpSpreadsheet->getActiveSheet()->setTitle('Simple');
76 76
 
77 77
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
 
82 82
 // Save Excel 2007 file
83
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
83
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
84 84
 $callStartTime = microtime(true);
85 85
 
86 86
 // Use PCLZip rather than ZipArchive to create the Excel2007 OfficeOpenXML file
@@ -91,15 +91,15 @@  discard block
 block discarded – undo
91 91
 $callEndTime = microtime(true);
92 92
 $callTime = $callEndTime - $callStartTime;
93 93
 
94
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
95
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
94
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
95
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
96 96
 // Echo memory usage
97
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
97
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
98 98
 
99 99
 
100 100
 // Echo memory peak usage
101
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
101
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
102 102
 
103 103
 // Echo done
104
-echo date('H:i:s') , " Done writing files" , EOL;
105
-echo 'Files have been created in ' , getcwd() , EOL;
104
+echo date('H:i:s'), " Done writing files", EOL;
105
+echo 'Files have been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.