Completed
Push — develop ( e87ec8...e0a9f9 )
by
unknown
14:57
created
Examples/10autofilter-selection-1.php 2 patches
Indentation   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -44,23 +44,23 @@  discard block
 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
 // Create the worksheet
55 55
 echo date('H:i:s').' Add data'.EOL;
56 56
 $objPHPExcel->setActiveSheetIndex(0);
57 57
 $objPHPExcel->getActiveSheet()->setCellValue('A1', 'Financial Year')
58
-                              ->setCellValue('B1', 'Financial Period')
59
-                              ->setCellValue('C1', 'Country')
60
-                              ->setCellValue('D1', 'Date')
61
-                              ->setCellValue('E1', 'Sales Value')
62
-                              ->setCellValue('F1', 'Expenditure')
63
-                              ;
58
+                                ->setCellValue('B1', 'Financial Period')
59
+                                ->setCellValue('C1', 'Country')
60
+                                ->setCellValue('D1', 'Date')
61
+                                ->setCellValue('E1', 'Sales Value')
62
+                                ->setCellValue('F1', 'Expenditure')
63
+                                ;
64 64
 $startYear = $endYear = $currentYear = date('Y');
65 65
 $startYear--;
66 66
 $endYear++;
@@ -68,44 +68,44 @@  discard block
 block discarded – undo
68 68
 $years = range($startYear,$endYear);
69 69
 $periods = range(1,12);
70 70
 $countries = array(	'United States',	'UK',		'France',	'Germany',
71
-					'Italy',			'Spain',	'Portugal',	'Japan'
72
-				  );
71
+                    'Italy',			'Spain',	'Portugal',	'Japan'
72
+                    );
73 73
 
74 74
 $row = 2;
75 75
 foreach($years as $year) {
76
-	foreach($periods as $period) {
77
-		foreach($countries as $country) {
78
-			$endDays = date('t',mktime(0,0,0,$period,1,$year));
79
-			for($i = 1; $i <= $endDays; ++$i) {
80
-				$eDate = \PHPExcel\Shared\Date::formattedPHPToExcel(
81
-					$year,
82
-					$period,
83
-					$i
84
-				);
85
-				$value = rand(500,1000) * (1 + rand(-0.25,+0.25));
86
-				$salesValue = $invoiceValue = NULL;
87
-				$incomeOrExpenditure = rand(-1,1);
88
-				if ($incomeOrExpenditure == -1) {
89
-					$expenditure = rand(-500,-1000) * (1 + rand(-0.25,+0.25));
90
-					$income = NULL;
91
-				} elseif ($incomeOrExpenditure == 1) {
92
-					$expenditure = rand(-500,-1000) * (1 + rand(-0.25,+0.25));
93
-					$income = rand(500,1000) * (1 + rand(-0.25,+0.25));;
94
-				} else {
95
-					$expenditure = NULL;
96
-					$income = rand(500,1000) * (1 + rand(-0.25,+0.25));;
97
-				}
98
-				$dataArray = array(	$year,
99
-									$period,
100
-									$country,
101
-									$eDate,
102
-									$income,
103
-									$expenditure,
104
-								  );
105
-				$objPHPExcel->getActiveSheet()->fromArray($dataArray, NULL, 'A'.$row++);
106
-			}
107
-		}
108
-	}
76
+    foreach($periods as $period) {
77
+        foreach($countries as $country) {
78
+            $endDays = date('t',mktime(0,0,0,$period,1,$year));
79
+            for($i = 1; $i <= $endDays; ++$i) {
80
+                $eDate = \PHPExcel\Shared\Date::formattedPHPToExcel(
81
+                    $year,
82
+                    $period,
83
+                    $i
84
+                );
85
+                $value = rand(500,1000) * (1 + rand(-0.25,+0.25));
86
+                $salesValue = $invoiceValue = NULL;
87
+                $incomeOrExpenditure = rand(-1,1);
88
+                if ($incomeOrExpenditure == -1) {
89
+                    $expenditure = rand(-500,-1000) * (1 + rand(-0.25,+0.25));
90
+                    $income = NULL;
91
+                } elseif ($incomeOrExpenditure == 1) {
92
+                    $expenditure = rand(-500,-1000) * (1 + rand(-0.25,+0.25));
93
+                    $income = rand(500,1000) * (1 + rand(-0.25,+0.25));;
94
+                } else {
95
+                    $expenditure = NULL;
96
+                    $income = rand(500,1000) * (1 + rand(-0.25,+0.25));;
97
+                }
98
+                $dataArray = array(	$year,
99
+                                    $period,
100
+                                    $country,
101
+                                    $eDate,
102
+                                    $income,
103
+                                    $expenditure,
104
+                                    );
105
+                $objPHPExcel->getActiveSheet()->fromArray($dataArray, NULL, 'A'.$row++);
106
+            }
107
+        }
108
+    }
109 109
 }
110 110
 $row--;
111 111
 
@@ -138,45 +138,45 @@  discard block
 block discarded – undo
138 138
 $autoFilter->getColumn('C')
139 139
     ->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER)
140 140
     ->createRule()
141
-		->setRule(
142
-			\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL,
143
-			'u*'
144
-		)
145
-		->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER);
141
+        ->setRule(
142
+            \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL,
143
+            'u*'
144
+        )
145
+        ->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER);
146 146
 $autoFilter->getColumn('C')
147 147
     ->createRule()
148
-		->setRule(
149
-			\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL,
150
-			'japan'
151
-		)
152
-		->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER);
148
+        ->setRule(
149
+            \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL,
150
+            'japan'
151
+        )
152
+        ->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER);
153 153
 // Filter the Date column on a filter value of the first day of every period of the current year
154 154
 //	We us a dateGroup ruletype for this, although it is still a standard filter
155 155
 foreach($periods as $period) {
156
-	$endDate = date('t',mktime(0,0,0,$period,1,$currentYear));
157
-
158
-	$autoFilter->getColumn('D')
159
-	    ->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER)
160
-	    ->createRule()
161
-			->setRule(
162
-				\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL,
163
-				array(
164
-					'year' => $currentYear,
165
-					'month' => $period,
166
-					'day' => $endDate
167
-				)
168
-			)
169
-			->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP);
156
+    $endDate = date('t',mktime(0,0,0,$period,1,$currentYear));
157
+
158
+    $autoFilter->getColumn('D')
159
+        ->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER)
160
+        ->createRule()
161
+            ->setRule(
162
+                \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL,
163
+                array(
164
+                    'year' => $currentYear,
165
+                    'month' => $period,
166
+                    'day' => $endDate
167
+                )
168
+            )
169
+            ->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP);
170 170
 }
171 171
 // Display only sales values that are blank
172 172
 //     Standard filter, operator equals, and value of NULL
173 173
 $autoFilter->getColumn('E')
174 174
     ->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER)
175 175
     ->createRule()
176
-		->setRule(
177
-			\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL,
178
-			''
179
-		);
176
+        ->setRule(
177
+            \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL,
178
+            ''
179
+        );
180 180
 
181 181
 
182 182
 // 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   +39 added lines, -39 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')
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 							 ->setCategory('Test result file');
53 53
 
54 54
 // Create the worksheet
55
-echo date('H:i:s').' Add data'.EOL;
55
+echo date('H:i:s') . ' Add data' . EOL;
56 56
 $objPHPExcel->setActiveSheetIndex(0);
57 57
 $objPHPExcel->getActiveSheet()->setCellValue('A1', 'Financial Year')
58 58
                               ->setCellValue('B1', 'Financial Period')
@@ -65,44 +65,44 @@  discard block
 block discarded – undo
65 65
 $startYear--;
66 66
 $endYear++;
67 67
 
