Completed
Push — develop ( 539a89...685e29 )
by Adrien
11:28
created
Examples/25inmemoryimage.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 ini_set('display_errors', TRUE);
31 31
 ini_set('display_startup_errors', TRUE);
32 32
 
33
-define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
33
+define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
34 34
 
35 35
 date_default_timezone_set('Europe/London');
36 36
 
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
 
40 40
 
41 41
 // Create new PHPExcel object
42
-echo date('H:i:s') , " Create new PHPExcel object" , EOL;
42
+echo date('H:i:s'), " Create new PHPExcel object", EOL;
43 43
 $objPHPExcel = new \PHPExcel\Spreadsheet();
44 44
 
45 45
 // Set document properties
46
-echo date('H:i:s') , " Set document properties" , EOL;
46
+echo date('H:i:s'), " Set document properties", EOL;
47 47
 $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
48 48
 							 ->setLastModifiedBy("Maarten Balliauw")
49 49
 							 ->setTitle("Office 2007 XLSX Test Document")
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
 							 ->setCategory("Test result file");
54 54
 
55 55
 // Generate an image
56
-echo date('H:i:s') , " Generate an image" , EOL;
56
+echo date('H:i:s'), " Generate an image", EOL;
57 57
 $gdImage = @imagecreatetruecolor(120, 20) or die('Cannot Initialize new GD image stream');
58 58
 $textColor = imagecolorallocate($gdImage, 255, 255, 255);
59
-imagestring($gdImage, 1, 5, 5,  'Created with PHPExcel', $textColor);
59
+imagestring($gdImage, 1, 5, 5, 'Created with PHPExcel', $textColor);
60 60
 
61 61
 // Add a drawing to the worksheet
62
-echo date('H:i:s') , " Add a drawing to the worksheet" , EOL;
62
+echo date('H:i:s'), " Add a drawing to the worksheet", EOL;
63 63
 $objDrawing = new \PHPExcel\Worksheet\MemoryDrawing();
64 64
 $objDrawing->setName('Sample image');
65 65
 $objDrawing->setDescription('Sample image');
@@ -69,21 +69,21 @@  discard block
 block discarded – undo
69 69
 $objDrawing->setHeight(36);
70 70
 $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
71 71
 
72
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
72
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
73 73
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
74 74
 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
75
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
75
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
76 76
 
77 77
 
78
-echo date('H:i:s') , " Write to HTML format" , EOL;
78
+echo date('H:i:s'), " Write to HTML format", EOL;
79 79
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'HTML');
80 80
 $objWriter->save(str_replace('.php', '.html', __FILE__));
