Completed
Branch master (962a82)
by Adrien
09:13
created
Examples/29advancedvaluebinder.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -30,26 +30,26 @@  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
 /** PHPExcel */
36 36
 require_once dirname(__FILE__) . '/../src/Bootstrap.php';
37 37
 
38 38
 
39 39
 // Set timezone
40
-echo date('H:i:s') , " Set timezone" , EOL;
40
+echo date('H:i:s'), " Set timezone", EOL;
41 41
 date_default_timezone_set('UTC');
42 42
 
43 43
 // Set value binder
44
-echo date('H:i:s') , " Set value binder" , EOL;
45
-\PHPExcel\Cell::setValueBinder( new \PHPExcel\Cell\AdvancedValueBinder() );
44
+echo date('H:i:s'), " Set value binder", EOL;
45
+\PHPExcel\Cell::setValueBinder(new \PHPExcel\Cell\AdvancedValueBinder());
46 46
 
47 47
 // Create new PHPExcel object
48
-echo date('H:i:s') , " Create new PHPExcel object" , EOL;
48
+echo date('H:i:s'), " Create new PHPExcel object", EOL;
49 49
 $objPHPExcel = new \PHPExcel\Spreadsheet();
50 50
 
51 51
 // Set document properties
52
-echo date('H:i:s') , " Set document properties" , EOL;
52
+echo date('H:i:s'), " Set document properties", EOL;
53 53
 $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
54 54
 							 ->setLastModifiedBy("Maarten Balliauw")
55 55
 							 ->setTitle("Office 2007 XLSX Test Document")
@@ -59,17 +59,17 @@  discard block
 block discarded – undo
59 59
 							 ->setCategory("Test result file");
60 60
 
61 61
 // Set default font
62
-echo date('H:i:s') , " Set default font" , EOL;
62
+echo date('H:i:s'), " Set default font", EOL;
63 63
 $objPHPExcel->getActiveSheet()->getDefaultStyle()->getFont()->setName('Arial');
64 64
 $objPHPExcel->getActiveSheet()->getDefaultStyle()->getFont()->setSize(10);
65 65
 
66 66
 // Set column widths
67
-echo date('H:i:s') , " Set column widths" , EOL;
67
+echo date('H:i:s'), " Set column widths", EOL;
68 68
 $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setAutoSize(true);
69 69
 $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(14);
70 70
 
71 71
 // Add some data, resembling some different data types
72
-echo date('H:i:s') , " Add some data" , EOL;
72
+echo date('H:i:s'), " Add some data", EOL;
73 73
 $objPHPExcel->getActiveSheet()->setCellValue('A1', 'String value:')
74 74
                               ->setCellValue('B1', 'Mark Baker');
75 75
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                               ->setCellValue('B28', '=SUM(B2:B9)');
156 156
 
157 157
 // Rename worksheet
158
-echo date('H:i:s') , " Rename worksheet" , EOL;
158
+echo date('H:i:s'), " Rename worksheet", EOL;
159 159
 $objPHPExcel->getActiveSheet()->setTitle('Advanced value binder');
160 160
 
161 161
 
@@ -164,20 +164,20 @@  discard block
 block discarded – undo
164 164
 
165 165
 
166 166
 // Save Excel 2007 file
167
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
167
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
168 168
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
169 169
 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
170
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
170
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
171 171
 // Save Excel5 file
172
-echo date('H:i:s') , " Write to Excel5 format" , EOL;
172
+echo date('H:i:s'), " Write to Excel5 format", EOL;
173 173
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
174 174
 $objWriter->save(str_replace('.php', '.xls', __FILE__));
175
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
175
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
176 176
 
177 177
 
178 178
 // Echo memory peak usage
179
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
179
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
180 180
 
181 181
 // Echo done
182
-echo date('H:i:s') , " Done writing file" , EOL;
183
-echo 'File has been created in ' , getcwd() , EOL;
182
+echo date('H:i:s'), " Done writing file", EOL;
183
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/XMLReader.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,12 +34,12 @@  discard block
 block discarded – undo
34 34
 require_once dirname(__FILE__) . '/../Classes/PHPExcel/IOFactory.php';
35 35
 
36 36
 
37
-echo date('H:i:s') , " Load from XML file" , PHP_EOL;
37
+echo date('H:i:s'), " Load from XML file", PHP_EOL;
38 38
 $inputFileName = "XMLTest.xml";