68
-$years = range($startYear,$endYear);
69
-$periods = range(1,12);
70
-$countries = array(	'United States',	'UK',		'France',	'Germany',
71
-					'Italy',			'Spain',	'Portugal',	'Japan'
68
+$years = range($startYear, $endYear);
69
+$periods = range(1, 12);
70
+$countries = array('United States', 'UK', 'France', 'Germany',
71
+					'Italy', 'Spain', 'Portugal', 'Japan'
72 72
 				  );
73 73
 
74 74
 $row = 2;
75
-foreach($years as $year) {
76
-	foreach($periods as $period) {
77
-		foreach($countries as $country) {
78
-			$endDays = date('t',mktime(0,0,0,$period,1,$year));
79
-			for($i = 1; $i <= $endDays; ++$i) {
75
+foreach ($years as $year) {
76
+	foreach ($periods as $period) {
77
+		foreach ($countries as $country) {
78
+			$endDays = date('t', mktime(0, 0, 0, $period, 1, $year));
79
+			for ($i = 1; $i <= $endDays; ++$i) {
80 80
 				$eDate = \PHPExcel\Shared\Date::formattedPHPToExcel(
81 81
 					$year,
82 82
 					$period,
83 83
 					$i
84 84
 				);
85
-				$value = rand(500,1000) * (1 + rand(-0.25,+0.25));
85
+				$value = rand(500, 1000) * (1 + rand(-0.25, +0.25));
86 86
 				$salesValue = $invoiceValue = NULL;
87
-				$incomeOrExpenditure = rand(-1,1);
87
+				$incomeOrExpenditure = rand(-1, 1);
88 88
 				if ($incomeOrExpenditure == -1) {
89
-					$expenditure = rand(-500,-1000) * (1 + rand(-0.25,+0.25));
89
+					$expenditure = rand(-500, -1000) * (1 + rand(-0.25, +0.25));
90 90
 					$income = NULL;
91 91
 				} elseif ($incomeOrExpenditure == 1) {
92
-					$expenditure = rand(-500,-1000) * (1 + rand(-0.25,+0.25));
93
-					$income = rand(500,1000) * (1 + rand(-0.25,+0.25));;
92
+					$expenditure = rand(-500, -1000) * (1 + rand(-0.25, +0.25));
93
+					$income = rand(500, 1000) * (1 + rand(-0.25, +0.25)); ;
94 94
 				} else {
95 95
 					$expenditure = NULL;
96
-					$income = rand(500,1000) * (1 + rand(-0.25,+0.25));;
96
+					$income = rand(500, 1000) * (1 + rand(-0.25, +0.25)); ;
97 97
 				}
98
-				$dataArray = array(	$year,
98
+				$dataArray = array($year,
99 99
 									$period,
100 100
 									$country,
101 101
 									$eDate,
102 102
 									$income,
103 103
 									$expenditure,
104 104
 								  );
105
-				$objPHPExcel->getActiveSheet()->fromArray($dataArray, NULL, 'A'.$row++);
105
+				$objPHPExcel->getActiveSheet()->fromArray($dataArray, NULL, 'A' . $row++);
106 106
 			}
107 107
 		}
108 108
 	}
@@ -111,20 +111,20 @@  discard block
 block discarded – undo
111 111
 
112 112
 
113 113
 // Set styling
114
-echo date('H:i:s').' Set styling'.EOL;
114
+echo date('H:i:s') . ' Set styling' . EOL;
115 115
 $objPHPExcel->getActiveSheet()->getStyle('A1:F1')->getFont()->setBold(true);
116 116
 $objPHPExcel->getActiveSheet()->getStyle('A1:F1')->getAlignment()->setWrapText(TRUE);
117 117
 $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(12.5);
118 118
 $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(10.5);
119
-$objPHPExcel->getActiveSheet()->getStyle('D2:D'.$row)->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2);
120
-$objPHPExcel->getActiveSheet()->getStyle('E2:F'.$row)->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);
119
+$objPHPExcel->getActiveSheet()->getStyle('D2:D' . $row)->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2);
120
+$objPHPExcel->getActiveSheet()->getStyle('E2:F' . $row)->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);
121 121
 $objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(14);
122 122
 $objPHPExcel->getActiveSheet()->freezePane('A2');
123 123
 
124 124
 
125 125
 
126 126
 // Set autofilter range
127
-echo date('H:i:s').' Set autofilter range'.EOL;
127
+echo date('H:i:s') . ' Set autofilter range' . EOL;
128 128
 // Always include the complete filter range!
129 129
 // Excel does support setting only the caption
130 130
 // row, but that's not a best practise...
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
 // Set active filters
134 134
 $autoFilter = $objPHPExcel->getActiveSheet()->getAutoFilter();
135
-echo date('H:i:s').' Set active filters'.EOL;
135
+echo date('H:i:s') . ' Set active filters' . EOL;
136 136
 // Filter the Country column on a filter value of countries beginning with the letter U (or Japan)
137 137
 //     We use * as a wildcard, so specify as U* and using a wildcard requires customFilter
138 138
 $autoFilter->getColumn('C')
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
 		->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER);
153 153
 // Filter the Date column on a filter value of the first day of every period of the current year
154 154
 //	We us a dateGroup ruletype for this, although it is still a standard filter
155
-foreach($periods as $period) {
156
-	$endDate = date('t',mktime(0,0,0,$period,1,$currentYear));
155
+foreach ($periods as $period) {
156
+	$endDate = date('t', mktime(0, 0, 0, $period, 1, $currentYear));
157 157
 
158 158
 	$autoFilter->getColumn('D')
159 159
 	    ->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER)
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 
185 185
 
186 186
 // Save Excel 2007 file
187
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
187
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
188 188
 $callStartTime = microtime(true);
189 189
 
190 190
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
@@ -192,14 +192,14 @@  discard block
 block discarded – undo
192 192
 $callEndTime = microtime(true);
193 193
 $callTime = $callEndTime - $callStartTime;
194 194
 
195
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
196
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
195
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
196
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
197 197
 // Echo memory usage
198
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
198
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
199 199
 
200 200
 
201 201
 // Save Excel 95 file
202
-echo date('H:i:s') , " Write to Excel5 format" , EOL;
202
+echo date('H:i:s'), " Write to Excel5 format", EOL;
203 203
 $callStartTime = microtime(true);
204 204
 
205 205
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
@@ -207,15 +207,15 @@  discard block
 block discarded – undo
207 207
 $callEndTime = microtime(true);
208 208
 $callTime = $callEndTime - $callStartTime;
209 209
 
210
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
211
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
210
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
211
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
212 212
 // Echo memory usage
213
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
213
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
214 214
 
215 215
 
216 216
 // Echo memory peak usage
217
-echo date('H:i:s').' Peak memory usage: '.(memory_get_peak_usage(true) / 1024 / 1024).' MB'.EOL;
217
+echo date('H:i:s') . ' Peak memory usage: ' . (memory_get_peak_usage(true) / 1024 / 1024) . ' MB' . EOL;
218 218
 
219 219
 // Echo done
220
-echo date('H:i:s').' Done writing files'.EOL;
221
-echo 'Files have been created in ' , getcwd() , EOL;
220
+echo date('H:i:s') . ' Done writing files' . EOL;
221
+echo 'Files have been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/27imagesexcel5.php 1 patch
Spacing   +9 added lines, -9 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,26 +39,26 @@  discard block
 block discarded – undo
39 39
 
40 40
 
41 41
 // Read from Excel5 (.xls) template
42
-echo date('H:i:s') , " Load Excel2007 template file" , EOL;
42
+echo date('H:i:s'), " Load Excel2007 template file", EOL;
43 43
 $objReader = \PHPExcel\IOFactory::createReader('Excel5');
44 44
 $objPHPExcel = $objReader->load("templates/27template.xls");
45 45
 
46 46
 // Export to Excel2007 (.xlsx)
47
-echo date('H:i:s') , " Write to Excel5 format" , EOL;
47
+echo date('H:i:s'), " Write to Excel5 format", EOL;
48 48
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
49 49
 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
50
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
50
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
51 51
 
52 52
 // Export to Excel5 (.xls)
53
-echo date('H:i:s') , " Write to Excel5 format" , EOL;
53
+echo date('H:i:s'), " Write to Excel5 format", EOL;
54 54
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
55 55
 $objWriter->save(str_replace('.php', '.xls', __FILE__));
56
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
56
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
57 57
 
58 58
 
59 59
 // Echo memory peak usage
60
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
60
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
61 61
 
62 62
 // Echo done
63
-echo date('H:i:s') , " Done writing files" , EOL;
64
-echo 'Files have been created in ' , getcwd() , EOL;
63
+echo date('H:i:s'), " Done writing files", EOL;
64
+echo 'Files have been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/12cellProtection.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -45,12 +45,12 @@  discard block
 block discarded – undo
45 45
 // Set document properties
46 46
 echo date('H:i:s') , " Set document properties" , EOL;
47 47
 $objPHPExcel->getProperties()->setCreator("Mark Baker")
48
-							 ->setLastModifiedBy("Mark Baker")
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("Mark Baker")
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
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
 echo date('H:i:s') , " Set sheet security" , EOL;
75 75
 $objPHPExcel->getActiveSheet()->getProtection()->setSheet(true);
76 76
 $objPHPExcel->getActiveSheet()
77
-	->getStyle('A2:B2')
78
-	->getProtection()->setLocked(
79
-		\PHPExcel\Style\Protection::PROTECTION_UNPROTECTED
80
-	);
77
+    ->getStyle('A2:B2')
78
+    ->getProtection()->setLocked(
79
+        \PHPExcel\Style\Protection::PROTECTION_UNPROTECTED
80
+    );
81 81
 
82 82
 
83 83
 // 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   +14 added lines, -14 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("Mark Baker")
48 48
 							 ->setLastModifiedBy("Mark Baker")
49 49
 							 ->setTitle("Office 2007 XLSX Test Document")
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 
56 56
 // Add some data
57
-echo date('H:i:s') , " Add some data" , EOL;
57
+echo date('H:i:s'), " Add some data", EOL;
58 58
 $objPHPExcel->setActiveSheetIndex(0);
59 59
 $objPHPExcel->getActiveSheet()->setCellValue('A1', 'Crouching');
60 60
 $objPHPExcel->getActiveSheet()->setCellValue('B1', 'Tiger');
@@ -62,16 +62,16 @@  discard block
 block discarded – undo
62 62
 $objPHPExcel->getActiveSheet()->setCellValue('B2', 'Dragon');
63 63
 
64 64
 // Rename worksheet
65
-echo date('H:i:s') , " Rename worksheet" , EOL;
65
+echo date('H:i:s'), " Rename worksheet", EOL;
66 66
 $objPHPExcel->getActiveSheet()->setTitle('Simple');
67 67
 
68 68
 
69 69
 // Set document security
70
-echo date('H:i:s') , " Set cell protection" , EOL;
70
+echo date('H:i:s'), " Set cell protection", EOL;
71 71
 
72 72
 
73 73
 // Set sheet security
74
-echo date('H:i:s') , " Set sheet security" , EOL;
74
+echo date('H:i:s'), " Set sheet security", EOL;
75 75
 $objPHPExcel->getActiveSheet()->getProtection()->setSheet(true);
76 76
 $objPHPExcel->getActiveSheet()
77 77
 	->getStyle('A2:B2')
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
 
87 87
 // Save Excel 2007 file
88
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
88
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
89 89
 $callStartTime = microtime(true);
90 90
 
91 91
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
@@ -93,15 +93,15 @@  discard block
 block discarded – undo
93 93
 $callEndTime = microtime(true);
94 94
 $callTime = $callEndTime - $callStartTime;
95 95
 
96
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
97
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
96
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
97
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
98 98
 // Echo memory usage
99
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
99
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
100 100
 
101 101
 
102 102
 // Echo memory peak usage
103
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
103
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
104 104
 
105 105
 // Echo done
106
-echo date('H:i:s') , " Done writing file" , EOL;
107
-echo 'File has been created in ' , getcwd() , EOL;
106
+echo date('H:i:s'), " Done writing file", EOL;
107
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/14excel5.php 1 patch
Spacing   +8 added lines, -8 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
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
 
43 43
 // Save Excel 95 file
44
-echo date('H:i:s') , " Write to Excel5 format" , EOL;
44
+echo date('H:i:s'), " Write to Excel5 format", EOL;
45 45
 $callStartTime = microtime(true);
46 46
 
47 47
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
@@ -49,15 +49,15 @@  discard block
 block discarded – undo
49 49
 $callEndTime = microtime(true);
50 50
 $callTime = $callEndTime - $callStartTime;
51 51
 
52
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
53
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
52
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
53
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
54 54
 // Echo memory usage
55
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
55
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
56 56
 
57 57
 
58 58
 // Echo memory peak usage
59
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
59
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
60 60
 
61 61
 // Echo done
62
-echo date('H:i:s') , " Done writing file" , EOL;
63
-echo 'File has been created in ' , getcwd() , EOL;
62
+echo date('H:i:s'), " Done writing file", EOL;
63
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/05featuredemo.inc.php 2 patches
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -39,12 +39,12 @@  discard block
 block discarded – undo
39 39
 // Set document properties
40 40
 echo date('H:i:s') , " Set document properties" , EOL;
41 41
 $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
42
-							 ->setLastModifiedBy("Maarten Balliauw")
43
-							 ->setTitle("Office 2007 XLSX Test Document")
44
-							 ->setSubject("Office 2007 XLSX Test Document")
45
-							 ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
46
-							 ->setKeywords("office 2007 openxml php")
47
-							 ->setCategory("Test result file");
42
+                                ->setLastModifiedBy("Maarten Balliauw")
43
+                                ->setTitle("Office 2007 XLSX Test Document")
44
+                                ->setSubject("Office 2007 XLSX Test Document")
45
+                                ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
46
+                                ->setKeywords("office 2007 openxml php")
47
+                                ->setCategory("Test result file");
48 48
 
49 49
 
50 50
 // Create a first sheet, representing sales data
@@ -176,12 +176,12 @@  discard block
 block discarded – undo
176 176
 // Set thin black border outline around column
177 177
 echo date('H:i:s') , " Set thin black border outline around column" , EOL;
178 178
 $styleThinBlackBorderOutline = array(
179
-	'borders' => array(
180
-		'outline' => array(
181
-			'style' => \PHPExcel\Style\Border::BORDER_THIN,
182
-			'color' => array('argb' => 'FF000000'),
183
-		),
184
-	),
179
+    'borders' => array(
180
+        'outline' => array(
181
+            'style' => \PHPExcel\Style\Border::BORDER_THIN,
182
+            'color' => array('argb' => 'FF000000'),
183
+        ),
184
+    ),
185 185
 );
186 186
 $objPHPExcel->getActiveSheet()->getStyle('A4:E10')->applyFromArray($styleThinBlackBorderOutline);
187 187
 
@@ -189,12 +189,12 @@  discard block
 block discarded – undo
189 189
 // Set thick brown border outline around "Total"
190 190
 echo date('H:i:s') , " Set thick brown border outline around Total" , EOL;
191 191
 $styleThickBrownBorderOutline = array(
192
-	'borders' => array(
193
-		'outline' => array(
194
-			'style' => \PHPExcel\Style\Border::BORDER_THICK,
195
-			'color' => array('argb' => 'FF993300'),
196
-		),
197
-	),
192
+    'borders' => array(
193
+        'outline' => array(
194
+            'style' => \PHPExcel\Style\Border::BORDER_THICK,
195
+            'color' => array('argb' => 'FF993300'),
196
+        ),
197
+    ),
198 198
 );
199 199
 $objPHPExcel->getActiveSheet()->getStyle('D13:E13')->applyFromArray($styleThickBrownBorderOutline);
200 200
 
@@ -206,60 +206,60 @@  discard block
 block discarded – undo
206 206
 // Set style for header row using alternative method
207 207
 echo date('H:i:s') , " Set style for header row using alternative method" , EOL;
208 208
 $objPHPExcel->getActiveSheet()->getStyle('A3:E3')->applyFromArray(
209
-		array(
210
-			'font'    => array(
211
-				'bold'      => true
212
-			),
213
-			'alignment' => array(
214
-				'horizontal' => \PHPExcel\Style\Alignment::HORIZONTAL_RIGHT,
215
-			),
216
-			'borders' => array(
217
-				'top'     => array(
218
- 					'style' => \PHPExcel\Style\Border::BORDER_THIN
219
- 				)
220
-			),
221
-			'fill' => array(
222
-	 			'type'       => \PHPExcel\Style\Fill::FILL_GRADIENT_LINEAR,
223
-	  			'rotation'   => 90,
224
-	 			'startcolor' => array(
225
-	 				'argb' => 'FFA0A0A0'
226
-	 			),
227
-	 			'endcolor'   => array(
228
-	 				'argb' => 'FFFFFFFF'
229
-	 			)
230
-	 		)
231
-		)
209
+        array(
210
+            'font'    => array(
211
+                'bold'      => true
212
+            ),
213
+            'alignment' => array(
214
+                'horizontal' => \PHPExcel\Style\Alignment::HORIZONTAL_RIGHT,
215
+            ),
216
+            'borders' => array(
217
+                'top'     => array(
218
+                        'style' => \PHPExcel\Style\Border::BORDER_THIN
219
+                    )
220
+            ),
221
+            'fill' => array(
222
+                    'type'       => \PHPExcel\Style\Fill::FILL_GRADIENT_LINEAR,
223
+                    'rotation'   => 90,
224
+                    'startcolor' => array(
225
+                        'argb' => 'FFA0A0A0'
226
+                    ),
227
+                    'endcolor'   => array(
228
+                        'argb' => 'FFFFFFFF'
229
+                    )
230
+                )
231
+        )
232 232
 );
233 233
 
234 234
 $objPHPExcel->getActiveSheet()->getStyle('A3')->applyFromArray(
235
-		array(
236
-			'alignment' => array(
237
-				'horizontal' => \PHPExcel\Style\Alignment::HORIZONTAL_LEFT,
238
-			),
239
-			'borders' => array(
240
-				'left'     => array(
241
- 					'style' => \PHPExcel\Style\Border::BORDER_THIN
242
- 				)
243
-			)
244
-		)
235
+        array(
236
+            'alignment' => array(
237
+                'horizontal' => \PHPExcel\Style\Alignment::HORIZONTAL_LEFT,
238
+            ),
239
+            'borders' => array(
240
+                'left'     => array(
241
+                        'style' => \PHPExcel\Style\Border::BORDER_THIN
242
+                    )
243
+            )
244
+        )
245 245
 );
246 246
 
247 247
 $objPHPExcel->getActiveSheet()->getStyle('B3')->applyFromArray(
248
-		array(
249
-			'alignment' => array(
250
-				'horizontal' => \PHPExcel\Style\Alignment::HORIZONTAL_LEFT,
251
-			)
252
-		)
248
+        array(
249
+            'alignment' => array(
250
+                'horizontal' => \PHPExcel\Style\Alignment::HORIZONTAL_LEFT,
251
+            )
252
+        )
253 253
 );
254 254
 
255 255
 $objPHPExcel->getActiveSheet()->getStyle('E3')->applyFromArray(
256
-		array(
257
-			'borders' => array(
258
-				'right'     => array(
259
- 					'style' => \PHPExcel\Style\Border::BORDER_THIN
260
- 				)
261
-			)
262
-		)
256
+        array(
257
+            'borders' => array(
258
+                'right'     => array(
259
+                        'style' => \PHPExcel\Style\Border::BORDER_THIN
260
+                    )
261
+            )
262
+        )
263 263
 );
264 264
 
265 265
 // Unprotect a cell
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
33 33
 
34 34
 
35 35
 // Create new PHPExcel object
36
-echo date('H:i:s') , " Create new PHPExcel object" , EOL;
36
+echo date('H:i:s'), " Create new PHPExcel object", EOL;
37 37
 $objPHPExcel = new \PHPExcel\Spreadsheet();
38 38
 
39 39
 // Set document properties
40
-echo date('H:i:s') , " Set document properties" , EOL;
40
+echo date('H:i:s'), " Set document properties", EOL;
41 41
 $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
42 42
 							 ->setLastModifiedBy("Maarten Balliauw")
43 43
 							 ->setTitle("Office 2007 XLSX Test Document")
@@ -48,10 +48,10 @@  discard block
 block discarded – undo
48 48
 
49 49
 
50 50
 // Create a first sheet, representing sales data
51
-echo date('H:i:s') , " Add some data" , EOL;
51
+echo date('H:i:s'), " Add some data", EOL;
52 52
 $objPHPExcel->setActiveSheetIndex(0);
53 53
 $objPHPExcel->getActiveSheet()->setCellValue('B1', 'Invoice');
54
-$objPHPExcel->getActiveSheet()->setCellValue('D1', \PHPExcel\Shared\Date::PHPToExcel( gmmktime(0,0,0,date('m'),date('d'),date('Y')) ));
54
+$objPHPExcel->getActiveSheet()->setCellValue('D1', \PHPExcel\Shared\Date::PHPToExcel(gmmktime(0, 0, 0, date('m'), date('d'), date('Y'))));
55 55
 $objPHPExcel->getActiveSheet()->getStyle('D1')->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX15);
56 56
 $objPHPExcel->getActiveSheet()->setCellValue('E1', '#12566');
57 57
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 $objPHPExcel->getActiveSheet()->setCellValue('E13', '=E11+E12');
89 89
 
90 90
 // Add comment
91
-echo date('H:i:s') , " Add comments" , EOL;
91
+echo date('H:i:s'), " Add comments", EOL;
92 92
 
93 93
 $objPHPExcel->getActiveSheet()->getComment('E11')->setAuthor('PHPExcel');
94 94
 $objCommentRichText = $objPHPExcel->getActiveSheet()->getComment('E11')->getText()->createTextRun('PHPExcel:');
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 
115 115
 
116 116
 // Add rich-text string
117
-echo date('H:i:s') , " Add rich-text string" , EOL;
117
+echo date('H:i:s'), " Add rich-text string", EOL;
118 118
 $objRichText = new \PHPExcel\RichText();
119 119
 $objRichText->createText('This invoice is ');
120 120
 
@@ -128,28 +128,28 @@  discard block
 block discarded – undo
128 128
 $objPHPExcel->getActiveSheet()->getCell('A18')->setValue($objRichText);
129 129
 
130 130
 // Merge cells
131
-echo date('H:i:s') , " Merge cells" , EOL;
131
+echo date('H:i:s'), " Merge cells", EOL;
132 132
 $objPHPExcel->getActiveSheet()->mergeCells('A18:E22');
133
-$objPHPExcel->getActiveSheet()->mergeCells('A28:B28');		// Just to test...
134
-$objPHPExcel->getActiveSheet()->unmergeCells('A28:B28');	// Just to test...
133
+$objPHPExcel->getActiveSheet()->mergeCells('A28:B28'); // Just to test...
134
+$objPHPExcel->getActiveSheet()->unmergeCells('A28:B28'); // Just to test...
135 135
 
136 136
 // Protect cells
137
-echo date('H:i:s') , " Protect cells" , EOL;
138
-$objPHPExcel->getActiveSheet()->getProtection()->setSheet(true);	// Needs to be set to true in order to enable any worksheet protection!
137
+echo date('H:i:s'), " Protect cells", EOL;
138
+$objPHPExcel->getActiveSheet()->getProtection()->setSheet(true); // Needs to be set to true in order to enable any worksheet protection!
139 139
 $objPHPExcel->getActiveSheet()->protectCells('A3:E13', 'PHPExcel');
140 140
 
141 141
 // Set cell number formats
142
-echo date('H:i:s') , " Set cell number formats" , EOL;
142
+echo date('H:i:s'), " Set cell number formats", EOL;
143 143
 $objPHPExcel->getActiveSheet()->getStyle('E4:E13')->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE);
144 144
 
145 145
 // Set column widths
146
-echo date('H:i:s') , " Set column widths" , EOL;
146
+echo date('H:i:s'), " Set column widths", EOL;
147 147
 $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true);