81
-echo date('H:i:s') , " File written to " , str_replace('.php', '.html', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
81
+echo date('H:i:s'), " File written to ", str_replace('.php', '.html', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
82 82
 
83 83
 
84 84
 // Echo memory peak usage
85
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
85
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
86 86
 
87 87
 // Echo done
88
-echo date('H:i:s') , " Done writing file" , EOL;
89
-echo 'Files have been created in ' , getcwd() , EOL;
88
+echo date('H:i:s'), " Done writing file", EOL;
89
+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
@@ -45,12 +45,12 @@
 block discarded – undo
45 45
 // Set document properties
46 46
 echo date('H:i:s') , " Set document properties" , EOL;
47 47
 $objPHPExcel->getProperties()->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
 
56 56
 // Add some data
Please login to merge, or discard this patch.
Examples/38cloneWorksheet.php 2 patches
Spacing   +15 added lines, -15 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 PHPExcel */
37 37
 require_once dirname(__FILE__) . '/../src/Bootstrap.php';
38 38
 
39 39
 
40 40
 // Create new PHPExcel object
41
-echo date('H:i:s') , " Create new PHPExcel object" , EOL;
41
+echo date('H:i:s'), " Create new PHPExcel object", EOL;
42 42
 $objPHPExcel = new \PHPExcel\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
 $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
47 47
 							 ->setLastModifiedBy("Maarten Balliauw")
48 48
 							 ->setTitle("PHPExcel Test Document")
@@ -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
 $objPHPExcel->setActiveSheetIndex(0)
58 58
             ->setCellValue('A1', 'Hello')
59 59
             ->setCellValue('B2', 'world!')
@@ -66,18 +66,18 @@  discard block
 block discarded – undo
66 66
             ->setCellValue('A5', 'éàèùâêîôûëïüÿäöüç');
67 67
 
68 68
 
69
-$objPHPExcel->getActiveSheet()->setCellValue('A8',"Hello\nWorld");
69
+$objPHPExcel->getActiveSheet()->setCellValue('A8', "Hello\nWorld");
70 70
 $objPHPExcel->getActiveSheet()->getRowDimension(8)->setRowHeight(-1);
71 71
 $objPHPExcel->getActiveSheet()->getStyle('A8')->getAlignment()->setWrapText(true);
72 72
 
73 73
 
74 74
 // Rename worksheet
75
-echo date('H:i:s') , " Rename worksheet" , EOL;
75
+echo date('H:i:s'), " Rename worksheet", EOL;
76 76
 $objPHPExcel->getActiveSheet()->setTitle('Simple');
77 77
 
78 78
 
79 79
 // Clone worksheet
80
-echo date('H:i:s') , " Clone worksheet" , EOL;
80
+echo date('H:i:s'), " Clone worksheet", EOL;
81 81
 $clonedSheet = clone $objPHPExcel->getActiveSheet();
82 82
 $clonedSheet
83 83
     ->setCellValue('A1', 'Goodbye')
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     ->setCellValue('C2', 'cruel');
87 87
 
88 88
 // Rename cloned worksheet
89
-echo date('H:i:s') , " Rename cloned worksheet" , EOL;
89
+echo date('H:i:s'), " Rename cloned worksheet", EOL;
90 90
 $clonedSheet->setTitle('Simple Clone');
91 91
 $objPHPExcel->addSheet($clonedSheet);
92 92
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
 
98 98
 // Save Excel 2007 file
99
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
99
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
100 100
 $callStartTime = microtime(true);
101 101
 
102 102
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
@@ -104,15 +104,15 @@  discard block
 block discarded – undo
104 104
 $callEndTime = microtime(true);
105 105
 $callTime = $callEndTime - $callStartTime;
106 106
 
107
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
108
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
107
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
108
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
109 109
 // Echo memory usage
110
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
110
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
111 111
 
112 112
 
113 113
 // Echo memory peak usage
114
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
114
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
115 115
 
116 116
 // Echo done
117
-echo date('H:i:s') , " Done writing files" , EOL;
118
-echo 'File has been created in ' , getcwd() , EOL;
117
+echo date('H:i:s'), " Done writing files", EOL;
118
+echo 'File has 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
@@ -44,12 +44,12 @@
 block discarded – undo
44 44
 // Set document properties
45 45
 echo date('H:i:s') , " Set document properties" , EOL;
46 46
 $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
47
-							 ->setLastModifiedBy("Maarten Balliauw")
48
-							 ->setTitle("PHPExcel Test Document")
49
-							 ->setSubject("PHPExcel Test Document")
50
-							 ->setDescription("Test document for PHPExcel, generated using PHP classes.")
51
-							 ->setKeywords("office PHPExcel php")
52
-							 ->setCategory("Test result file");
47
+                                ->setLastModifiedBy("Maarten Balliauw")
48
+                                ->setTitle("PHPExcel Test Document")
49
+                                ->setSubject("PHPExcel Test Document")
50
+                                ->setDescription("Test document for PHPExcel, generated using PHP classes.")
51
+                                ->setKeywords("office PHPExcel php")
52
+                                ->setCategory("Test result file");
53 53
 
54 54
 
55 55
 // Add some data
Please login to merge, or discard this patch.
Examples/02types.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   +21 added lines, -21 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 PHPExcel */
37 37
 require_once dirname(__FILE__) . '/../src/Bootstrap.php';
38 38
 
39 39
 
40 40
 // Create new PHPExcel object
41
-echo date('H:i:s') , " Create new PHPExcel object" , EOL;
41
+echo date('H:i:s'), " Create new PHPExcel object", EOL;
42 42
 $objPHPExcel = new \PHPExcel\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
 $objPHPExcel->getProperties()
47 47
     ->setCreator("Maarten Balliauw")
48 48
 	->setLastModifiedBy("Maarten Balliauw")
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 	->setCategory("Test result file");
54 54
 
55 55
 // Set default font
56
-echo date('H:i:s') , " Set default font" , EOL;
56
+echo date('H:i:s'), " Set default font", EOL;
57 57
 $objPHPExcel->getDefaultStyle()
58 58
     ->getFont()
59 59
     ->setName('Arial')
60 60
     ->setSize(10);
61 61
 
62 62
 // Add some data, resembling some different data types
63
-echo date('H:i:s') , " Add some data" , EOL;
63
+echo date('H:i:s'), " Add some data", EOL;
64 64
 $objPHPExcel->getActiveSheet()
65 65
     ->setCellValue('A1', 'String')
66 66
     ->setCellValue('B1', 'Simple')
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 $objPHPExcel->getActiveSheet()
106 106
     ->setCellValue('A9', 'Date/Time')
107 107
     ->setCellValue('B9', 'Date')
108
-    ->setCellValue('C9', \PHPExcel\Shared\Date::PHPToExcel( $dateTimeNow ));
108
+    ->setCellValue('C9', \PHPExcel\Shared\Date::PHPToExcel($dateTimeNow));
109 109
 $objPHPExcel->getActiveSheet()
110 110
     ->getStyle('C9')
111 111
     ->getNumberFormat()
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 $objPHPExcel->getActiveSheet()
115 115
     ->setCellValue('A10', 'Date/Time')
116 116
     ->setCellValue('B10', 'Time')
117
-    ->setCellValue('C10', \PHPExcel\Shared\Date::PHPToExcel( $dateTimeNow ));
117
+    ->setCellValue('C10', \PHPExcel\Shared\Date::PHPToExcel($dateTimeNow));
118 118
 $objPHPExcel->getActiveSheet()
119 119
     ->getStyle('C10')
120 120
     ->getNumberFormat()
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 $objPHPExcel->getActiveSheet()
124 124
     ->setCellValue('A11', 'Date/Time')
125 125
     ->setCellValue('B11', 'Date and Time')
126
-    ->setCellValue('C11', \PHPExcel\Shared\Date::PHPToExcel( $dateTimeNow ));
126
+    ->setCellValue('C11', \PHPExcel\Shared\Date::PHPToExcel($dateTimeNow));
127 127
 $objPHPExcel->getActiveSheet()
128 128
     ->getStyle('C11')
129 129
     ->getNumberFormat()
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 $objPayable = $objRichText->createTextRun('你 好 吗?');
140 140
 $objPayable->getFont()->setBold(true);
141 141
 $objPayable->getFont()->setItalic(true);
142
-$objPayable->getFont()->setColor( new \PHPExcel\Style\Color( \PHPExcel\Style\Color::COLOR_DARKGREEN ) );
142
+$objPayable->getFont()->setColor(new \PHPExcel\Style\Color(\PHPExcel\Style\Color::COLOR_DARKGREEN));
143 143
 
144 144
 $objRichText->createText(', unless specified otherwise on the invoice.');
145 145
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 $objRichText2->createText("black text\n");
153 153
 
154 154
 $objRed = $objRichText2->createTextRun("red text");
155
-$objRed->getFont()->setColor( new \PHPExcel\Style\Color(\PHPExcel\Style\Color::COLOR_RED  ) );
155
+$objRed->getFont()->setColor(new \PHPExcel\Style\Color(\PHPExcel\Style\Color::COLOR_RED));
156 156
 
157 157
 $objPHPExcel->getActiveSheet()
158 158
     ->getCell("C14")
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
     ->setAutoSize(true);
180 180
 
181 181
 // Rename worksheet
182
-echo date('H:i:s') , " Rename worksheet" , EOL;
182
+echo date('H:i:s'), " Rename worksheet", EOL;
183 183
 $objPHPExcel->getActiveSheet()->setTitle('Datatypes');
184 184
 
185 185
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
 
190 190
 // Save Excel 2007 file
191
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
191
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
192 192
 $callStartTime = microtime(true);
193 193
 
194 194
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
@@ -196,30 +196,30 @@  discard block
 block discarded – undo
196 196
 $callEndTime = microtime(true);
197 197
 $callTime = $callEndTime - $callStartTime;
198 198
 
199
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
200
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
199
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
200
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
201 201
 // Echo memory usage
202
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
202
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
203 203
 
204 204
 
205
-echo date('H:i:s') , " Reload workbook from saved file" , EOL;
205
+echo date('H:i:s'), " Reload workbook from saved file", EOL;
206 206
 $callStartTime = microtime(true);
207 207
 
208 208
 $objPHPExcel = \PHPExcel\IOFactory::load(str_replace('.php', '.xlsx', __FILE__));
209 209
 
210 210
 $callEndTime = microtime(true);
211 211
 $callTime = $callEndTime - $callStartTime;
212
-echo 'Call time to reload Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
212
+echo 'Call time to reload Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
213 213
 // Echo memory usage
214
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
214
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
215 215
 
216 216
 
217 217
 var_dump($objPHPExcel->getActiveSheet()->toArray());
218 218
 
219 219
 
220 220
 // Echo memory peak usage
221
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
221
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
222 222
 
223 223
 // Echo done
224
-echo date('H:i:s') , " Done testing file" , EOL;
225
-echo 'File has been created in ' , getcwd() , EOL;
224
+echo date('H:i:s'), " Done testing file", EOL;
225
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/33chartcreate-multiple-charts.php 2 patches
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -43,13 +43,13 @@  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('Q1',   12,   15,		21),
49
-		array('Q2',   56,   73,		86),
50
-		array('Q3',   52,   61,		69),
51
-		array('Q4',   30,   32,		0),
52
-	)
46
+    array(
47
+        array('',	2010,	2011,	2012),
48
+        array('Q1',   12,   15,		21),
49
+        array('Q2',   56,   73,		86),
50
+        array('Q3',   52,   61,		69),
51
+        array('Q4',   30,   32,		0),
52
+    )
53 53
 );
54 54
 
55 55
 
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 //		Data values
62 62
 //		Data Marker
63 63
 $dataSeriesLabels1 = array(
64
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1),	//	2010
65
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	2011
66
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1),	//	2012
64
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1),	//	2010
65
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	2011
66
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1),	//	2012
67 67
 );
68 68
 //	Set the X-Axis Labels
69 69
 //		Datatype
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 //		Data values
74 74
 //		Data Marker
75 75
 $xAxisTickValues1 = array(
76
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4),	//	Q1 to Q4
76
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4),	//	Q1 to Q4
77 77
 );
78 78
 //	Set the Data values for each data series we want to plot
79 79
 //		Datatype
@@ -83,19 +83,19 @@  discard block
 block discarded – undo
83 83
 //		Data values
84 84
 //		Data Marker
85 85
 $dataSeriesValues1 = array(
86
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', NULL, 4),
87
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', NULL, 4),
88
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', NULL, 4),
86
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', NULL, 4),
87
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', NULL, 4),
88
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', NULL, 4),
89 89
 );
90 90
 