39 39
 
40 40
 /**  Identify the type of $inputFileName  **/
41 41
 $inputFileType = \PHPExcel\IOFactory::identify($inputFileName);
42
-echo 'Loading ' , $inputFileName , ' using ' , $inputFileType , " Reader" , PHP_EOL;
42
+echo 'Loading ', $inputFileName, ' using ', $inputFileType, " Reader", PHP_EOL;
43 43
 
44 44
 /**  Create a new Reader of the type that has been identified  **/
45 45
 $objReader = \PHPExcel\IOFactory::createReader($inputFileType);
@@ -47,14 +47,14 @@  discard block
 block discarded – undo
47 47
 $objPHPExcel = $objReader->load($inputFileName);
48 48
 
49 49
 
50
-echo date('H:i:s') , " Write to Excel2007 format" , PHP_EOL;
50
+echo date('H:i:s'), " Write to Excel2007 format", PHP_EOL;
51 51
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
52 52
 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
53
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', __FILE__) , PHP_EOL;
53
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', __FILE__), PHP_EOL;
54 54
 
55 55
 
56 56
 // Echo memory peak usage
57
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , PHP_EOL;
57
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", PHP_EOL;
58 58
 
59 59
 // Echo done
60
-echo date('H:i:s') , " Done writing file" , PHP_EOL;
60
+echo date('H:i:s'), " Done writing file", PHP_EOL;
Please login to merge, or discard this patch.
Examples/21pdf.php 1 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
 
@@ -52,14 +52,14 @@  discard block
 block discarded – undo
52 52
 $rendererLibraryPath = '/php/libraries/PDF/' . $rendererLibrary;
53 53
 
54 54
 
55
-echo date('H:i:s') , " Hide grid lines" , EOL;
55
+echo date('H:i:s'), " Hide grid lines", EOL;
56 56
 $objPHPExcel->getActiveSheet()->setShowGridLines(false);
57 57
 
58
-echo date('H:i:s') , " Set orientation to landscape" , EOL;
58
+echo date('H:i:s'), " Set orientation to landscape", EOL;
59 59
 $objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(\PHPExcel\Worksheet\PageSetup::ORIENTATION_LANDSCAPE);
60 60
 
61 61
 
62
-echo date('H:i:s') , " Write to PDF format using {$rendererName}" , EOL;
62
+echo date('H:i:s'), " Write to PDF format using {$rendererName}", EOL;
63 63
 