148 148
 $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(12);
149 149
 $objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(12);
150 150
 
151 151
 // Set fonts
152
-echo date('H:i:s') , " Set fonts" , EOL;
152
+echo date('H:i:s'), " Set fonts", EOL;
153 153
 $objPHPExcel->getActiveSheet()->getStyle('B1')->getFont()->setName('Candara');
154 154
 $objPHPExcel->getActiveSheet()->getStyle('B1')->getFont()->setSize(20);
155 155
 $objPHPExcel->getActiveSheet()->getStyle('B1')->getFont()->setBold(true);
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 $objPHPExcel->getActiveSheet()->getStyle('E13')->getFont()->setBold(true);
164 164
 
165 165
 // Set alignments
166
-echo date('H:i:s') , " Set alignments" , EOL;
166
+echo date('H:i:s'), " Set alignments", EOL;
167 167
 $objPHPExcel->getActiveSheet()->getStyle('D11')->getAlignment()->setHorizontal(\PHPExcel\Style\Alignment::HORIZONTAL_RIGHT);
168 168
 $objPHPExcel->getActiveSheet()->getStyle('D12')->getAlignment()->setHorizontal(\PHPExcel\Style\Alignment::HORIZONTAL_RIGHT);
169 169
 $objPHPExcel->getActiveSheet()->getStyle('D13')->getAlignment()->setHorizontal(\PHPExcel\Style\Alignment::HORIZONTAL_RIGHT);
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 $objPHPExcel->getActiveSheet()->getStyle('B5')->getAlignment()->setShrinkToFit(true);
175 175
 