91 91
 //	Build the dataseries
92 92
 $series1 = new \PHPExcel\Chart\DataSeries(
93
-	\PHPExcel\Chart\DataSeries::TYPE_AREACHART,				// plotType
94
-	\PHPExcel\Chart\DataSeries::GROUPING_PERCENT_STACKED,	// plotGrouping
95
-	range(0, count($dataSeriesValues1)-1),					// plotOrder
96
-	$dataSeriesLabels1,										// plotLabel
97
-	$xAxisTickValues1,										// plotCategory
98
-	$dataSeriesValues1										// plotValues
93
+    \PHPExcel\Chart\DataSeries::TYPE_AREACHART,				// plotType
94
+    \PHPExcel\Chart\DataSeries::GROUPING_PERCENT_STACKED,	// plotGrouping
95
+    range(0, count($dataSeriesValues1)-1),					// plotOrder
96
+    $dataSeriesLabels1,										// plotLabel
97
+    $xAxisTickValues1,										// plotCategory
98
+    $dataSeriesValues1										// plotValues
99 99
 );
100 100
 
101 101
 //	Set the series in the plot area
@@ -109,14 +109,14 @@  discard block
 block discarded – undo
109 109
 
110 110
 //	Create the chart
111 111
 $chart1 = new \PHPExcel\Chart(
112
-	'chart1',		// name
113
-	$title1,		// title
114
-	$legend1,		// legend
115
-	$plotArea1,		// plotArea
116
-	true,			// plotVisibleOnly
117
-	0,				// displayBlanksAs
118
-	NULL,			// xAxisLabel
119
-	$yAxisLabel1	// yAxisLabel
112
+    'chart1',		// name
113
+    $title1,		// title
114
+    $legend1,		// legend
115
+    $plotArea1,		// plotArea
116
+    true,			// plotVisibleOnly
117
+    0,				// displayBlanksAs
118
+    NULL,			// xAxisLabel
119
+    $yAxisLabel1	// yAxisLabel
120 120
 );
121 121
 
122 122
 //	Set the position where the chart should appear in the worksheet
@@ -135,9 +135,9 @@  discard block
 block discarded – undo
135 135
 //		Data values
136 136
 //		Data Marker
137 137
 $dataSeriesLabels2 = array(
138
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1),	//	2010
139
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	2011
140
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1),	//	2012
138
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1),	//	2010
139
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	2011
140
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1),	//	2012
141 141
 );
142 142
 //	Set the X-Axis Labels
143 143
 //		Datatype
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 //		Data values
148 148
 //		Data Marker
149 149
 $xAxisTickValues2 = array(
150
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4),	//	Q1 to Q4
150
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4),	//	Q1 to Q4
151 151
 );
152 152
 //	Set the Data values for each data series we want to plot
153 153
 //		Datatype
@@ -157,19 +157,19 @@  discard block
 block discarded – undo
157 157
 //		Data values
158 158
 //		Data Marker
159 159
 $dataSeriesValues2 = array(
160
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', NULL, 4),
161
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', NULL, 4),
162
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', NULL, 4),
160
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', NULL, 4),
161
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', NULL, 4),
162
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', NULL, 4),
163 163
 );
164 164
 
165 165
 //	Build the dataseries
166 166
 $series2 = new \PHPExcel\Chart\DataSeries(
167
-	\PHPExcel\Chart\DataSeries::TYPE_BARCHART,		// plotType
168
-	\PHPExcel\Chart\DataSeries::GROUPING_STANDARD,	// plotGrouping
169
-	range(0, count($dataSeriesValues2)-1),			// plotOrder
170
-	$dataSeriesLabels2,								// plotLabel
171
-	$xAxisTickValues2,								// plotCategory
172
-	$dataSeriesValues2								// plotValues
167
+    \PHPExcel\Chart\DataSeries::TYPE_BARCHART,		// plotType
168
+    \PHPExcel\Chart\DataSeries::GROUPING_STANDARD,	// plotGrouping
169
+    range(0, count($dataSeriesValues2)-1),			// plotOrder
170
+    $dataSeriesLabels2,								// plotLabel
171
+    $xAxisTickValues2,								// plotCategory
172
+    $dataSeriesValues2								// plotValues
173 173
 );
174 174
 //	Set additional dataseries parameters
175 175
 //		Make it a vertical column rather than a horizontal bar graph
@@ -186,14 +186,14 @@  discard block
 block discarded – undo
186 186
 
187 187
 //	Create the chart
188 188
 $chart2 = new \PHPExcel\Chart(
189
-	'chart2',		// name
190
-	$title2,		// title
191
-	$legend2,		// legend
192
-	$plotArea2,		// plotArea
193
-	true,			// plotVisibleOnly
194
-	0,				// displayBlanksAs
195
-	NULL,			// xAxisLabel
196
-	$yAxisLabel2	// yAxisLabel
189
+    'chart2',		// name
190
+    $title2,		// title
191
+    $legend2,		// legend
192
+    $plotArea2,		// plotArea
193
+    true,			// plotVisibleOnly
194
+    0,				// displayBlanksAs
195
+    NULL,			// xAxisLabel
196
+    $yAxisLabel2	// yAxisLabel
197 197
 );
198 198
 
199 199
 //	Set the position where the chart should appear in the worksheet
Please login to merge, or discard this patch.
Spacing   +43 added lines, -43 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,11 +44,11 @@  discard block
 block discarded – undo
44 44
 $objWorksheet = $objPHPExcel->getActiveSheet();
45 45
 $objWorksheet->fromArray(
46 46
 	array(
47
-		array('',	2010,	2011,	2012),
48
-		array('Q1',   12,   15,		21),
49
-		array('Q2',   56,   73,		86),
50
-		array('Q3',   52,   61,		69),
51
-		array('Q4',   30,   32,		0),
47
+		array('', 2010, 2011, 2012),
48
+		array('Q1', 12, 15, 21),
49
+		array('Q2', 56, 73, 86),
50
+		array('Q3', 52, 61, 69),
51
+		array('Q4', 30, 32, 0),
52 52
 	)
53 53
 );
54 54
 
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 //		Data values
62 62
 //		Data Marker
63 63
 $dataSeriesLabels1 = array(
64
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1),	//	2010
65
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	2011
66
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1),	//	2012
64
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1), //	2010
65
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1), //	2011
66
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1), //	2012
67 67
 );
68 68
 //	Set the X-Axis Labels
69 69
 //		Datatype
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 //		Data values
74 74
 //		Data Marker
75 75
 $xAxisTickValues1 = array(
76
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4),	//	Q1 to Q4
76
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4), //	Q1 to Q4
77 77
 );
78 78
 //	Set the Data values for each data series we want to plot
79 79
 //		Datatype
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 
91 91
 //	Build the dataseries
92 92
 $series1 = new \PHPExcel\Chart\DataSeries(
93
-	\PHPExcel\Chart\DataSeries::TYPE_AREACHART,				// plotType
94
-	\PHPExcel\Chart\DataSeries::GROUPING_PERCENT_STACKED,	// plotGrouping
95
-	range(0, count($dataSeriesValues1)-1),					// plotOrder
96
-	$dataSeriesLabels1,										// plotLabel
97
-	$xAxisTickValues1,										// plotCategory
93
+	\PHPExcel\Chart\DataSeries::TYPE_AREACHART, // plotType
94
+	\PHPExcel\Chart\DataSeries::GROUPING_PERCENT_STACKED, // plotGrouping
95
+	range(0, count($dataSeriesValues1) - 1), // plotOrder
96
+	$dataSeriesLabels1, // plotLabel
97
+	$xAxisTickValues1, // plotCategory
98 98
 	$dataSeriesValues1										// plotValues
99 99
 );