64 64
 if (!\PHPExcel\Settings::setPdfRenderer(
65 65
 		$rendererName,
@@ -77,18 +77,18 @@  discard block
 block discarded – undo
77 77
 
78 78
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'PDF');
79 79
 $objWriter->setSheetIndex(0);
80
-$objWriter->save(str_replace('.php', '_'.$rendererName.'.pdf', __FILE__));
80
+$objWriter->save(str_replace('.php', '_' . $rendererName . '.pdf', __FILE__));
81 81
 $callEndTime = microtime(true);
82 82
 $callTime = $callEndTime - $callStartTime;
83
-echo date('H:i:s') , " File written to " , str_replace('.php', '_'.$rendererName.'.pdf', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
84
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
83
+echo date('H:i:s'), " File written to ", str_replace('.php', '_' . $rendererName . '.pdf', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
84
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
85 85
 // Echo memory usage
86
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
86
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
87 87
 
88 88
 
89 89
 // Echo memory peak usage
90
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
90
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
91 91
 
92 92
 // Echo done
93
-echo date('H:i:s') , " Done writing files" , EOL;
94
-echo 'File has been created in ' , getcwd() , EOL;
93
+echo date('H:i:s'), " Done writing files", EOL;
94
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/01simple-download-xlsx.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -79,10 +79,10 @@
 block discarded – undo
79 79
 header('Cache-Control: max-age=1');
80 80
 
81 81
 // If you're serving to IE over SSL, then the following may be needed
82
-header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
83
-header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified
84
-header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1
85
-header ('Pragma: public'); // HTTP/1.0
82
+header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
83
+header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified
84
+header('Cache-Control: cache, must-revalidate'); // HTTP/1.1
85
+header('Pragma: public'); // HTTP/1.0
86 86
 
87 87
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
88 88
 $objWriter->save('php://output');
Please login to merge, or discard this patch.
Examples/06largescale-with-cellcaching-sqlite3.php 1 patch
Spacing   +17 added lines, -17 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,18 +39,18 @@  discard block
 block discarded – undo
39 39
 
40 40
 $cacheMethod = \PHPExcel\CachedObjectStorageFactory::CACHE_TO_SQLITE3;
41 41
 if (\PHPExcel\Settings::setCacheStorageMethod($cacheMethod)) {
42
-    echo date('H:i:s') , " Enable Cell Caching using " , $cacheMethod , " method" , EOL;
42
+    echo date('H:i:s'), " Enable Cell Caching using ", $cacheMethod, " method", EOL;
43 43
 } else {
44
-    echo date('H:i:s') , " Unable to set Cell Caching using " , $cacheMethod , " method, reverting to memory" , EOL;
44
+    echo date('H:i:s'), " Unable to set Cell Caching using ", $cacheMethod, " method, reverting to memory", EOL;
45 45
 }
46 46
 
47 47
 
48 48
 // Create new PHPExcel object
49
-echo date('H:i:s') , " Create new PHPExcel object" , EOL;
49
+echo date('H:i:s'), " Create new PHPExcel object", EOL;
50 50
 $objPHPExcel = new \PHPExcel\Spreadsheet();
51 51
 
52 52
 // Set document properties
53
-echo date('H:i:s') , " Set properties" , EOL;
53
+echo date('H:i:s'), " Set properties", EOL;
54 54
 $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
55 55
 							 ->setLastModifiedBy("Maarten Balliauw")
56 56
 							 ->setTitle("Office 2007 XLSX Test Document")
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
 
63 63
 // Create a first sheet
64
-echo date('H:i:s') , " Add data" , EOL;
64
+echo date('H:i:s'), " Add data", EOL;
65 65
 $objPHPExcel->setActiveSheetIndex(0);
66 66
 $objPHPExcel->getActiveSheet()->setCellValue('A1', "Firstname");
67 67
 $objPHPExcel->getActiveSheet()->setCellValue('B1', "Lastname");
@@ -71,24 +71,24 @@  discard block
 block discarded – undo
71 71
 
72 72
 
73 73
 // Hide "Phone" and "fax" column
74
-echo date('H:i:s') , " Hide 'Phone' and 'fax' columns" , EOL;
74
+echo date('H:i:s'), " Hide 'Phone' and 'fax' columns", EOL;
75 75
 $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setVisible(false);
76 76
 $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setVisible(false);
77 77
 
78 78
 
79 79
 // Set outline levels
80
-echo date('H:i:s') , " Set outline levels" , EOL;
80
+echo date('H:i:s'), " Set outline levels", EOL;
81 81
 $objPHPExcel->getActiveSheet()->getColumnDimension('E')->setOutlineLevel(1)
82 82
                                                        ->setVisible(false)
83 83
                                                        ->setCollapsed(true);
84 84
 
85 85
 // Freeze panes
86
-echo date('H:i:s') , " Freeze panes" , EOL;
86
+echo date('H:i:s'), " Freeze panes", EOL;
87 87
 $objPHPExcel->getActiveSheet()->freezePane('A2');
88 88
 
89 89
 
90 90
 // Rows to repeat at top
91
-echo date('H:i:s') , " Rows to repeat at top" , EOL;
91
+echo date('H:i:s'), " Rows to repeat at top", EOL;
92 92
 $objPHPExcel->getActiveSheet()->getPageSetup()->setRowsToRepeatAtTopByStartAndEnd(1, 1);
93 93
 
94 94
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
 
109 109
 // Save Excel 2007 file
110
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
110
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
111 111
 $callStartTime = microtime(true);
112 112
 
113 113
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
@@ -115,15 +115,15 @@  discard block
 block discarded – undo
115 115
 $callEndTime = microtime(true);
116 116
 $callTime = $callEndTime - $callStartTime;
117 117
 
118
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
119
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
118
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
119
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
120 120
 // Echo memory usage
121
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
121
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
122 122
 
123 123
 
124 124
 // Echo memory peak usage
125
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
125
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
126 126
 
127 127
 // Echo done
128
-echo date('H:i:s') , " Done writing file" , EOL;
129
-echo 'File has been created in ' , getcwd() , EOL;
128
+echo date('H:i:s'), " Done writing file", EOL;
129
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/10autofilter-selection-1.php 1 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 1 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.