176 176
 // Set thin black border outline around column
177
-echo date('H:i:s') , " Set thin black border outline around column" , EOL;
177
+echo date('H:i:s'), " Set thin black border outline around column", EOL;
178 178
 $styleThinBlackBorderOutline = array(
179 179
 	'borders' => array(
180 180
 		'outline' => array(
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
 
189 189
 // Set thick brown border outline around "Total"
190
-echo date('H:i:s') , " Set thick brown border outline around Total" , EOL;
190
+echo date('H:i:s'), " Set thick brown border outline around Total", EOL;
191 191
 $styleThickBrownBorderOutline = array(
192 192
 	'borders' => array(
193 193
 		'outline' => array(
@@ -199,12 +199,12 @@  discard block
 block discarded – undo
199 199
 $objPHPExcel->getActiveSheet()->getStyle('D13:E13')->applyFromArray($styleThickBrownBorderOutline);
200 200
 
201 201
 // Set fills
202
-echo date('H:i:s') , " Set fills" , EOL;
202
+echo date('H:i:s'), " Set fills", EOL;
203 203
 $objPHPExcel->getActiveSheet()->getStyle('A1:E1')->getFill()->setFillType(\PHPExcel\Style\Fill::FILL_SOLID);
204 204
 $objPHPExcel->getActiveSheet()->getStyle('A1:E1')->getFill()->getStartColor()->setARGB('FF808080');
205 205
 
206 206
 // Set style for header row using alternative method
207
-echo date('H:i:s') , " Set style for header row using alternative method" , EOL;
207
+echo date('H:i:s'), " Set style for header row using alternative method", EOL;
208 208
 $objPHPExcel->getActiveSheet()->getStyle('A3:E3')->applyFromArray(
209 209
 		array(
210 210
 			'font'    => array(
@@ -263,24 +263,24 @@  discard block
 block discarded – undo
263 263
 );
264 264
 
265 265
 // Unprotect a cell
266
-echo date('H:i:s') , " Unprotect a cell" , EOL;
266
+echo date('H:i:s'), " Unprotect a cell", EOL;
267 267
 $objPHPExcel->getActiveSheet()->getStyle('B1')->getProtection()->setLocked(\PHPExcel\Style\Protection::PROTECTION_UNPROTECTED);
268 268
 
269 269
 // Add a hyperlink to the sheet
270
-echo date('H:i:s') , " Add a hyperlink to an external website" , EOL;
270
+echo date('H:i:s'), " Add a hyperlink to an external website", EOL;
271 271
 $objPHPExcel->getActiveSheet()->setCellValue('E26', 'www.phpexcel.net');
272 272
 $objPHPExcel->getActiveSheet()->getCell('E26')->getHyperlink()->setUrl('http://www.phpexcel.net');
273 273
 $objPHPExcel->getActiveSheet()->getCell('E26')->getHyperlink()->setTooltip('Navigate to website');
274 274
 $objPHPExcel->getActiveSheet()->getStyle('E26')->getAlignment()->setHorizontal(\PHPExcel\Style\Alignment::HORIZONTAL_RIGHT);
275 275
 
276
-echo date('H:i:s') , " Add a hyperlink to another cell on a different worksheet within the workbook" , EOL;
276
+echo date('H:i:s'), " Add a hyperlink to another cell on a different worksheet within the workbook", EOL;
277 277
 $objPHPExcel->getActiveSheet()->setCellValue('E27', 'Terms and conditions');
278 278
 $objPHPExcel->getActiveSheet()->getCell('E27')->getHyperlink()->setUrl("sheet://'Terms and conditions'!A1");
279 279
 $objPHPExcel->getActiveSheet()->getCell('E27')->getHyperlink()->setTooltip('Review terms and conditions');
280 280
 $objPHPExcel->getActiveSheet()->getStyle('E27')->getAlignment()->setHorizontal(\PHPExcel\Style\Alignment::HORIZONTAL_RIGHT);
281 281
 
282 282
 // Add a drawing to the worksheet
283
-echo date('H:i:s') , " Add a drawing to the worksheet" , EOL;
283
+echo date('H:i:s'), " Add a drawing to the worksheet", EOL;
284 284
 $objDrawing = new \PHPExcel\Worksheet\Drawing();
285 285
 $objDrawing->setName('Logo');
286 286
 $objDrawing->setDescription('Logo');
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
290 290
 
291 291
 // Add a drawing to the worksheet
292
-echo date('H:i:s') , " Add a drawing to the worksheet" , EOL;
292
+echo date('H:i:s'), " Add a drawing to the worksheet", EOL;
293 293
 $objDrawing = new \PHPExcel\Worksheet\Drawing();
294 294
 $objDrawing->setName('Paid');
295 295
 $objDrawing->setDescription('Paid');
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
303 303
 
304 304
 // Add a drawing to the worksheet
305
-echo date('H:i:s') , " Add a drawing to the worksheet" , EOL;
305
+echo date('H:i:s'), " Add a drawing to the worksheet", EOL;
306 306
 $objDrawing = new \PHPExcel\Worksheet\Drawing();
307 307
 $objDrawing->setName('PHPExcel logo');
308 308
 $objDrawing->setDescription('PHPExcel logo');
@@ -313,36 +313,36 @@  discard block
 block discarded – undo
313 313
 $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
314 314
 
315 315
 // Play around with inserting and removing rows and columns
316
-echo date('H:i:s') , " Play around with inserting and removing rows and columns" , EOL;
316
+echo date('H:i:s'), " Play around with inserting and removing rows and columns", EOL;
317 317
 $objPHPExcel->getActiveSheet()->insertNewRowBefore(6, 10);
318 318
 $objPHPExcel->getActiveSheet()->removeRow(6, 10);
319 319
 $objPHPExcel->getActiveSheet()->insertNewColumnBefore('E', 5);
320 320
 $objPHPExcel->getActiveSheet()->removeColumn('E', 5);
321 321
 
322 322
 // Set header and footer. When no different headers for odd/even are used, odd header is assumed.
323
-echo date('H:i:s') , " Set header/footer" , EOL;
323
+echo date('H:i:s'), " Set header/footer", EOL;
324 324
 $objPHPExcel->getActiveSheet()->getHeaderFooter()->setOddHeader('&L&BInvoice&RPrinted on &D');
325 325
 $objPHPExcel->getActiveSheet()->getHeaderFooter()->setOddFooter('&L&B' . $objPHPExcel->getProperties()->getTitle() . '&RPage &P of &N');
326 326
 
327 327
 // Set page orientation and size
328
-echo date('H:i:s') , " Set page orientation and size" , EOL;
328
+echo date('H:i:s'), " Set page orientation and size", EOL;
329 329
 $objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(\PHPExcel\Worksheet\PageSetup::ORIENTATION_PORTRAIT);
330 330
 $objPHPExcel->getActiveSheet()->getPageSetup()->setPaperSize(\PHPExcel\Worksheet\PageSetup::PAPERSIZE_A4);
331 331
 
332 332
 // Rename first worksheet
333
-echo date('H:i:s') , " Rename first worksheet" , EOL;
333
+echo date('H:i:s'), " Rename first worksheet", EOL;
334 334
 $objPHPExcel->getActiveSheet()->setTitle('Invoice');
335 335
 
336 336
 
337 337
 // Create a new worksheet, after the default sheet
338
-echo date('H:i:s') , " Create a second Worksheet object" , EOL;
338
+echo date('H:i:s'), " Create a second Worksheet object", EOL;
339 339
 $objPHPExcel->createSheet();
340 340
 
341 341
 // Llorem ipsum...
342 342
 $sLloremIpsum = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vivamus eget ante. Sed cursus nunc semper tortor. Aliquam luctus purus non elit. Fusce vel elit commodo sapien dignissim dignissim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur accumsan magna sed massa. Nullam bibendum quam ac ipsum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Proin augue. Praesent malesuada justo sed orci. Pellentesque lacus ligula, sodales quis, ultricies a, ultricies vitae, elit. Sed luctus consectetuer dolor. Vivamus vel sem ut nisi sodales accumsan. Nunc et felis. Suspendisse semper viverra odio. Morbi at odio. Integer a orci a purus venenatis molestie. Nam mattis. Praesent rhoncus, nisi vel mattis auctor, neque nisi faucibus sem, non dapibus elit pede ac nisl. Cras turpis.';
343 343
 
344 344
 // Add some data to the second sheet, resembling some different data types
345
-echo date('H:i:s') , " Add some data" , EOL;
345
+echo date('H:i:s'), " Add some data", EOL;
346 346
 $objPHPExcel->setActiveSheetIndex(1);
347 347
 $objPHPExcel->getActiveSheet()->setCellValue('A1', 'Terms and conditions');
348 348
 $objPHPExcel->getActiveSheet()->setCellValue('A3', $sLloremIpsum);
@@ -351,19 +351,19 @@  discard block
 block discarded – undo
351 351
 $objPHPExcel->getActiveSheet()->setCellValue('A6', $sLloremIpsum);
352 352
 
353 353
 // Set the worksheet tab color
354
-echo date('H:i:s') , " Set the worksheet tab color" , EOL;
355
-$objPHPExcel->getActiveSheet()->getTabColor()->setARGB('FF0094FF');;
354
+echo date('H:i:s'), " Set the worksheet tab color", EOL;
355
+$objPHPExcel->getActiveSheet()->getTabColor()->setARGB('FF0094FF'); ;
356 356
 
357 357
 // Set alignments
358
-echo date('H:i:s') , " Set alignments" , EOL;
358
+echo date('H:i:s'), " Set alignments", EOL;
359 359
 $objPHPExcel->getActiveSheet()->getStyle('A3:A6')->getAlignment()->setWrapText(true);
360 360
 
361 361
 // Set column widths
362
-echo date('H:i:s') , " Set column widths" , EOL;
362
+echo date('H:i:s'), " Set column widths", EOL;
363 363
 $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(80);
364 364
 
365 365
 // Set fonts
366
-echo date('H:i:s') , " Set fonts" , EOL;
366
+echo date('H:i:s'), " Set fonts", EOL;
367 367
 $objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setName('Candara');
368 368
 $objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setSize(20);
369 369
 $objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 $objPHPExcel->getActiveSheet()->getStyle('A3:A6')->getFont()->setSize(8);
373 373
 
374 374
 // Add a drawing to the worksheet
375
-echo date('H:i:s') , " Add a drawing to the worksheet" , EOL;
375
+echo date('H:i:s'), " Add a drawing to the worksheet", EOL;
376 376
 $objDrawing = new \PHPExcel\Worksheet\Drawing();
377 377
 $objDrawing->setName('Terms and conditions');
378 378
 $objDrawing->setDescription('Terms and conditions');
@@ -381,12 +381,12 @@  discard block
 block discarded – undo
381 381
 $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
382 382
 
383 383
 // Set page orientation and size
384
-echo date('H:i:s') , " Set page orientation and size" , EOL;
384
+echo date('H:i:s'), " Set page orientation and size", EOL;
385 385
 $objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(\PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE);
386 386
 $objPHPExcel->getActiveSheet()->getPageSetup()->setPaperSize(\PHPExcel\Worksheet\PageSetup::PAPERSIZE_A4);
387 387
 
388 388
 // Rename second worksheet
389
-echo date('H:i:s') , " Rename second worksheet" , EOL;
389
+echo date('H:i:s'), " Rename second worksheet", EOL;
390 390
 $objPHPExcel->getActiveSheet()->setTitle('Terms and conditions');
391 391
 
392 392
 
Please login to merge, or discard this patch.
Examples/22heavilyformatted.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
 // Set document properties
47 47
 echo date('H:i:s') , " Set document properties" , EOL;
48 48
 $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
49
-							 ->setLastModifiedBy("Maarten Balliauw")
50
-							 ->setTitle("Office 2007 XLSX Test Document")
51
-							 ->setSubject("Office 2007 XLSX Test Document")
52
-							 ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
53
-							 ->setKeywords("office 2007 openxml php")
54
-							 ->setCategory("Test result file");
49
+                                ->setLastModifiedBy("Maarten Balliauw")
50
+                                ->setTitle("Office 2007 XLSX Test Document")
51
+                                ->setSubject("Office 2007 XLSX Test Document")
52
+                                ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
53
+                                ->setKeywords("office 2007 openxml php")
54
+                                ->setCategory("Test result file");
55 55
 
56 56
 
57 57
 // Add some data
@@ -59,24 +59,24 @@  discard block
 block discarded – undo
59 59
 $objPHPExcel->setActiveSheetIndex(0);
60 60
 
61 61
 $objPHPExcel->getActiveSheet()->getStyle('A1:T100')->applyFromArray(
62
-	array('fill' 	=> array(
63
-								'type'		=> \PHPExcel\Style\Fill::FILL_SOLID,
64
-								'color'		=> array('argb' => 'FFCCFFCC')
65
-							),
66
-		  'borders' => array(
67
-								'bottom'	=> array('style' => \PHPExcel\Style\Border::BORDER_THIN),
68
-								'right'		=> array('style' => \PHPExcel\Style\Border::BORDER_MEDIUM)
69
-							)
70
-		 )
71
-	);
62
+    array('fill' 	=> array(
63
+                                'type'		=> \PHPExcel\Style\Fill::FILL_SOLID,
64
+                                'color'		=> array('argb' => 'FFCCFFCC')
65
+                            ),
66
+            'borders' => array(
67
+                                'bottom'	=> array('style' => \PHPExcel\Style\Border::BORDER_THIN),
68
+                                'right'		=> array('style' => \PHPExcel\Style\Border::BORDER_MEDIUM)
69
+                            )
70
+            )
71
+    );
72 72
 
73 73
 $objPHPExcel->getActiveSheet()->getStyle('C5:R95')->applyFromArray(
74
-	array('fill' 	=> array(
75
-								'type'		=> \PHPExcel\Style\Fill::FILL_SOLID,
76
-								'color'		=> array('argb' => 'FFFFFF00')
77
-							),
78
-		 )
79
-	);
74
+    array('fill' 	=> array(
75
+                                'type'		=> \PHPExcel\Style\Fill::FILL_SOLID,
76
+                                'color'		=> array('argb' => 'FFFFFF00')
77
+                            ),
78
+            )
79
+    );
80 80
 
81 81
 // Save Excel 2007 file
82 82
 echo date('H:i:s') , " Write to Excel2007 format" , EOL;
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 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
 
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
 
41 41
 
42 42
 // Create new PHPExcel object
43
-echo date('H:i:s') , " Create new PHPExcel object" , EOL;
43
+echo date('H:i:s'), " Create new PHPExcel object", EOL;
44 44
 $objPHPExcel = new \PHPExcel\Spreadsheet();
45 45
 
46 46
 // Set document properties
47
-echo date('H:i:s') , " Set document properties" , EOL;
47
+echo date('H:i:s'), " Set document properties", EOL;
48 48
 $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
49 49
 							 ->setLastModifiedBy("Maarten Balliauw")
50 50
 							 ->setTitle("Office 2007 XLSX Test Document")
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
 
57 57
 // Add some data
58
-echo date('H:i:s') , " Add some data" , EOL;
58
+echo date('H:i:s'), " Add some data", EOL;
59 59
 $objPHPExcel->setActiveSheetIndex(0);
60 60
 
61 61
 $sharedStyle1 = new \PHPExcel\Style();
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 $objPHPExcel->getActiveSheet()->duplicateStyle($sharedStyle2, "C5:R95");
88 88
 
89 89
 // Save Excel 2007 file
90
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
90
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
91 91
 $callStartTime = microtime(true);
92 92
 
93 93
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
@@ -95,14 +95,14 @@  discard block
 block discarded – undo
95 95
 $callEndTime = microtime(true);
96 96
 $callTime = $callEndTime - $callStartTime;
97 97
 
98
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
99
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
98
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
99
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
100 100
 // Echo memory usage
101
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
101
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
102 102
 
103 103
 
104 104
 // Save Excel 95 file
105
-echo date('H:i:s') , " Write to Excel5 format" , EOL;
105
+echo date('H:i:s'), " Write to Excel5 format", EOL;
106 106
 $callStartTime = microtime(true);
107 107
 
108 108
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
@@ -110,15 +110,15 @@  discard block
 block discarded – undo
110 110
 $callEndTime = microtime(true);
111 111
 $callTime = $callEndTime - $callStartTime;
112 112
 
113
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
114
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
113
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
114
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
115 115
 // Echo memory usage
116
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
116
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
117 117
 
118 118
 
119 119
 // Echo memory peak usage
120
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
120
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
121 121
 
122 122
 // Echo done
123
-echo date('H:i:s') , " Done writing file" , EOL;
124
-echo 'File has been created in ' , getcwd() , EOL;
123
+echo date('H:i:s'), " Done writing file", EOL;
124
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/33chartcreate-column.php 2 patches
Indentation   +28 added lines, -28 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
 //	Set the Labels for each data series we want to plot
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 //		Data values
61 61
 //		Data Marker
62 62
 $dataSeriesLabels = array(
63
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1),	//	2010
64
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	2011
65
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1),	//	2012
63
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1),	//	2010
64
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	2011
65
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1),	//	2012
66 66
 );
67 67
 //	Set the X-Axis Labels
68 68
 //		Datatype
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 //		Data values
73 73
 //		Data Marker
74 74
 $xAxisTickValues = array(
75
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4),	//	Q1 to Q4
75
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4),	//	Q1 to Q4
76 76
 );