100 100
 
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 
110 110
 //	Create the chart
111 111
 $chart1 = new \PHPExcel\Chart(
112
-	'chart1',		// name
113
-	$title1,		// title
114
-	$legend1,		// legend
115
-	$plotArea1,		// plotArea
116
-	true,			// plotVisibleOnly
117
-	0,				// displayBlanksAs
118
-	NULL,			// xAxisLabel
112
+	'chart1', // name
113
+	$title1, // title
114
+	$legend1, // legend
115
+	$plotArea1, // plotArea
116
+	true, // plotVisibleOnly
117
+	0, // displayBlanksAs
118
+	NULL, // xAxisLabel
119 119
 	$yAxisLabel1	// yAxisLabel
120 120
 );
121 121
 
@@ -135,9 +135,9 @@  discard block
 block discarded – undo
135 135
 //		Data values
136 136
 //		Data Marker
137 137
 $dataSeriesLabels2 = array(
138
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1),	//	2010
139
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	2011
140
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1),	//	2012
138
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1), //	2010
139
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1), //	2011
140
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1), //	2012
141 141
 );
142 142
 //	Set the X-Axis Labels
143 143
 //		Datatype
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 //		Data values
148 148
 //		Data Marker
149 149
 $xAxisTickValues2 = array(
150
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4),	//	Q1 to Q4
150
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4), //	Q1 to Q4
151 151
 );
152 152
 //	Set the Data values for each data series we want to plot
153 153
 //		Datatype
@@ -164,11 +164,11 @@  discard block
 block discarded – undo
164 164
 
165 165
 //	Build the dataseries
166 166
 $series2 = new \PHPExcel\Chart\DataSeries(
167
-	\PHPExcel\Chart\DataSeries::TYPE_BARCHART,		// plotType
168
-	\PHPExcel\Chart\DataSeries::GROUPING_STANDARD,	// plotGrouping
169
-	range(0, count($dataSeriesValues2)-1),			// plotOrder
170
-	$dataSeriesLabels2,								// plotLabel
171
-	$xAxisTickValues2,								// plotCategory
167
+	\PHPExcel\Chart\DataSeries::TYPE_BARCHART, // plotType
168
+	\PHPExcel\Chart\DataSeries::GROUPING_STANDARD, // plotGrouping
169
+	range(0, count($dataSeriesValues2) - 1), // plotOrder
170
+	$dataSeriesLabels2, // plotLabel
171
+	$xAxisTickValues2, // plotCategory
172 172
 	$dataSeriesValues2								// plotValues
173 173
 );
174 174
 //	Set additional dataseries parameters
@@ -186,13 +186,13 @@  discard block
 block discarded – undo
186 186
 
187 187
 //	Create the chart
188 188
 $chart2 = new \PHPExcel\Chart(
189
-	'chart2',		// name
190
-	$title2,		// title
191
-	$legend2,		// legend
192
-	$plotArea2,		// plotArea
193
-	true,			// plotVisibleOnly
194
-	0,				// displayBlanksAs
195
-	NULL,			// xAxisLabel
189
+	'chart2', // name
190
+	$title2, // title
191
+	$legend2, // legend
192
+	$plotArea2, // plotArea
193
+	true, // plotVisibleOnly
194
+	0, // displayBlanksAs
195
+	NULL, // xAxisLabel
196 196
 	$yAxisLabel2	// yAxisLabel
197 197
 );
198 198
 
@@ -205,16 +205,16 @@  discard block
 block discarded – undo
205 205
 
206 206
 
207 207
 // Save Excel 2007 file
208
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
208
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
209 209
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
210 210
 $objWriter->setIncludeCharts(TRUE);
211 211
 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
212
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
212
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
213 213
 
214 214
 
215 215
 // Echo memory peak usage
216
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
216
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
217 217
 
218 218
 // Echo done
219
-echo date('H:i:s') , " Done writing file" , EOL;
220
-echo 'File has been created in ' , getcwd() , EOL;
219
+echo date('H:i:s'), " Done writing file", EOL;
220
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/20readexcel5.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
 
41 41
 
42 42
 if (!file_exists("14excel5.xls")) {
43
-	exit("Please run 14excel5.php first.\n");
43
+    exit("Please run 14excel5.php first.\n");
44 44
 }
45 45
 
46 46
 echo date('H:i:s') , " Load workbook from Excel5 file" , EOL;
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  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
 date_default_timezone_set('Europe/London');
37 37
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	exit("Please run 14excel5.php first.\n");
44 44
 }
45 45
 
46
-echo date('H:i:s') , " Load workbook from Excel5 file" , EOL;
46
+echo date('H:i:s'), " Load workbook from Excel5 file", EOL;
47 47
 $callStartTime = microtime(true);
48 48
 
49 49
 $objPHPExcel = \PHPExcel\IOFactory::load("14excel5.xls");
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
 $callEndTime = microtime(true);
52 52
 $callTime = $callEndTime - $callStartTime;
53 53
 
54
-echo 'Call time to load Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
54
+echo 'Call time to load Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
55 55
 // Echo memory usage
56
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
56
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
57 57
 
58 58
 
59 59
 // Save Excel 2007 file
60
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
60
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
61 61
 $callStartTime = microtime(true);
62 62
 
63 63
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
@@ -65,15 +65,15 @@  discard block
 block discarded – undo
65 65
 $callEndTime = microtime(true);
66 66
 $callTime = $callEndTime - $callStartTime;
67 67
 
68
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
69
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
68
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
69
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
70 70
 // Echo memory usage
71
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
71
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
72 72
 
73 73
 
74 74
 // Echo memory peak usage
75
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
75
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
76 76
 
77 77
 // Echo done
78
-echo date('H:i:s') , " Done reading file" , EOL;
79
-echo 'File has been created in ' , getcwd() , EOL;
78
+echo date('H:i:s'), " Done reading file", EOL;
79
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/Quadratic2.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -33,30 +33,30 @@
 block discarded – undo
33 33
 <?php
34 34
 /**	If the user has submitted the form, then we need to execute a calculation **/
35 35
 if (isset($_POST['submit'])) {
36
-	if ($_POST['A'] == 0) {
37
-		echo 'The equation is not quadratic';
38
-	} else {
39
-		/**	So we include PHPExcel to perform the calculations	**/
40
-		include 'PHPExcel/Calculation.php';
36
+    if ($_POST['A'] == 0) {
37
+        echo 'The equation is not quadratic';
38
+    } else {
39
+        /**	So we include PHPExcel to perform the calculations	**/
40
+        include 'PHPExcel/Calculation.php';
41 41
 
42
-		/**	Calculate and Display the results			**/
43
-		echo '<hr /><b>Roots:</b><br />';
42
+        /**	Calculate and Display the results			**/
43
+        echo '<hr /><b>Roots:</b><br />';
44 44
 
45
-		$callStartTime = microtime(true);
46
-		$discriminantFormula = '=POWER('.$_POST['B'].',2) - (4 * '.$_POST['A'].' * '.$_POST['C'].')';
47
-		$discriminant = PHPExcel_Calculation::getInstance()->calculateFormula($discriminantFormula);
45
+        $callStartTime = microtime(true);
46
+        $discriminantFormula = '=POWER('.$_POST['B'].',2) - (4 * '.$_POST['A'].' * '.$_POST['C'].')';
47
+        $discriminant = PHPExcel_Calculation::getInstance()->calculateFormula($discriminantFormula);
48 48
 
49
-		$r1Formula = '=IMDIV(IMSUM(-'.$_POST['B'].',IMSQRT('.$discriminant.')),2 * '.$_POST['A'].')';
50
-		$r2Formula = '=IF('.$discriminant.'=0,"Only one root",IMDIV(IMSUB(-'.$_POST['B'].',IMSQRT('.$discriminant.')),2 * '.$_POST['A'].'))';
49
+        $r1Formula = '=IMDIV(IMSUM(-'.$_POST['B'].',IMSQRT('.$discriminant.')),2 * '.$_POST['A'].')';
50
+        $r2Formula = '=IF('.$discriminant.'=0,"Only one root",IMDIV(IMSUB(-'.$_POST['B'].',IMSQRT('.$discriminant.')),2 * '.$_POST['A'].'))';
51 51
 
52
-		echo PHPExcel_Calculation::getInstance()->calculateFormula($r1Formula).'<br />';
53
-		echo PHPExcel_Calculation::getInstance()->calculateFormula($r2Formula).'<br />';
54
-		$callEndTime = microtime(true);
55
-		$callTime = $callEndTime - $callStartTime;
52
+        echo PHPExcel_Calculation::getInstance()->calculateFormula($r1Formula).'<br />';
53
+        echo PHPExcel_Calculation::getInstance()->calculateFormula($r2Formula).'<br />';
54
+        $callEndTime = microtime(true);
55
+        $callTime = $callEndTime - $callStartTime;
56 56
 
57
-		echo '<hr />Call time for Quadratic Equation Solution was '.sprintf('%.4f',$callTime).' seconds<br /><hr />';
58
-		echo ' Peak memory usage: '.(memory_get_peak_usage(true) / 1024 / 1024).' MB<br />';
59
-	}
57
+        echo '<hr />Call time for Quadratic Equation Solution was '.sprintf('%.4f',$callTime).' seconds<br /><hr />';
58
+        echo ' Peak memory usage: '.(memory_get_peak_usage(true) / 1024 / 1024).' MB<br />';
59
+    }
60 60
 }
61 61
 
62 62
 ?>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -43,19 +43,19 @@
 block discarded – undo
43 43
 		echo '<hr /><b>Roots:</b><br />';
44 44
 
45 45
 		$callStartTime = microtime(true);
46
-		$discriminantFormula = '=POWER('.$_POST['B'].',2) - (4 * '.$_POST['A'].' * '.$_POST['C'].')';
46
+		$discriminantFormula = '=POWER(' . $_POST['B'] . ',2) - (4 * ' . $_POST['A'] . ' * ' . $_POST['C'] . ')';
47 47
 		$discriminant = PHPExcel_Calculation::getInstance()->calculateFormula($discriminantFormula);
48 48
 
49
-		$r1Formula = '=IMDIV(IMSUM(-'.$_POST['B'].',IMSQRT('.$discriminant.')),2 * '.$_POST['A'].')';
50
-		$r2Formula = '=IF('.$discriminant.'=0,"Only one root",IMDIV(IMSUB(-'.$_POST['B'].',IMSQRT('.$discriminant.')),2 * '.$_POST['A'].'))';
49
+		$r1Formula = '=IMDIV(IMSUM(-' . $_POST['B'] . ',IMSQRT(' . $discriminant . ')),2 * ' . $_POST['A'] . ')';
50
+		$r2Formula = '=IF(' . $discriminant . '=0,"Only one root",IMDIV(IMSUB(-' . $_POST['B'] . ',IMSQRT(' . $discriminant . ')),2 * ' . $_POST['A'] . '))';
51 51
 
52
-		echo PHPExcel_Calculation::getInstance()->calculateFormula($r1Formula).'<br />';
53
-		echo PHPExcel_Calculation::getInstance()->calculateFormula($r2Formula).'<br />';
52
+		echo PHPExcel_Calculation::getInstance()->calculateFormula($r1Formula) . '<br />';
53
+		echo PHPExcel_Calculation::getInstance()->calculateFormula($r2Formula) . '<br />';
54 54
 		$callEndTime = microtime(true);
55 55
 		$callTime = $callEndTime - $callStartTime;
56 56
 
57
-		echo '<hr />Call time for Quadratic Equation Solution was '.sprintf('%.4f',$callTime).' seconds<br /><hr />';
58
-		echo ' Peak memory usage: '.(memory_get_peak_usage(true) / 1024 / 1024).' MB<br />';
57
+		echo '<hr />Call time for Quadratic Equation Solution was ' . sprintf('%.4f', $callTime) . ' seconds<br /><hr />';
58
+		echo ' Peak memory usage: ' . (memory_get_peak_usage(true) / 1024 / 1024) . ' MB<br />';
59 59
 	}
60 60
 }
61 61
 
Please login to merge, or discard this patch.
Examples/33chartcreate-composite.php 2 patches
Indentation   +48 added lines, -48 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('',		'Rainfall (mm)',	'Temperature (°F)',	'Humidity (%)'),
48
-		array('Jan',		78,   				52,					61),
49
-		array('Feb',		64,   				54,					62),
50
-		array('Mar',		62,   				57,					63),
51
-		array('Apr',		21,   				62,					59),
52
-		array('May',		11,   				75,					60),
53
-		array('Jun',		1,   				75,					57),
54
-		array('Jul',		1,   				79,					56),
55
-		array('Aug',		1,   				79,					59),
56
-		array('Sep',		10,   				75,					60),
57
-		array('Oct',		40,   				68,					63),
58
-		array('Nov',		69,   				62,					64),
59
-		array('Dec',		89,   				57,					66),
60
-	)
46
+    array(
47
+        array('',		'Rainfall (mm)',	'Temperature (°F)',	'Humidity (%)'),
48
+        array('Jan',		78,   				52,					61),
49
+        array('Feb',		64,   				54,					62),
50
+        array('Mar',		62,   				57,					63),
51
+        array('Apr',		21,   				62,					59),
52
+        array('May',		11,   				75,					60),
53
+        array('Jun',		1,   				75,					57),
54
+        array('Jul',		1,   				79,					56),
55
+        array('Aug',		1,   				79,					59),
56
+        array('Sep',		10,   				75,					60),
57
+        array('Oct',		40,   				68,					63),
58
+        array('Nov',		69,   				62,					64),
59
+        array('Dec',		89,   				57,					66),
60
+    )
61 61
 );
62 62
 
63 63
 
@@ -69,13 +69,13 @@  discard block
 block discarded – undo
69 69
 //		Data values
70 70
 //		Data Marker
71 71
 $dataSeriesLabels1 = array(
72
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1),	//	Temperature
72
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1),	//	Temperature
73 73
 );
74 74
 $dataSeriesLabels2 = array(
75
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	Rainfall
75
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	Rainfall
76 76
 );
77 77
 $dataSeriesLabels3 = array(
78
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1),	//	Humidity
78
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1),	//	Humidity
79 79
 );
80 80
 
81 81
 //	Set the X-Axis Labels
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 //		Data values
87 87
 //		Data Marker
88 88
 $xAxisTickValues = array(
89
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', NULL, 12),	//	Jan to Dec
89
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', NULL, 12),	//	Jan to Dec
90 90
 );
91 91
 
92 92
 
@@ -98,17 +98,17 @@  discard block
 block discarded – undo
98 98
 //		Data values
99 99
 //		Data Marker
100 100
 $dataSeriesValues1 = array(
101
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$13', NULL, 12),
101
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$13', NULL, 12),
102 102
 );
103 103
 
104 104
 //	Build the dataseries