77 77
 //	Set the Data values for each data series we want to plot
78 78
 //		Datatype
@@ -82,19 +82,19 @@  discard block
 block discarded – undo
82 82
 //		Data values
83 83
 //		Data Marker
84 84
 $dataSeriesValues = array(
85
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', NULL, 4),
86
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', NULL, 4),
87
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', NULL, 4),
85
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', NULL, 4),
86
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', NULL, 4),
87
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', NULL, 4),
88 88
 );
89 89
 
90 90
 //	Build the dataseries
91 91
 $series = new \PHPExcel\Chart\DataSeries(
92
-	\PHPExcel\Chart\DataSeries::TYPE_BARCHART,		// plotType
93
-	\PHPExcel\Chart\DataSeries::GROUPING_STANDARD,	// plotGrouping
94
-	range(0, count($dataSeriesValues)-1),			// plotOrder
95
-	$dataSeriesLabels,								// plotLabel
96
-	$xAxisTickValues,								// plotCategory
97
-	$dataSeriesValues								// plotValues
92
+    \PHPExcel\Chart\DataSeries::TYPE_BARCHART,		// plotType
93
+    \PHPExcel\Chart\DataSeries::GROUPING_STANDARD,	// plotGrouping
94
+    range(0, count($dataSeriesValues)-1),			// plotOrder
95
+    $dataSeriesLabels,								// plotLabel
96
+    $xAxisTickValues,								// plotCategory
97
+    $dataSeriesValues								// plotValues
98 98
 );