105 105
 $series1 = new \PHPExcel\Chart\DataSeries(
106
-	\PHPExcel\Chart\DataSeries::TYPE_BARCHART,		// plotType
107
-	\PHPExcel\Chart\DataSeries::GROUPING_CLUSTERED,	// plotGrouping
108
-	range(0, count($dataSeriesValues1)-1),			// plotOrder
109
-	$dataSeriesLabels1,								// plotLabel
110
-	$xAxisTickValues,								// plotCategory
111
-	$dataSeriesValues1								// plotValues
106
+    \PHPExcel\Chart\DataSeries::TYPE_BARCHART,		// plotType
107
+    \PHPExcel\Chart\DataSeries::GROUPING_CLUSTERED,	// plotGrouping
108
+    range(0, count($dataSeriesValues1)-1),			// plotOrder
109
+    $dataSeriesLabels1,								// plotLabel
110
+    $xAxisTickValues,								// plotCategory
111
+    $dataSeriesValues1								// plotValues
112 112
 );
113 113
 //	Set additional dataseries parameters
114 114
 //		Make it a vertical column rather than a horizontal bar graph
@@ -123,17 +123,17 @@  discard block
 block discarded – undo
123 123
 //		Data values
124 124
 //		Data Marker
125 125
 $dataSeriesValues2 = array(
126
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$13', NULL, 12),
126
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$13', NULL, 12),
127 127
 );
128 128
 
129 129
 //	Build the dataseries
130 130
 $series2 = new \PHPExcel\Chart\DataSeries(
131
-	\PHPExcel\Chart\DataSeries::TYPE_LINECHART,		// plotType
132
-	\PHPExcel\Chart\DataSeries::GROUPING_STANDARD,	// plotGrouping
133
-	range(0, count($dataSeriesValues2)-1),			// plotOrder
134
-	$dataSeriesLabels2,								// plotLabel
135
-	NULL,											// plotCategory
136
-	$dataSeriesValues2								// plotValues
131
+    \PHPExcel\Chart\DataSeries::TYPE_LINECHART,		// plotType
132
+    \PHPExcel\Chart\DataSeries::GROUPING_STANDARD,	// plotGrouping
133
+    range(0, count($dataSeriesValues2)-1),			// plotOrder
134
+    $dataSeriesLabels2,								// plotLabel
135
+    NULL,											// plotCategory
136
+    $dataSeriesValues2								// plotValues
137 137
 );
138 138
 
139 139
 
@@ -145,17 +145,17 @@  discard block
 block discarded – undo
145 145
 //		Data values
146 146
 //		Data Marker
147 147
 $dataSeriesValues3 = array(
148
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$13', NULL, 12),
148
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$13', NULL, 12),
149 149
 );
150 150
 
151 151
 //	Build the dataseries
152 152
 $series3 = new \PHPExcel\Chart\DataSeries(
153
-	\PHPExcel\Chart\DataSeries::TYPE_AREACHART,		// plotType
154
-	\PHPExcel\Chart\DataSeries::GROUPING_STANDARD,	// plotGrouping
155
-	range(0, count($dataSeriesValues2)-1),			// plotOrder
156
-	$dataSeriesLabels3,								// plotLabel
157
-	NULL,											// plotCategory
158
-	$dataSeriesValues3								// plotValues
153
+    \PHPExcel\Chart\DataSeries::TYPE_AREACHART,		// plotType
154
+    \PHPExcel\Chart\DataSeries::GROUPING_STANDARD,	// plotGrouping
155
+    range(0, count($dataSeriesValues2)-1),			// plotOrder
156
+    $dataSeriesLabels3,								// plotLabel
157
+    NULL,											// plotCategory
158
+    $dataSeriesValues3								// plotValues
159 159
 );
160 160
 
161 161
 
@@ -169,14 +169,14 @@  discard block
 block discarded – undo
169 169
 
170 170
 //	Create the chart
171 171
 $chart = new \PHPExcel\Chart(
172
-	'chart1',		// name
173
-	$title,			// title
174
-	$legend,		// legend
175
-	$plotArea,		// plotArea
176
-	true,			// plotVisibleOnly
177
-	0,				// displayBlanksAs
178
-	NULL,			// xAxisLabel
179
-	NULL			// yAxisLabel
172
+    'chart1',		// name
173
+    $title,			// title
174
+    $legend,		// legend
175
+    $plotArea,		// plotArea
176
+    true,			// plotVisibleOnly
177
+    0,				// displayBlanksAs
178
+    NULL,			// xAxisLabel
179
+    NULL			// yAxisLabel
180 180
 );
181 181
 
182 182
 //	Set the position where the chart should appear in the worksheet
Please login to merge, or discard this patch.
Spacing   +45 added lines, -45 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('',		'Rainfall (mm)',	'Temperature (°F)',	'Humidity (%)'),
48
-		array('Jan',		78,   				52,					61),
49
-		array('Feb',		64,   				54,					62),
50
-		array('Mar',		62,   				57,					63),
51
-		array('Apr',		21,   				62,					59),
52
-		array('May',		11,   				75,					60),
53
-		array('Jun',		1,   				75,					57),
54
-		array('Jul',		1,   				79,					56),
55
-		array('Aug',		1,   				79,					59),
56
-		array('Sep',		10,   				75,					60),
57
-		array('Oct',		40,   				68,					63),
58
-		array('Nov',		69,   				62,					64),
59
-		array('Dec',		89,   				57,					66),
47
+		array('', 'Rainfall (mm)', 'Temperature (°F)', 'Humidity (%)'),
48
+		array('Jan', 78, 52, 61),
49
+		array('Feb', 64, 54, 62),
50
+		array('Mar', 62, 57, 63),
51
+		array('Apr', 21, 62, 59),
52
+		array('May', 11, 75, 60),
53
+		array('Jun', 1, 75, 57),
54
+		array('Jul', 1, 79, 56),
55
+		array('Aug', 1, 79, 59),
56
+		array('Sep', 10, 75, 60),
57
+		array('Oct', 40, 68, 63),
58
+		array('Nov', 69, 62, 64),
59
+		array('Dec', 89, 57, 66),
60 60
 	)
61 61
 );
62 62
 
@@ -69,13 +69,13 @@  discard block
 block discarded – undo
69 69
 //		Data values
70 70
 //		Data Marker
71 71
 $dataSeriesLabels1 = array(
72
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1),	//	Temperature
72
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1), //	Temperature
73 73
 );
74 74
 $dataSeriesLabels2 = array(
75
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	Rainfall
75
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1), //	Rainfall
76 76
 );
77 77
 $dataSeriesLabels3 = array(
78
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1),	//	Humidity
78
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1), //	Humidity
79 79
 );
80 80
 
81 81
 //	Set the X-Axis Labels
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 //		Data values
87 87
 //		Data Marker
88 88
 $xAxisTickValues = array(
89
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', NULL, 12),	//	Jan to Dec
89
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$13', NULL, 12), //	Jan to Dec
90 90
 );
91 91
 
92 92
 
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
 
104 104
 //	Build the dataseries
105 105
 $series1 = new \PHPExcel\Chart\DataSeries(
106
-	\PHPExcel\Chart\DataSeries::TYPE_BARCHART,		// plotType
107
-	\PHPExcel\Chart\DataSeries::GROUPING_CLUSTERED,	// plotGrouping
108
-	range(0, count($dataSeriesValues1)-1),			// plotOrder
109
-	$dataSeriesLabels1,								// plotLabel
110
-	$xAxisTickValues,								// plotCategory
106
+	\PHPExcel\Chart\DataSeries::TYPE_BARCHART, // plotType
107
+	\PHPExcel\Chart\DataSeries::GROUPING_CLUSTERED, // plotGrouping
108
+	range(0, count($dataSeriesValues1) - 1), // plotOrder
109
+	$dataSeriesLabels1, // plotLabel
110
+	$xAxisTickValues, // plotCategory
111 111
 	$dataSeriesValues1								// plotValues
112 112
 );