99 99
 //	Set additional dataseries parameters
100 100
 //		Make it a vertical column rather than a horizontal bar graph
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
 
112 112
 //	Create the chart
113 113
 $chart = new \PHPExcel\Chart(
114
-	'chart1',		// name
115
-	$title,			// title
116
-	$legend,		// legend
117
-	$plotArea,		// plotArea
118
-	true,			// plotVisibleOnly
119
-	0,				// displayBlanksAs
120
-	NULL,			// xAxisLabel
121
-	$yAxisLabel		// yAxisLabel
114
+    'chart1',		// name
115
+    $title,			// title
116
+    $legend,		// legend
117
+    $plotArea,		// plotArea
118
+    true,			// plotVisibleOnly
119
+    0,				// displayBlanksAs
120
+    NULL,			// xAxisLabel
121
+    $yAxisLabel		// yAxisLabel
122 122
 );
123 123
 
124 124
 //	Set the position where the chart should appear in the worksheet
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 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
 
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 //		Data values
61 61
 //		Data Marker
62 62
 $dataSeriesLabels = array(
63
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1),	//	2010
64
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	2011
65
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1),	//	2012
63
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1), //	2010
64
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1), //	2011
65
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1), //	2012
66 66
 );
67 67
 //	Set the X-Axis Labels