113 113
 //	Set additional dataseries parameters
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
 
129 129
 //	Build the dataseries
130 130
 $series2 = new \PHPExcel\Chart\DataSeries(
131
-	\PHPExcel\Chart\DataSeries::TYPE_LINECHART,		// plotType
132
-	\PHPExcel\Chart\DataSeries::GROUPING_STANDARD,	// plotGrouping
133
-	range(0, count($dataSeriesValues2)-1),			// plotOrder
134
-	$dataSeriesLabels2,								// plotLabel
135
-	NULL,											// plotCategory
131
+	\PHPExcel\Chart\DataSeries::TYPE_LINECHART, // plotType
132
+	\PHPExcel\Chart\DataSeries::GROUPING_STANDARD, // plotGrouping
133
+	range(0, count($dataSeriesValues2) - 1), // plotOrder
134
+	$dataSeriesLabels2, // plotLabel
135
+	NULL, // plotCategory
136 136
 	$dataSeriesValues2								// plotValues
137 137
 );
138 138
 
@@ -150,11 +150,11 @@  discard block
 block discarded – undo
150 150
 
151 151
 //	Build the dataseries
152 152
 $series3 = new \PHPExcel\Chart\DataSeries(
153
-	\PHPExcel\Chart\DataSeries::TYPE_AREACHART,		// plotType
154
-	\PHPExcel\Chart\DataSeries::GROUPING_STANDARD,	// plotGrouping
155
-	range(0, count($dataSeriesValues2)-1),			// plotOrder
156
-	$dataSeriesLabels3,								// plotLabel
157
-	NULL,											// plotCategory
153
+	\PHPExcel\Chart\DataSeries::TYPE_AREACHART, // plotType
154
+	\PHPExcel\Chart\DataSeries::GROUPING_STANDARD, // plotGrouping
155
+	range(0, count($dataSeriesValues2) - 1), // plotOrder
156
+	$dataSeriesLabels3, // plotLabel
157
+	NULL, // plotCategory
158 158
 	$dataSeriesValues3								// plotValues
159 159
 );
160 160
 
@@ -169,13 +169,13 @@  discard block
 block discarded – undo
169 169
 
170 170
 //	Create the chart
171 171
 $chart = new \PHPExcel\Chart(
172
-	'chart1',		// name
173
-	$title,			// title
174
-	$legend,		// legend
175
-	$plotArea,		// plotArea
176
-	true,			// plotVisibleOnly
177
-	0,				// displayBlanksAs
178
-	NULL,			// xAxisLabel
172
+	'chart1', // name
173
+	$title, // title
174
+	$legend, // legend
175
+	$plotArea, // plotArea
176
+	true, // plotVisibleOnly
177
+	0, // displayBlanksAs
178
+	NULL, // xAxisLabel
179 179
 	NULL			// yAxisLabel
180 180
 );
181 181
 
@@ -188,16 +188,16 @@  discard block
 block discarded – undo
188 188
 
189 189
 
190 190
 // Save Excel 2007 file
191
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
191
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
192 192
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
193 193
 $objWriter->setIncludeCharts(TRUE);
194 194
 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
195
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
195
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
196 196
 
197 197
 
198 198
 // Echo memory peak usage
199
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
199
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
200 200
 
201 201
 // Echo done
202
-echo date('H:i:s') , " Done writing file" , EOL;
203
-echo 'File has been created in ' , getcwd() , EOL;
202
+echo date('H:i:s'), " Done writing file", EOL;
203
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/06largescale.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 ini_set('display_errors', TRUE);
31 31
 ini_set('display_startup_errors', TRUE);
32 32
 
33
-define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
33
+define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
34 34
 
35 35
 date_default_timezone_set('Europe/London');
36 36
 
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
 */
54 54
 
55 55
 // Create new PHPExcel object
56
-echo date('H:i:s') , " Create new PHPExcel object" , EOL;
56
+echo date('H:i:s'), " Create new PHPExcel object", EOL;
57 57
 $objPHPExcel = new \PHPExcel\Spreadsheet();
58 58
 
59 59
 // Set document properties
60
-echo date('H:i:s') , " Set properties" , EOL;
60
+echo date('H:i:s'), " Set properties", EOL;
61 61
 $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
62 62
 							 ->setLastModifiedBy("Maarten Balliauw")
63 63
 							 ->setTitle("Office 2007 XLSX Test Document")
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
 
70 70
 // Create a first sheet
71
-echo date('H:i:s') , " Add data" , EOL;
71
+echo date('H:i:s'), " Add data", EOL;
72 72
 $objPHPExcel->setActiveSheetIndex(0);
73 73
 $objPHPExcel->getActiveSheet()->setCellValue('A1', "Firstname");
74 74
 $objPHPExcel->getActiveSheet()->setCellValue('B1', "Lastname");
@@ -78,24 +78,24 @@  discard block
 block discarded – undo
78 78
 
79 79
 
80 80
 // Hide "Phone" and "fax" column
81
-echo date('H:i:s') , " Hide 'Phone' and 'fax' columns" , EOL;
81
+echo date('H:i:s'), " Hide 'Phone' and 'fax' columns", EOL;
82 82
 $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setVisible(false);
83 83
 $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setVisible(false);
84 84
 
85 85
 
86 86
 // Set outline levels
87
-echo date('H:i:s') , " Set outline levels" , EOL;
87
+echo date('H:i:s'), " Set outline levels", EOL;
88 88
 $objPHPExcel->getActiveSheet()->getColumnDimension('E')->setOutlineLevel(1)
89 89
                                                        ->setVisible(false)
90 90
                                                        ->setCollapsed(true);
91 91
 
92 92
 // Freeze panes
93
-echo date('H:i:s') , " Freeze panes" , EOL;
93
+echo date('H:i:s'), " Freeze panes", EOL;
94 94
 $objPHPExcel->getActiveSheet()->freezePane('A2');
95 95
 
96 96
 
97 97
 // Rows to repeat at top
98
-echo date('H:i:s') , " Rows to repeat at top" , EOL;
98
+echo date('H:i:s'), " Rows to repeat at top", EOL;
99 99
 $objPHPExcel->getActiveSheet()->getPageSetup()->setRowsToRepeatAtTopByStartAndEnd(1, 1);
100 100
 
101 101
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 
115 115
 
116 116
 // Save Excel 2007 file
117
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
117
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
118 118
 $callStartTime = microtime(true);
119 119
 
120 120
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
@@ -122,15 +122,15 @@  discard block
 block discarded – undo
122 122
 $callEndTime = microtime(true);
123 123
 $callTime = $callEndTime - $callStartTime;
124 124
 
125
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
126
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
125
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
126
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
127 127
 // Echo memory usage
128
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
128
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
129 129
 
130 130
 
131 131
 // Echo memory peak usage
132
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
132
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
133 133
 
134 134
 // Echo done
135
-echo date('H:i:s') , " Done writing file" , EOL;
136
-echo 'File has been created in ' , getcwd() , EOL;
135
+echo date('H:i:s'), " Done writing file", EOL;
136
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
 // Set document properties
53 53
 echo date('H:i:s') , " Set properties" , EOL;
54 54
 $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
55
-							 ->setLastModifiedBy("Maarten Balliauw")
56
-							 ->setTitle("Office 2007 XLSX Test Document")
57
-							 ->setSubject("Office 2007 XLSX Test Document")
58
-							 ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
59
-							 ->setKeywords("office 2007 openxml php")
60
-							 ->setCategory("Test result file");
55
+                                ->setLastModifiedBy("Maarten Balliauw")
56
+                                ->setTitle("Office 2007 XLSX Test Document")
57
+                                ->setSubject("Office 2007 XLSX Test Document")
58
+                                ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
59
+                                ->setKeywords("office 2007 openxml php")
60
+                                ->setCategory("Test result file");
61 61
 