68 68
 //		Datatype
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 //		Data values
73 73
 //		Data Marker
74 74
 $xAxisTickValues = array(
75
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4),	//	Q1 to Q4
75
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4), //	Q1 to Q4
76 76
 );
77 77
 //	Set the Data values for each data series we want to plot
78 78
 //		Datatype
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
 
90 90
 //	Build the dataseries
91 91
 $series = new \PHPExcel\Chart\DataSeries(
92
-	\PHPExcel\Chart\DataSeries::TYPE_BARCHART,		// plotType
93
-	\PHPExcel\Chart\DataSeries::GROUPING_STANDARD,	// plotGrouping
94
-	range(0, count($dataSeriesValues)-1),			// plotOrder
95
-	$dataSeriesLabels,								// plotLabel
96
-	$xAxisTickValues,								// plotCategory
92
+	\PHPExcel\Chart\DataSeries::TYPE_BARCHART, // plotType
93
+	\PHPExcel\Chart\DataSeries::GROUPING_STANDARD, // plotGrouping
94
+	range(0, count($dataSeriesValues) - 1), // plotOrder
95
+	$dataSeriesLabels, // plotLabel
96
+	$xAxisTickValues, // plotCategory
97 97
 	$dataSeriesValues								// plotValues
98 98
 );
99 99
 //	Set additional dataseries parameters
@@ -111,13 +111,13 @@  discard block
 block discarded – undo
111 111
 
112 112
 //	Create the chart
113 113
 $chart = new \PHPExcel\Chart(
114
-	'chart1',		// name
115
-	$title,			// title
116
-	$legend,		// legend
117
-	$plotArea,		// plotArea
118
-	true,			// plotVisibleOnly
119
-	0,				// displayBlanksAs
120
-	NULL,			// xAxisLabel
114
+	'chart1', // name
115
+	$title, // title
116
+	$legend, // legend
117
+	$plotArea, // plotArea
118
+	true, // plotVisibleOnly
119
+	0, // displayBlanksAs
120
+	NULL, // xAxisLabel
121 121
 	$yAxisLabel		// yAxisLabel
122 122
 );
123 123
 
@@ -130,16 +130,16 @@  discard block
 block discarded – undo
130 130
 
131 131
 
132 132
 // Save Excel 2007 file
133
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
133
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
134 134
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
135 135
 $objWriter->setIncludeCharts(TRUE);
136 136
 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
137
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
137
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
138 138
 
139 139
 
140 140
 // Echo memory peak usage
141
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
141
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
142 142
 
143 143
 // Echo done
144
-echo date('H:i:s') , " Done writing file" , EOL;
145
-echo 'File has been created in ' , getcwd() , EOL;
144
+echo date('H:i:s'), " Done writing file", EOL;
145
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/33chartcreate-line.php 2 patches
Indentation   +28 added lines, -28 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
 //	Set the Labels for each data series we want to plot
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 //		Data values
61 61
 //		Data Marker
62 62
 $dataSeriesLabels = array(
63
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1),	//	2010
64
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	2011
65
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1),	//	2012
63
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1),	//	2010
64
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	2011
65
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1),	//	2012
66 66
 );
67 67
 //	Set the X-Axis Labels
68 68
 //		Datatype
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 //		Data values
73 73
 //		Data Marker
74 74
 $xAxisTickValues = array(
75
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4),	//	Q1 to Q4
75
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4),	//	Q1 to Q4
76 76
 );
77 77
 //	Set the Data values for each data series we want to plot
78 78
 //		Datatype
@@ -82,19 +82,19 @@  discard block
 block discarded – undo
82 82
 //		Data values
83 83
 //		Data Marker
84 84
 $dataSeriesValues = array(
85
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', NULL, 4),
86
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', NULL, 4),
87
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', NULL, 4),
85
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$5', NULL, 4),
86
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', NULL, 4),
87
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$5', NULL, 4),
88 88
 );
89 89
 
90 90
 //	Build the dataseries
91 91
 $series = new \PHPExcel\Chart\DataSeries(
92
-	\PHPExcel\Chart\DataSeries::TYPE_LINECHART,		// plotType
93
-	\PHPExcel\Chart\DataSeries::GROUPING_STACKED,	// plotGrouping
94
-	range(0, count($dataSeriesValues)-1),			// plotOrder
95
-	$dataSeriesLabels,								// plotLabel
96
-	$xAxisTickValues,								// plotCategory
97
-	$dataSeriesValues								// plotValues
92
+    \PHPExcel\Chart\DataSeries::TYPE_LINECHART,		// plotType
93
+    \PHPExcel\Chart\DataSeries::GROUPING_STACKED,	// plotGrouping
94
+    range(0, count($dataSeriesValues)-1),			// plotOrder
95
+    $dataSeriesLabels,								// plotLabel
96
+    $xAxisTickValues,								// plotCategory
97
+    $dataSeriesValues								// plotValues
98 98
 );
99 99
 
100 100
 //	Set the series in the plot area
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
 
109 109
 //	Create the chart
110 110
 $chart = new \PHPExcel\Chart(
111
-	'chart1',		// name
112
-	$title,			// title
113
-	$legend,		// legend
114
-	$plotArea,		// plotArea
115
-	true,			// plotVisibleOnly
116
-	0,				// displayBlanksAs
117
-	NULL,			// xAxisLabel
118
-	$yAxisLabel		// yAxisLabel
111
+    'chart1',		// name
112
+    $title,			// title
113
+    $legend,		// legend
114
+    $plotArea,		// plotArea
115
+    true,			// plotVisibleOnly
116
+    0,				// displayBlanksAs
117
+    NULL,			// xAxisLabel
118
+    $yAxisLabel		// yAxisLabel
119 119
 );
120 120
 
121 121
 //	Set the position where the chart should appear in the worksheet
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 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
 
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 //		Data values
61 61
 //		Data Marker
62 62
 $dataSeriesLabels = array(
63
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1),	//	2010
64
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	2011
65
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1),	//	2012
63
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1), //	2010
64
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1), //	2011
65
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1), //	2012
66 66
 );
67 67
 //	Set the X-Axis Labels
68 68
 //		Datatype
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 //		Data values
73 73
 //		Data Marker
74 74
 $xAxisTickValues = array(
75
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4),	//	Q1 to Q4
75
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4), //	Q1 to Q4
76 76
 );
77 77
 //	Set the Data values for each data series we want to plot
78 78
 //		Datatype
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
 
90 90
 //	Build the dataseries
91 91
 $series = new \PHPExcel\Chart\DataSeries(
92
-	\PHPExcel\Chart\DataSeries::TYPE_LINECHART,		// plotType
93
-	\PHPExcel\Chart\DataSeries::GROUPING_STACKED,	// plotGrouping
94
-	range(0, count($dataSeriesValues)-1),			// plotOrder
95
-	$dataSeriesLabels,								// plotLabel
96
-	$xAxisTickValues,								// plotCategory
92
+	\PHPExcel\Chart\DataSeries::TYPE_LINECHART, // plotType
93
+	\PHPExcel\Chart\DataSeries::GROUPING_STACKED, // plotGrouping
94
+	range(0, count($dataSeriesValues) - 1), // plotOrder
95
+	$dataSeriesLabels, // plotLabel
96
+	$xAxisTickValues, // plotCategory
97 97
 	$dataSeriesValues								// plotValues
98 98
 );
99 99
 
@@ -108,13 +108,13 @@  discard block
 block discarded – undo
108 108
 
109 109
 //	Create the chart
110 110
 $chart = new \PHPExcel\Chart(
111
-	'chart1',		// name
112
-	$title,			// title
113
-	$legend,		// legend
114
-	$plotArea,		// plotArea
115
-	true,			// plotVisibleOnly
116
-	0,				// displayBlanksAs
117
-	NULL,			// xAxisLabel
111
+	'chart1', // name
112
+	$title, // title
113
+	$legend, // legend
114
+	$plotArea, // plotArea
115
+	true, // plotVisibleOnly
116
+	0, // displayBlanksAs
117
+	NULL, // xAxisLabel
118 118
 	$yAxisLabel		// yAxisLabel
119 119
 );
120 120
 
@@ -127,16 +127,16 @@  discard block
 block discarded – undo
127 127
 
128 128
 
129 129
 // Save Excel 2007 file
130
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
130
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
131 131
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
132 132
 $objWriter->setIncludeCharts(TRUE);
133 133
 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
134
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
134
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
135 135
 
136 136
 
137 137
 // Echo memory peak usage
138
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
138
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
139 139
 
140 140
 // Echo done
141
-echo date('H:i:s') , " Done writing file" , EOL;
142
-echo 'File has been created in ' , getcwd() , EOL;
141
+echo date('H:i:s'), " Done writing file", EOL;
142
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/17html.php 1 patch
Spacing   +8 added lines, -8 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
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 require_once dirname(__FILE__) . '/../src/Bootstrap.php';
42 42
 
43 43
 
44
-echo date('H:i:s') , " Write to HTML format" , EOL;
44
+echo date('H:i:s'), " Write to HTML format", EOL;
45 45
 $callStartTime = microtime(true);
46 46
 
47 47
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'HTML');
@@ -50,15 +50,15 @@  discard block
 block discarded – undo
50 50
 $objWriter->save(str_replace('.php', '.htm', __FILE__));
51 51
 $callEndTime = microtime(true);
52 52
 $callTime = $callEndTime - $callStartTime;
53
-echo date('H:i:s') , " File written to " , str_replace('.php', '.htm', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
54
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
53
+echo date('H:i:s'), " File written to ", str_replace('.php', '.htm', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
54
+echo 'Call time to write 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
 // Echo memory peak usage
60
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
60
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
61 61
 
62 62
 // Echo done
63
-echo date('H:i:s') , " Done writing file" , EOL;
64
-echo 'File has been created in ' , getcwd() , EOL;
63
+echo date('H:i:s'), " Done writing file", EOL;
64
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.