62 62
 
63 63
 // Create a first sheet
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 // Set outline levels
80 80
 echo date('H:i:s') , " Set outline levels" , EOL;
81 81
 $objPHPExcel->getActiveSheet()->getColumnDimension('E')->setOutlineLevel(1)
82
-                                                       ->setVisible(false)
83
-                                                       ->setCollapsed(true);
82
+                                                        ->setVisible(false)
83
+                                                        ->setCollapsed(true);
84 84
 
85 85
 // Freeze panes
86 86
 echo date('H:i:s') , " Freeze panes" , EOL;
@@ -94,11 +94,11 @@  discard block
 block discarded – undo
94 94
 
95 95
 // Add data
96 96
 for ($i = 2; $i <= 5000; $i++) {
97
-	$objPHPExcel->getActiveSheet()->setCellValue('A' . $i, "FName $i")
98
-	                              ->setCellValue('B' . $i, "LName $i")
99
-	                              ->setCellValue('C' . $i, "PhoneNo $i")
100
-	                              ->setCellValue('D' . $i, "FaxNo $i")
101
-	                              ->setCellValue('E' . $i, true);
97
+    $objPHPExcel->getActiveSheet()->setCellValue('A' . $i, "FName $i")
98
+                                    ->setCellValue('B' . $i, "LName $i")
99
+                                    ->setCellValue('C' . $i, "PhoneNo $i")
100
+                                    ->setCellValue('D' . $i, "FaxNo $i")
101
+                                    ->setCellValue('E' . $i, true);
102 102
 }
103 103
 
104 104
 
Please login to merge, or discard this patch.
Examples/09pagebreaks.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -45,37 +45,37 @@
 block discarded – undo
45 45
 // Set document properties
46 46
 echo date('H:i:s') , " Set document properties" , EOL;
47 47
 $objPHPExcel->getProperties()->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
 
56 56
 // Create a first sheet
57 57
 echo date('H:i:s') , " Add data and page breaks" , EOL;
58 58
 $objPHPExcel->setActiveSheetIndex(0);
59 59
 $objPHPExcel->getActiveSheet()->setCellValue('A1', "Firstname")
60
-                              ->setCellValue('B1', "Lastname")
61
-                              ->setCellValue('C1', "Phone")
62
-                              ->setCellValue('D1', "Fax")
63
-                              ->setCellValue('E1', "Is Client ?");
60
+                                ->setCellValue('B1', "Lastname")
61
+                                ->setCellValue('C1', "Phone")
62
+                                ->setCellValue('D1', "Fax")
63
+                                ->setCellValue('E1', "Is Client ?");
64 64
 
65 65
 
66 66
 // Add data
67 67
 for ($i = 2; $i <= 50; $i++) {
68
-	$objPHPExcel->getActiveSheet()->setCellValue('A' . $i, "FName $i");
69
-	$objPHPExcel->getActiveSheet()->setCellValue('B' . $i, "LName $i");
70
-	$objPHPExcel->getActiveSheet()->setCellValue('C' . $i, "PhoneNo $i");
71
-	$objPHPExcel->getActiveSheet()->setCellValue('D' . $i, "FaxNo $i");
72
-	$objPHPExcel->getActiveSheet()->setCellValue('E' . $i, true);
73
-
74
-	// Add page breaks every 10 rows
75
-	if ($i % 10 == 0) {
76
-		// Add a page break
77
-		$objPHPExcel->getActiveSheet()->setBreak( 'A' . $i, \PHPExcel\Worksheet::BREAK_ROW );
78
-	}
68
+    $objPHPExcel->getActiveSheet()->setCellValue('A' . $i, "FName $i");
69
+    $objPHPExcel->getActiveSheet()->setCellValue('B' . $i, "LName $i");
70
+    $objPHPExcel->getActiveSheet()->setCellValue('C' . $i, "PhoneNo $i");
71
+    $objPHPExcel->getActiveSheet()->setCellValue('D' . $i, "FaxNo $i");
72
+    $objPHPExcel->getActiveSheet()->setCellValue('E' . $i, true);
73
+
74
+    // Add page breaks every 10 rows
75
+    if ($i % 10 == 0) {
76
+        // Add a page break
77
+        $objPHPExcel->getActiveSheet()->setBreak( 'A' . $i, \PHPExcel\Worksheet::BREAK_ROW );
78
+    }
79 79
 }
80 80
 
81 81
 // Set active sheet index to the first sheet, so Excel opens this as the first sheet
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 ini_set('display_errors', TRUE);
31 31
 ini_set('display_startup_errors', TRUE);
32 32
 
33
-define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
33
+define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
34 34
 
35 35
 date_default_timezone_set('Europe/London');
36 36
 
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
 
40 40
 
41 41
 // Create new PHPExcel object
42
-echo date('H:i:s') , " Create new PHPExcel object" , EOL;
42
+echo date('H:i:s'), " Create new PHPExcel object", EOL;
43 43
 $objPHPExcel = new \PHPExcel\Spreadsheet();
44 44
 
45 45
 // Set document properties
46
-echo date('H:i:s') , " Set document properties" , EOL;
46
+echo date('H:i:s'), " Set document properties", EOL;
47 47
 $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
48 48
 							 ->setLastModifiedBy("Maarten Balliauw")
49 49
 							 ->setTitle("Office 2007 XLSX Test Document")
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 
56 56
 // Create a first sheet
57
-echo date('H:i:s') , " Add data and page breaks" , EOL;
57
+echo date('H:i:s'), " Add data and page breaks", EOL;
58 58
 $objPHPExcel->setActiveSheetIndex(0);
59 59
 $objPHPExcel->getActiveSheet()->setCellValue('A1', "Firstname")
60 60
                               ->setCellValue('B1', "Lastname")
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	// Add page breaks every 10 rows
75 75
 	if ($i % 10 == 0) {
76 76
 		// Add a page break
77
-		$objPHPExcel->getActiveSheet()->setBreak( 'A' . $i, \PHPExcel\Worksheet::BREAK_ROW );
77
+		$objPHPExcel->getActiveSheet()->setBreak('A' . $i, \PHPExcel\Worksheet::BREAK_ROW);
78 78
 	}
79 79
 }
80 80
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
 
99 99
 // Save Excel 2007 file
100
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
100
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
101 101
 $callStartTime = microtime(true);
102 102
 
103 103
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
 $callEndTime = microtime(true);
106 106
 $callTime = $callEndTime - $callStartTime;
107 107
 
108
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
109
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
108
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
109
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
110 110
 // Echo memory usage
111
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
111
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
112 112
 
113 113
 
114 114
 // Save Excel 95 file
115
-echo date('H:i:s') , " Write to Excel5 format" , EOL;
115
+echo date('H:i:s'), " Write to Excel5 format", EOL;
116 116
 $callStartTime = microtime(true);
117 117
 
118 118
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
@@ -120,15 +120,15 @@  discard block
 block discarded – undo
120 120
 $callEndTime = microtime(true);
121 121
 $callTime = $callEndTime - $callStartTime;
122 122
 
123
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
124
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
123
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
124
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
125 125
 // Echo memory usage
126
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
126
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
127 127
 
128 128
 
129 129
 // Echo memory peak usage
130
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
130
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
131 131
 
132 132
 // Echo done
133
-echo date('H:i:s') , " Done writing files" , EOL;
134
-echo 'Files have been created in ' , getcwd() , EOL;
133
+echo date('H:i:s'), " Done writing files", EOL;
134
+echo 'Files have been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.