Completed
Push — develop ( e0a9f9...ba7054 )
by Adrien
19:36
created
Examples/34chartupdate.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 require_once dirname(__FILE__) . '/../src/Bootstrap.php';
41 41
 
42 42
 if (!file_exists("33chartcreate-bar.xlsx")) {
43
-	exit("Please run 33chartcreate-bar.php first." . EOL);
43
+    exit("Please run 33chartcreate-bar.php first." . EOL);
44 44
 }
45 45
 
46 46
 echo date('H:i:s') , " Load from Excel2007 file" , EOL;
@@ -52,14 +52,14 @@  discard block
 block discarded – undo
52 52
 echo date('H:i:s') , " Update cell data values that are displayed in the chart" , EOL;
53 53
 $objWorksheet = $objPHPExcel->getActiveSheet();
54 54
 $objWorksheet->fromArray(
55
-	array(
56
-		array(50-12,   50-15,		50-21),
57
-		array(50-56,   50-73,		50-86),
58
-		array(50-52,   50-61,		50-69),
59
-		array(50-30,   50-32,		50),
60
-	),
61
-	NULL,
62
-	'B2'
55
+    array(
56
+        array(50-12,   50-15,		50-21),
57
+        array(50-56,   50-73,		50-86),
58
+        array(50-52,   50-61,		50-69),
59
+        array(50-30,   50-32,		50),
60
+    ),
61
+    NULL,
62
+    'B2'
63 63
 );
64 64
 
65 65
 // Save Excel 2007 file
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 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
 
@@ -43,36 +43,36 @@  discard block
 block discarded – undo
43 43
 	exit("Please run 33chartcreate-bar.php first." . EOL);
44 44
 }
45 45
 
46
-echo date('H:i:s') , " Load from Excel2007 file" , EOL;
46
+echo date('H:i:s'), " Load from Excel2007 file", EOL;
47 47
 $objReader = \PHPExcel\IOFactory::createReader("Excel2007");
48 48
 $objReader->setIncludeCharts(TRUE);
49 49
 $objPHPExcel = $objReader->load("33chartcreate-bar.xlsx");
50 50
 
51 51
 
52
-echo date('H:i:s') , " Update cell data values that are displayed in the chart" , EOL;
52
+echo date('H:i:s'), " Update cell data values that are displayed in the chart", EOL;
53 53
 $objWorksheet = $objPHPExcel->getActiveSheet();
54 54
 $objWorksheet->fromArray(
55 55
 	array(
56
-		array(50-12,   50-15,		50-21),
57
-		array(50-56,   50-73,		50-86),
58
-		array(50-52,   50-61,		50-69),
59
-		array(50-30,   50-32,		50),
56
+		array(50 - 12, 50 - 15, 50 - 21),
57
+		array(50 - 56, 50 - 73, 50 - 86),
58
+		array(50 - 52, 50 - 61, 50 - 69),
59
+		array(50 - 30, 50 - 32, 50),
60 60
 	),
61 61
 	NULL,
62 62
 	'B2'
63 63
 );
64 64
 
65 65
 // Save Excel 2007 file
66
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
66
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
67 67
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
68 68
 $objWriter->setIncludeCharts(TRUE);
69 69
 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
70
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
70
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
71 71
 
72 72
 
73 73
 // Echo memory peak usage
74
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
74
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
75 75
 
76 76
 // Echo done
77
-echo date('H:i:s') , " Done writing file" , EOL;
78
-echo 'File has been created in ' , getcwd() , EOL;
77
+echo date('H:i:s'), " Done writing file", EOL;
78
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/40duplicateStyle.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -5,18 +5,18 @@  discard block
 block discarded – undo
5 5
 ini_set('display_startup_errors', TRUE);
6 6
 date_default_timezone_set('Europe/London');
7 7
 
8
-define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
8
+define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
9 9
 
10 10
 date_default_timezone_set('Europe/London');
11 11
 
12 12
 /** Include PHPExcel */
13 13
 require_once dirname(__FILE__) . '/../src/Bootstrap.php';
14 14
 
15
-echo date('H:i:s') , " Create new PHPExcel object" , EOL;
15
+echo date('H:i:s'), " Create new PHPExcel object", EOL;
16 16
 $objPHPExcel = new \PHPExcel\Spreadsheet();
17 17
 $worksheet = $objPHPExcel->getActiveSheet();
18 18
 
19
-echo date('H:i:s') , " Create styles array" , EOL;
19
+echo date('H:i:s'), " Create styles array", EOL;
20 20
 $styles = array();
21 21
 for ($i = 0; $i < 10; $i++) {
22 22
     $style = new \PHPExcel\Style();
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     $styles[] = $style;
25 25
 }
26 26
 
27
-echo date('H:i:s') , " Add data (begin)" , EOL;
27
+echo date('H:i:s'), " Add data (begin)", EOL;
28 28
 $t = microtime(true);
29 29
 for ($col = 0; $col < 50; $col++) {
30 30
     for ($row = 0; $row < 100; $row++) {
@@ -36,16 +36,16 @@  discard block
 block discarded – undo
36 36
     }
37 37
 }
38 38
 $d = microtime(true) - $t;
39
-echo date('H:i:s') , " Add data (end), time: " . round($d, 2) . " s", EOL;
39
+echo date('H:i:s'), " Add data (end), time: " . round($d, 2) . " s", EOL;
40 40
 
41 41
 
42
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
42
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
43 43
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
44 44
 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
45
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
45
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
46 46
 
47 47
 
48
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
48
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
49 49
 
50
-echo date('H:i:s') , " Done writing file" , EOL;
51
-echo 'File has been created in ' , getcwd() , EOL;
50
+echo date('H:i:s'), " Done writing file", EOL;
51
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/33chartcreate-stock.php 2 patches
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
 $objPHPExcel = new \PHPExcel\Spreadsheet();
44 44
 $objWorksheet = $objPHPExcel->getActiveSheet();
45 45
 $objWorksheet->fromArray(
46
-	array(
47
-		array('Counts', 		'Max', 		'Min', 		'Min Threshold', 	'Max Threshold'	),
48
-		array(10,		 		10, 		5, 			0, 					50				),
49
-		array(30,		 		20, 		10, 		0,	 				50				),
50
-		array(20,		 		30, 		15, 		0,	 				50				),
51
-		array(40,		 		10, 		0, 			0, 					50				),
52
-		array(100,		 		40, 		5, 			0, 					50				),
53
-	), null, 'A1', true
46
+    array(
47
+        array('Counts', 		'Max', 		'Min', 		'Min Threshold', 	'Max Threshold'	),
48
+        array(10,		 		10, 		5, 			0, 					50				),
49
+        array(30,		 		20, 		10, 		0,	 				50				),
50
+        array(20,		 		30, 		15, 		0,	 				50				),
51
+        array(40,		 		10, 		0, 			0, 					50				),
52
+        array(100,		 		40, 		5, 			0, 					50				),
53
+    ), null, 'A1', true
54 54
 );
55 55
 $objWorksheet->getStyle('B2:E6')->getNumberFormat()->setFormatCode(PHPExcel\Style\NumberFormat::FORMAT_NUMBER_00);
56 56
 
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
 //		Data values
64 64
 //		Data Marker
65 65
 $dataSeriesLabels = array(
66
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1), //Max / Open
67
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1), //Min / Close
68
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1), //Min Threshold / Min
69
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$E$1', NULL, 1), //Max Threshold / Max
66
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$B$1', NULL, 1), //Max / Open
67
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1), //Min / Close
68
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$D$1', NULL, 1), //Min Threshold / Min
69
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$E$1', NULL, 1), //Max Threshold / Max
70 70
 );
71 71
 //	Set the X-Axis Labels
72 72
 //		Datatype
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 //		Data values
77 77
 //		Data Marker
78 78
 $xAxisTickValues = array(
79
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$6', NULL, 5),	//	Counts
79
+    new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$6', NULL, 5),	//	Counts
80 80
 );
81 81
 //	Set the Data values for each data series we want to plot
82 82
 //		Datatype
@@ -86,20 +86,20 @@  discard block
 block discarded – undo
86 86
 //		Data values
87 87
 //		Data Marker
88 88
 $dataSeriesValues = array(
89
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$6', NULL, 5),
90
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$6', NULL, 5),
91
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$6', NULL, 5),
92
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$E$2:$E$6', NULL, 5),
89
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$B$2:$B$6', NULL, 5),
90
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$6', NULL, 5),
91
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$D$2:$D$6', NULL, 5),
92
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$E$2:$E$6', NULL, 5),
93 93
 );
94 94
 
95 95
 //	Build the dataseries
96 96
 $series = new \PHPExcel\Chart\DataSeries(
97
-	\PHPExcel\Chart\DataSeries::TYPE_STOCKCHART,	// plotType
98
-	null,										// plotGrouping - if we set this to not null, then xlsx throws error
99
-	range(0, count($dataSeriesValues)-1),		// plotOrder
100
-	$dataSeriesLabels,							// plotLabel
101
-	$xAxisTickValues,							// plotCategory
102
-	$dataSeriesValues							// plotValues
97
+    \PHPExcel\Chart\DataSeries::TYPE_STOCKCHART,	// plotType
98
+    null,										// plotGrouping - if we set this to not null, then xlsx throws error
99
+    range(0, count($dataSeriesValues)-1),		// plotOrder
100
+    $dataSeriesLabels,							// plotLabel
101
+    $xAxisTickValues,							// plotCategory
102
+    $dataSeriesValues							// plotValues
103 103
 );
104 104
 
105 105
 //	Set the series in the plot area
@@ -113,14 +113,14 @@  discard block
 block discarded – undo
113 113
 
114 114
 //	Create the chart
115 115
 $chart = new \PHPExcel\Chart(
116
-	'stock-chart',	// name
117
-	$title,			// title
118
-	$legend,		// legend
119
-	$plotArea,		// plotArea
120
-	true,			// plotVisibleOnly
121
-	0,				// displayBlanksAs
122
-	$xAxisLabel,	// xAxisLabel
123
-	$yAxisLabel		// yAxisLabel
116
+    'stock-chart',	// name
117
+    $title,			// title
118
+    $legend,		// legend
119
+    $plotArea,		// plotArea
120
+    true,			// plotVisibleOnly
121
+    0,				// displayBlanksAs
122
+    $xAxisLabel,	// xAxisLabel
123
+    $yAxisLabel		// yAxisLabel
124 124
 );
125 125
 
126 126
 //	Set the position where the chart should appear in the worksheet
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 $objWriter->setIncludeCharts(TRUE);
138 138
 $filename = str_replace('.php', '.xlsx', __FILE__);
139 139
 if(file_exists($filename)) {
140
-	unlink($filename);
140
+    unlink($filename);
141 141
 }
142 142
 $objWriter->save($filename);
143 143
 echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 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,12 +44,12 @@  discard block
 block discarded – undo
44 44
 $objWorksheet = $objPHPExcel->getActiveSheet();
45 45
 $objWorksheet->fromArray(
46 46
 	array(
47
-		array('Counts', 		'Max', 		'Min', 		'Min Threshold', 	'Max Threshold'	),
48
-		array(10,		 		10, 		5, 			0, 					50				),
49
-		array(30,		 		20, 		10, 		0,	 				50				),
50
-		array(20,		 		30, 		15, 		0,	 				50				),
51
-		array(40,		 		10, 		0, 			0, 					50				),
52
-		array(100,		 		40, 		5, 			0, 					50				),
47
+		array('Counts', 'Max', 'Min', 'Min Threshold', 'Max Threshold'),
48
+		array(10, 10, 5, 0, 50),
49
+		array(30, 20, 10, 0, 50),
50
+		array(20, 30, 15, 0, 50),
51
+		array(40, 10, 0, 0, 50),
52
+		array(100, 40, 5, 0, 50),
53 53
 	), null, 'A1', true
54 54
 );
55 55
 $objWorksheet->getStyle('B2:E6')->getNumberFormat()->setFormatCode(PHPExcel\Style\NumberFormat::FORMAT_NUMBER_00);
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 //		Data values
77 77
 //		Data Marker
78 78
 $xAxisTickValues = array(
79
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$6', NULL, 5),	//	Counts
79
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$6', NULL, 5), //	Counts
80 80
 );
81 81
 //	Set the Data values for each data series we want to plot
82 82
 //		Datatype
@@ -94,11 +94,11 @@  discard block
 block discarded – undo
94 94
 
95 95
 //	Build the dataseries
96 96
 $series = new \PHPExcel\Chart\DataSeries(
97
-	\PHPExcel\Chart\DataSeries::TYPE_STOCKCHART,	// plotType
98
-	null,										// plotGrouping - if we set this to not null, then xlsx throws error
99
-	range(0, count($dataSeriesValues)-1),		// plotOrder
100
-	$dataSeriesLabels,							// plotLabel
101
-	$xAxisTickValues,							// plotCategory
97
+	\PHPExcel\Chart\DataSeries::TYPE_STOCKCHART, // plotType
98
+	null, // plotGrouping - if we set this to not null, then xlsx throws error
99
+	range(0, count($dataSeriesValues) - 1), // plotOrder
100
+	$dataSeriesLabels, // plotLabel
101
+	$xAxisTickValues, // plotCategory
102 102
 	$dataSeriesValues							// plotValues
103 103
 );
104 104
 
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
 
114 114
 //	Create the chart
115 115
 $chart = new \PHPExcel\Chart(
116
-	'stock-chart',	// name
117
-	$title,			// title
118
-	$legend,		// legend
119
-	$plotArea,		// plotArea
120
-	true,			// plotVisibleOnly
121
-	0,				// displayBlanksAs
122
-	$xAxisLabel,	// xAxisLabel
116
+	'stock-chart', // name
117
+	$title, // title
118
+	$legend, // legend
119
+	$plotArea, // plotArea
120
+	true, // plotVisibleOnly
121
+	0, // displayBlanksAs
122
+	$xAxisLabel, // xAxisLabel
123 123
 	$yAxisLabel		// yAxisLabel
124 124
 );
125 125
 
@@ -132,20 +132,20 @@  discard block
 block discarded – undo
132 132
 
133 133
 
134 134
 // Save Excel 2007 file
135
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
135
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
136 136
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
137 137
 $objWriter->setIncludeCharts(TRUE);
138 138
 $filename = str_replace('.php', '.xlsx', __FILE__);
139
-if(file_exists($filename)) {
139
+if (file_exists($filename)) {
140 140
 	unlink($filename);
141 141
 }
142 142
 $objWriter->save($filename);
143
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
143
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
144 144
 
145 145
 
146 146
 // Echo memory peak usage
147
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
147
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
148 148
 
149 149
 // Echo done
150
-echo date('H:i:s') , " Done writing file" , EOL;
151
-echo 'File has been created in ' , getcwd() , EOL;
150
+echo date('H:i:s'), " Done writing file", EOL;
151
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/19namedrange.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -46,23 +46,23 @@  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
58 58
 echo date('H:i:s') , " Add some data" , EOL;
59 59
 $objPHPExcel->setActiveSheetIndex(0);
60 60
 $objPHPExcel->getActiveSheet()->setCellValue('A1', 'Firstname:')
61
-                              ->setCellValue('A2', 'Lastname:')
62
-                              ->setCellValue('A3', 'Fullname:')
63
-                              ->setCellValue('B1', 'Maarten')
64
-                              ->setCellValue('B2', 'Balliauw')
65
-                              ->setCellValue('B3', '=B1 & " " & B2');
61
+                                ->setCellValue('A2', 'Lastname:')
62
+                                ->setCellValue('A3', 'Fullname:')
63
+                                ->setCellValue('B1', 'Maarten')
64
+                                ->setCellValue('B2', 'Balliauw')
65
+                                ->setCellValue('B3', '=B1 & " " & B2');
66 66
 
67 67
 // Define named ranges
68 68
 echo date('H:i:s') , " Define named ranges" , EOL;
@@ -86,11 +86,11 @@  discard block
 block discarded – undo
86 86
 echo date('H:i:s') , " Add some data" , EOL;
87 87
 $objPHPExcel->setActiveSheetIndex(1);
88 88
 $objPHPExcel->getActiveSheet()->setCellValue('A1', 'Firstname:')
89
-                              ->setCellValue('A2', 'Lastname:')
90
-                              ->setCellValue('A3', 'Fullname:')
91
-                              ->setCellValue('B1', '=PersonFN')
92
-                              ->setCellValue('B2', '=PersonLN')
93
-                              ->setCellValue('B3', '=PersonFN & " " & PersonLN');
89
+                                ->setCellValue('A2', 'Lastname:')
90
+                                ->setCellValue('A3', 'Fullname:')
91
+                                ->setCellValue('B1', '=PersonFN')
92
+                                ->setCellValue('B2', '=PersonLN')
93
+                                ->setCellValue('B3', '=PersonFN & " " & PersonLN');
94 94
 
95 95
 // Resolve range
96 96
 echo date('H:i:s') , " Resolve range" , EOL;
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 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
 $objPHPExcel->getActiveSheet()->setCellValue('A1', 'Firstname:')
61 61
                               ->setCellValue('A2', 'Lastname:')
@@ -65,25 +65,25 @@  discard block
 block discarded – undo
65 65
                               ->setCellValue('B3', '=B1 & " " & B2');
66 66
 
67 67
 // Define named ranges
68
-echo date('H:i:s') , " Define named ranges" , EOL;
69
-$objPHPExcel->addNamedRange( new \PHPExcel\NamedRange('PersonName', $objPHPExcel->getActiveSheet(), 'B1') );
70
-$objPHPExcel->addNamedRange( new \PHPExcel\NamedRange('PersonLN', $objPHPExcel->getActiveSheet(), 'B2') );
68
+echo date('H:i:s'), " Define named ranges", EOL;
69
+$objPHPExcel->addNamedRange(new \PHPExcel\NamedRange('PersonName', $objPHPExcel->getActiveSheet(), 'B1'));
70
+$objPHPExcel->addNamedRange(new \PHPExcel\NamedRange('PersonLN', $objPHPExcel->getActiveSheet(), 'B2'));
71 71
 
72 72
 // Rename named ranges
73
-echo date('H:i:s') , " Rename named ranges" , EOL;
73
+echo date('H:i:s'), " Rename named ranges", EOL;
74 74
 $objPHPExcel->getNamedRange('PersonName')->setName('PersonFN');
75 75
 
76 76
 // Rename worksheet
77
-echo date('H:i:s') , " Rename worksheet" , EOL;
77
+echo date('H:i:s'), " Rename worksheet", EOL;
78 78
 $objPHPExcel->getActiveSheet()->setTitle('Person');
79 79
 
80 80
 
81 81
 // Create a new worksheet, after the default sheet
82
-echo date('H:i:s') , " Create new Worksheet object" , EOL;
82
+echo date('H:i:s'), " Create new Worksheet object", EOL;
83 83
 $objPHPExcel->createSheet();
84 84
 
85 85
 // Add some data to the second sheet, resembling some different data types
86
-echo date('H:i:s') , " Add some data" , EOL;
86
+echo date('H:i:s'), " Add some data", EOL;
87 87
 $objPHPExcel->setActiveSheetIndex(1);
88 88
 $objPHPExcel->getActiveSheet()->setCellValue('A1', 'Firstname:')
89 89
                               ->setCellValue('A2', 'Lastname:')
@@ -93,13 +93,13 @@  discard block
 block discarded – undo
93 93
                               ->setCellValue('B3', '=PersonFN & " " & PersonLN');
94 94
 
95 95
 // Resolve range
96
-echo date('H:i:s') , " Resolve range" , EOL;
97
-echo 'Cell B1 {=PersonFN}: ' , $objPHPExcel->getActiveSheet()->getCell('B1')->getCalculatedValue() , EOL;
98
-echo 'Cell B3 {=PersonFN & " " & PersonLN}: ' , $objPHPExcel->getActiveSheet()->getCell('B3')->getCalculatedValue() , EOL;
99
-echo 'Cell Person!B1: ' , $objPHPExcel->getActiveSheet()->getCell('Person!B1')->getCalculatedValue() , EOL;
96
+echo date('H:i:s'), " Resolve range", EOL;
97
+echo 'Cell B1 {=PersonFN}: ', $objPHPExcel->getActiveSheet()->getCell('B1')->getCalculatedValue(), EOL;
98
+echo 'Cell B3 {=PersonFN & " " & PersonLN}: ', $objPHPExcel->getActiveSheet()->getCell('B3')->getCalculatedValue(), EOL;
99
+echo 'Cell Person!B1: ', $objPHPExcel->getActiveSheet()->getCell('Person!B1')->getCalculatedValue(), EOL;
100 100
 
101 101
 // Rename worksheet
102
-echo date('H:i:s') , " Rename worksheet" , EOL;
102
+echo date('H:i:s'), " Rename worksheet", EOL;
103 103
 $objPHPExcel->getActiveSheet()->setTitle('Person (cloned)');
104 104
 
105 105
 // Set active sheet index to the first sheet, so Excel opens this as the first sheet
@@ -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.php 2 patches
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -44,78 +44,78 @@
 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', 'Year')
58
-                              ->setCellValue('B1', 'Quarter')
59
-                              ->setCellValue('C1', 'Country')
60
-                              ->setCellValue('D1', 'Sales');
58
+                                ->setCellValue('B1', 'Quarter')
59
+                                ->setCellValue('C1', 'Country')
60
+                                ->setCellValue('D1', 'Sales');
61 61
 
62 62
 $dataArray = array(array('2010',	'Q1',	'United States',	790),
63
-                   array('2010',	'Q2',	'United States',	730),
64
-                   array('2010',	'Q3',	'United States',	860),
65
-                   array('2010',	'Q4',	'United States',	850),
66
-                   array('2011',	'Q1',	'United States',	800),
67
-                   array('2011',	'Q2',	'United States',	700),
68
-                   array('2011',	'Q3',	'United States',	900),
69
-                   array('2011',	'Q4',	'United States',	950),
70
-                   array('2010',	'Q1',	'Belgium',			380),
71
-                   array('2010',	'Q2',	'Belgium',			390),
72
-                   array('2010',	'Q3',	'Belgium',			420),
73
-                   array('2010',	'Q4',	'Belgium',			460),
74
-                   array('2011',	'Q1',	'Belgium',			400),
75
-                   array('2011',	'Q2',	'Belgium',			350),
76
-                   array('2011',	'Q3',	'Belgium',			450),
77
-                   array('2011',	'Q4',	'Belgium',			500),
78
-                   array('2010',	'Q1',	'UK',				690),
79
-                   array('2010',	'Q2',	'UK',				610),
80
-                   array('2010',	'Q3',	'UK',				620),
81
-                   array('2010',	'Q4',	'UK',				600),
82
-                   array('2011',	'Q1',	'UK',				720),
83
-                   array('2011',	'Q2',	'UK',				650),
84
-                   array('2011',	'Q3',	'UK',				580),
85
-                   array('2011',	'Q4',	'UK',				510),
86
-                   array('2010',	'Q1',	'France',			510),
87
-                   array('2010',	'Q2',	'France',			490),
88
-                   array('2010',	'Q3',	'France',			460),
89
-                   array('2010',	'Q4',	'France', 			590),
90
-                   array('2011',	'Q1',	'France',			620),
91
-                   array('2011',	'Q2',	'France',			650),
92
-                   array('2011',	'Q3',	'France',			415),
93
-                   array('2011',	'Q4',	'France', 			570),
94
-                   array('2010',	'Q1',	'Germany',			720),
95
-                   array('2010',	'Q2',	'Germany',			680),
96
-                   array('2010',	'Q3',	'Germany',			640),
97
-                   array('2010',	'Q4',	'Germany',			660),
98
-                   array('2011',	'Q1',	'Germany',			680),
99
-                   array('2011',	'Q2',	'Germany',			620),
100
-                   array('2011',	'Q3',	'Germany',			710),
101
-                   array('2011',	'Q4',	'Germany',			690),
102
-                   array('2010',	'Q1',	'Spain',			510),
103
-                   array('2010',	'Q2',	'Spain',			490),
104
-                   array('2010',	'Q3',	'Spain',			470),
105
-                   array('2010',	'Q4',	'Spain',			420),
106
-                   array('2011',	'Q1',	'Spain',			460),
107
-                   array('2011',	'Q2',	'Spain',			390),
108
-                   array('2011',	'Q3',	'Spain',			430),
109
-                   array('2011',	'Q4',	'Spain',			415),
110
-                   array('2010',	'Q1',	'Italy',			440),
111
-                   array('2010',	'Q2',	'Italy',			410),
112
-                   array('2010',	'Q3',	'Italy',			420),
113
-                   array('2010',	'Q4',	'Italy',			450),
114
-                   array('2011',	'Q1',	'Italy',			430),
115
-                   array('2011',	'Q2',	'Italy',			370),
116
-                   array('2011',	'Q3',	'Italy',			350),
117
-                   array('2011',	'Q4',	'Italy',			335),
118
-                  );
63
+                    array('2010',	'Q2',	'United States',	730),
64
+                    array('2010',	'Q3',	'United States',	860),
65
+                    array('2010',	'Q4',	'United States',	850),
66
+                    array('2011',	'Q1',	'United States',	800),
67
+                    array('2011',	'Q2',	'United States',	700),
68
+                    array('2011',	'Q3',	'United States',	900),
69
+                    array('2011',	'Q4',	'United States',	950),
70
+                    array('2010',	'Q1',	'Belgium',			380),
71
+                    array('2010',	'Q2',	'Belgium',			390),
72
+                    array('2010',	'Q3',	'Belgium',			420),
73
+                    array('2010',	'Q4',	'Belgium',			460),
74
+                    array('2011',	'Q1',	'Belgium',			400),
75
+                    array('2011',	'Q2',	'Belgium',			350),
76
+                    array('2011',	'Q3',	'Belgium',			450),
77
+                    array('2011',	'Q4',	'Belgium',			500),
78
+                    array('2010',	'Q1',	'UK',				690),
79
+                    array('2010',	'Q2',	'UK',				610),
80
+                    array('2010',	'Q3',	'UK',				620),
81
+                    array('2010',	'Q4',	'UK',				600),
82
+                    array('2011',	'Q1',	'UK',				720),
83
+                    array('2011',	'Q2',	'UK',				650),
84
+                    array('2011',	'Q3',	'UK',				580),
85
+                    array('2011',	'Q4',	'UK',				510),
86
+                    array('2010',	'Q1',	'France',			510),
87
+                    array('2010',	'Q2',	'France',			490),
88
+                    array('2010',	'Q3',	'France',			460),
89
+                    array('2010',	'Q4',	'France', 			590),
90
+                    array('2011',	'Q1',	'France',			620),
91
+                    array('2011',	'Q2',	'France',			650),
92
+                    array('2011',	'Q3',	'France',			415),
93
+                    array('2011',	'Q4',	'France', 			570),
94
+                    array('2010',	'Q1',	'Germany',			720),
95
+                    array('2010',	'Q2',	'Germany',			680),
96
+                    array('2010',	'Q3',	'Germany',			640),
97
+                    array('2010',	'Q4',	'Germany',			660),
98
+                    array('2011',	'Q1',	'Germany',			680),
99
+                    array('2011',	'Q2',	'Germany',			620),
100
+                    array('2011',	'Q3',	'Germany',			710),
101
+                    array('2011',	'Q4',	'Germany',			690),
102
+                    array('2010',	'Q1',	'Spain',			510),
103
+                    array('2010',	'Q2',	'Spain',			490),
104
+                    array('2010',	'Q3',	'Spain',			470),
105
+                    array('2010',	'Q4',	'Spain',			420),
106
+                    array('2011',	'Q1',	'Spain',			460),
107
+                    array('2011',	'Q2',	'Spain',			390),
108
+                    array('2011',	'Q3',	'Spain',			430),
109
+                    array('2011',	'Q4',	'Spain',			415),
110
+                    array('2010',	'Q1',	'Italy',			440),
111
+                    array('2010',	'Q2',	'Italy',			410),
112
+                    array('2010',	'Q3',	'Italy',			420),
113
+                    array('2010',	'Q4',	'Italy',			450),
114
+                    array('2011',	'Q1',	'Italy',			430),
115
+                    array('2011',	'Q2',	'Italy',			370),
116
+                    array('2011',	'Q3',	'Italy',			350),
117
+                    array('2011',	'Q4',	'Italy',			335),
118
+                    );
119 119
 $objPHPExcel->getActiveSheet()->fromArray($dataArray, NULL, 'A2');
120 120
 
121 121
 // Set title row bold
Please login to merge, or discard this patch.
Spacing   +73 added lines, -73 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
 
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
 require_once dirname(__FILE__) . '/../src/Bootstrap.php';
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,78 +52,78 @@  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', 'Year')
58 58
                               ->setCellValue('B1', 'Quarter')
59 59
                               ->setCellValue('C1', 'Country')
60 60
                               ->setCellValue('D1', 'Sales');
61 61
 
62
-$dataArray = array(array('2010',	'Q1',	'United States',	790),
63
-                   array('2010',	'Q2',	'United States',	730),
64
-                   array('2010',	'Q3',	'United States',	860),
65
-                   array('2010',	'Q4',	'United States',	850),
66
-                   array('2011',	'Q1',	'United States',	800),
67
-                   array('2011',	'Q2',	'United States',	700),
68
-                   array('2011',	'Q3',	'United States',	900),
69
-                   array('2011',	'Q4',	'United States',	950),
70
-                   array('2010',	'Q1',	'Belgium',			380),
71
-                   array('2010',	'Q2',	'Belgium',			390),
72
-                   array('2010',	'Q3',	'Belgium',			420),
73
-                   array('2010',	'Q4',	'Belgium',			460),
74
-                   array('2011',	'Q1',	'Belgium',			400),
75
-                   array('2011',	'Q2',	'Belgium',			350),
76
-                   array('2011',	'Q3',	'Belgium',			450),
77
-                   array('2011',	'Q4',	'Belgium',			500),
78
-                   array('2010',	'Q1',	'UK',				690),
79
-                   array('2010',	'Q2',	'UK',				610),
80
-                   array('2010',	'Q3',	'UK',				620),
81
-                   array('2010',	'Q4',	'UK',				600),
82
-                   array('2011',	'Q1',	'UK',				720),
83
-                   array('2011',	'Q2',	'UK',				650),
84
-                   array('2011',	'Q3',	'UK',				580),
85
-                   array('2011',	'Q4',	'UK',				510),
86
-                   array('2010',	'Q1',	'France',			510),
87
-                   array('2010',	'Q2',	'France',			490),
88
-                   array('2010',	'Q3',	'France',			460),
89
-                   array('2010',	'Q4',	'France', 			590),
90
-                   array('2011',	'Q1',	'France',			620),
91
-                   array('2011',	'Q2',	'France',			650),
92
-                   array('2011',	'Q3',	'France',			415),
93
-                   array('2011',	'Q4',	'France', 			570),
94
-                   array('2010',	'Q1',	'Germany',			720),
95
-                   array('2010',	'Q2',	'Germany',			680),
96
-                   array('2010',	'Q3',	'Germany',			640),
97
-                   array('2010',	'Q4',	'Germany',			660),
98
-                   array('2011',	'Q1',	'Germany',			680),
99
-                   array('2011',	'Q2',	'Germany',			620),
100
-                   array('2011',	'Q3',	'Germany',			710),
101
-                   array('2011',	'Q4',	'Germany',			690),
102
-                   array('2010',	'Q1',	'Spain',			510),
103
-                   array('2010',	'Q2',	'Spain',			490),
104
-                   array('2010',	'Q3',	'Spain',			470),
105
-                   array('2010',	'Q4',	'Spain',			420),
106
-                   array('2011',	'Q1',	'Spain',			460),
107
-                   array('2011',	'Q2',	'Spain',			390),
108
-                   array('2011',	'Q3',	'Spain',			430),
109
-                   array('2011',	'Q4',	'Spain',			415),
110
-                   array('2010',	'Q1',	'Italy',			440),
111
-                   array('2010',	'Q2',	'Italy',			410),
112
-                   array('2010',	'Q3',	'Italy',			420),
113
-                   array('2010',	'Q4',	'Italy',			450),
114
-                   array('2011',	'Q1',	'Italy',			430),
115
-                   array('2011',	'Q2',	'Italy',			370),
116
-                   array('2011',	'Q3',	'Italy',			350),
117
-                   array('2011',	'Q4',	'Italy',			335),
62
+$dataArray = array(array('2010', 'Q1', 'United States', 790),
63
+                   array('2010', 'Q2', 'United States', 730),
64
+                   array('2010', 'Q3', 'United States', 860),
65
+                   array('2010', 'Q4', 'United States', 850),
66
+                   array('2011', 'Q1', 'United States', 800),
67
+                   array('2011', 'Q2', 'United States', 700),
68
+                   array('2011', 'Q3', 'United States', 900),
69
+                   array('2011', 'Q4', 'United States', 950),
70
+                   array('2010', 'Q1', 'Belgium', 380),
71
+                   array('2010', 'Q2', 'Belgium', 390),
72
+                   array('2010', 'Q3', 'Belgium', 420),
73
+                   array('2010', 'Q4', 'Belgium', 460),
74
+                   array('2011', 'Q1', 'Belgium', 400),
75
+                   array('2011', 'Q2', 'Belgium', 350),
76
+                   array('2011', 'Q3', 'Belgium', 450),
77
+                   array('2011', 'Q4', 'Belgium', 500),
78
+                   array('2010', 'Q1', 'UK', 690),
79
+                   array('2010', 'Q2', 'UK', 610),
80
+                   array('2010', 'Q3', 'UK', 620),
81
+                   array('2010', 'Q4', 'UK', 600),
82
+                   array('2011', 'Q1', 'UK', 720),
83
+                   array('2011', 'Q2', 'UK', 650),
84
+                   array('2011', 'Q3', 'UK', 580),
85
+                   array('2011', 'Q4', 'UK', 510),
86
+                   array('2010', 'Q1', 'France', 510),
87
+                   array('2010', 'Q2', 'France', 490),
88
+                   array('2010', 'Q3', 'France', 460),
89
+                   array('2010', 'Q4', 'France', 590),
90
+                   array('2011', 'Q1', 'France', 620),
91
+                   array('2011', 'Q2', 'France', 650),
92
+                   array('2011', 'Q3', 'France', 415),
93
+                   array('2011', 'Q4', 'France', 570),
94
+                   array('2010', 'Q1', 'Germany', 720),
95
+                   array('2010', 'Q2', 'Germany', 680),
96
+                   array('2010', 'Q3', 'Germany', 640),
97
+                   array('2010', 'Q4', 'Germany', 660),
98
+                   array('2011', 'Q1', 'Germany', 680),
99
+                   array('2011', 'Q2', 'Germany', 620),
100
+                   array('2011', 'Q3', 'Germany', 710),
101
+                   array('2011', 'Q4', 'Germany', 690),
102
+                   array('2010', 'Q1', 'Spain', 510),
103
+                   array('2010', 'Q2', 'Spain', 490),
104
+                   array('2010', 'Q3', 'Spain', 470),
105
+                   array('2010', 'Q4', 'Spain', 420),
106
+                   array('2011', 'Q1', 'Spain', 460),
107
+                   array('2011', 'Q2', 'Spain', 390),
108
+                   array('2011', 'Q3', 'Spain', 430),
109
+                   array('2011', 'Q4', 'Spain', 415),
110
+                   array('2010', 'Q1', 'Italy', 440),
111
+                   array('2010', 'Q2', 'Italy', 410),
112
+                   array('2010', 'Q3', 'Italy', 420),
113
+                   array('2010', 'Q4', 'Italy', 450),
114
+                   array('2011', 'Q1', 'Italy', 430),
115
+                   array('2011', 'Q2', 'Italy', 370),
116
+                   array('2011', 'Q3', 'Italy', 350),
117
+                   array('2011', 'Q4', 'Italy', 335),
118 118
                   );
119 119
 $objPHPExcel->getActiveSheet()->fromArray($dataArray, NULL, 'A2');
120 120
 
121 121
 // Set title row bold
122
-echo date('H:i:s').' Set title row bold'.EOL;
122
+echo date('H:i:s') . ' Set title row bold' . EOL;
123 123
 $objPHPExcel->getActiveSheet()->getStyle('A1:D1')->getFont()->setBold(true);
124 124
 
125 125
 // Set autofilter
126
-echo date('H:i:s').' Set autofilter'.EOL;
126
+echo date('H:i:s') . ' Set autofilter' . EOL;
127 127
 // Always include the complete filter range!
128 128
 // Excel does support setting only the caption
129 129
 // row, but that's not a best practise...
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
 
136 136
 // Save Excel 2007 file
137
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
137
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
138 138
 $callStartTime = microtime(true);
139 139
 
140 140
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
@@ -142,14 +142,14 @@  discard block
 block discarded – undo
142 142
 $callEndTime = microtime(true);
143 143
 $callTime = $callEndTime - $callStartTime;
144 144
 
145
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
146
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
145
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
146
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
147 147
 // Echo memory usage
148
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
148
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
149 149
 
150 150
 
151 151
 // Save Excel 95 file
152
-echo date('H:i:s') , " Write to Excel5 format" , EOL;
152
+echo date('H:i:s'), " Write to Excel5 format", EOL;
153 153
 $callStartTime = microtime(true);
154 154
 
155 155
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
@@ -157,15 +157,15 @@  discard block
 block discarded – undo
157 157
 $callEndTime = microtime(true);
158 158
 $callTime = $callEndTime - $callStartTime;
159 159
 
160
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
161
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
160
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
161
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
162 162
 // Echo memory usage
163
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
163
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
164 164
 
165 165
 
166 166
 // Echo memory peak usage
167
-echo date('H:i:s').' Peak memory usage: '.(memory_get_peak_usage(true) / 1024 / 1024).' MB'.EOL;
167
+echo date('H:i:s') . ' Peak memory usage: ' . (memory_get_peak_usage(true) / 1024 / 1024) . ' MB' . EOL;
168 168
 
169 169
 // Echo done
170
-echo date('H:i:s').' Done writing files'.EOL;
171
-echo 'Files have been created in ' , getcwd() , EOL;
170
+echo date('H:i:s') . ' Done writing files' . EOL;
171
+echo 'Files have been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/28iterator.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 require_once dirname(__FILE__) . '/../src/Bootstrap.php';
39 39
 
40 40
 if (!file_exists("05featuredemo.xlsx")) {
41
-	exit("Please run 05featuredemo.php first." . EOL);
41
+    exit("Please run 05featuredemo.php first." . EOL);
42 42
 }
43 43
 
44 44
 echo date('H:i:s') , " Load from Excel2007 file" , EOL;
@@ -47,19 +47,19 @@  discard block
 block discarded – undo
47 47
 
48 48
 echo date('H:i:s') , " Iterate worksheets" , EOL;
49 49
 foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
50
-	echo 'Worksheet - ' , $worksheet->getTitle() , EOL;
50
+    echo 'Worksheet - ' , $worksheet->getTitle() , EOL;
51 51
 
52
-	foreach ($worksheet->getRowIterator() as $row) {
53
-		echo '    Row number - ' , $row->getRowIndex() , EOL;
52
+    foreach ($worksheet->getRowIterator() as $row) {
53
+        echo '    Row number - ' , $row->getRowIndex() , EOL;
54 54
 
55
-		$cellIterator = $row->getCellIterator();
56
-		$cellIterator->setIterateOnlyExistingCells(false); // Loop all cells, even if it is not set
57
-		foreach ($cellIterator as $cell) {
58
-			if (!is_null($cell)) {
59
-				echo '        Cell - ' , $cell->getCoordinate() , ' - ' , $cell->getCalculatedValue() , EOL;
60
-			}
61
-		}
62
-	}
55
+        $cellIterator = $row->getCellIterator();
56
+        $cellIterator->setIterateOnlyExistingCells(false); // Loop all cells, even if it is not set
57
+        foreach ($cellIterator as $cell) {
58
+            if (!is_null($cell)) {
59
+                echo '        Cell - ' , $cell->getCoordinate() , ' - ' , $cell->getCalculatedValue() , EOL;
60
+            }
61
+        }
62
+    }
63 63
 }
64 64
 
65 65
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 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,22 +41,22 @@  discard block
 block discarded – undo
41 41
 	exit("Please run 05featuredemo.php first." . EOL);
42 42
 }
43 43
 
44
-echo date('H:i:s') , " Load from Excel2007 file" , EOL;
44
+echo date('H:i:s'), " Load from Excel2007 file", EOL;
45 45
 $objReader = \PHPExcel\IOFactory::createReader('Excel2007');
46 46
 $objPHPExcel = $objReader->load("05featuredemo.xlsx");
47 47
 
48
-echo date('H:i:s') , " Iterate worksheets" , EOL;
48
+echo date('H:i:s'), " Iterate worksheets", EOL;
49 49
 foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
50
-	echo 'Worksheet - ' , $worksheet->getTitle() , EOL;
50
+	echo 'Worksheet - ', $worksheet->getTitle(), EOL;
51 51
 
52 52
 	foreach ($worksheet->getRowIterator() as $row) {
53
-		echo '    Row number - ' , $row->getRowIndex() , EOL;
53
+		echo '    Row number - ', $row->getRowIndex(), EOL;
54 54
 
55 55
 		$cellIterator = $row->getCellIterator();
56 56
 		$cellIterator->setIterateOnlyExistingCells(false); // Loop all cells, even if it is not set
57 57
 		foreach ($cellIterator as $cell) {
58 58
 			if (!is_null($cell)) {
59
-				echo '        Cell - ' , $cell->getCoordinate() , ' - ' , $cell->getCalculatedValue() , EOL;
59
+				echo '        Cell - ', $cell->getCoordinate(), ' - ', $cell->getCalculatedValue(), EOL;
60 60
 			}
61 61
 		}
62 62
 	}
@@ -64,4 +64,4 @@  discard block
 block discarded – undo
64 64
 
65 65
 
66 66
 // Echo memory peak usage
67
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
67
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
Please login to merge, or discard this patch.
Examples/43mergeWorkbooks.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 ini_set('display_errors', TRUE);
30 30
 ini_set('display_startup_errors', TRUE);
31 31
 
32
-define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
32
+define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
33 33
 
34 34
 date_default_timezone_set('Europe/London');
35 35
 
@@ -37,38 +37,38 @@  discard block
 block discarded – undo
37 37
 require_once dirname(__FILE__) . '/../src/Bootstrap.php';
38 38
 
39 39
 
40
-echo date('H:i:s') , " Load MergeBook1 from Excel2007 file" , EOL;
40
+echo date('H:i:s'), " Load MergeBook1 from Excel2007 file", EOL;
41 41
 $callStartTime = microtime(true);
42 42
 
43 43
 $objPHPExcel1 = \PHPExcel\IOFactory::load(dirname(__FILE__) . "/templates/43mergeBook1.xlsx");
44 44
 
45 45
 $callEndTime = microtime(true);
46 46
 $callTime = $callEndTime - $callStartTime;
47
-echo 'Call time to read Mergebook1 was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
47
+echo 'Call time to read Mergebook1 was ', sprintf('%.4f', $callTime), " seconds", EOL;
48 48
 // Echo memory usage
49
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
49
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
50 50
 
51 51
 
52
-echo date('H:i:s') , " Load MergeBook2 from Excel2007 file" , EOL;
52
+echo date('H:i:s'), " Load MergeBook2 from Excel2007 file", EOL;
53 53
 $callStartTime = microtime(true);
54 54
 
55 55
 $objPHPExcel2 = \PHPExcel\IOFactory::load(dirname(__FILE__) . "/templates/43mergeBook2.xlsx");
56 56
 
57 57
 $callEndTime = microtime(true);
58 58
 $callTime = $callEndTime - $callStartTime;
59
-echo 'Call time to read Mergebook2 was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
59
+echo 'Call time to read Mergebook2 was ', sprintf('%.4f', $callTime), " seconds", EOL;
60 60
 // Echo memory usage
61
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
61
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
62 62
 
63 63
 
64
-foreach($objPHPExcel2->getSheetNames() as $sheetName) {
64
+foreach ($objPHPExcel2->getSheetNames() as $sheetName) {
65 65
     $sheet = $objPHPExcel2->getSheetByName($sheetName);
66 66
     $sheet->setTitle($sheet->getTitle() . ' copied');
67 67
     $objPHPExcel1->addExternalSheet($sheet);
68 68
 }
69 69
 
70 70
 
71
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
71
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
72 72
 $callStartTime = microtime(true);
73 73
 
74 74
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel1, 'Excel2007');
@@ -77,15 +77,15 @@  discard block
 block discarded – undo
77 77
 $callEndTime = microtime(true);
78 78
 $callTime = $callEndTime - $callStartTime;
79 79
 
80
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
81
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
80
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
81
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
82 82
 // Echo memory usage
83
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
83
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
84 84
 
85 85
 
86 86
 // Echo memory peak usage
87
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
87
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
88 88
 
89 89
 // Echo done
90
-echo date('H:i:s') , " Done writing file" , EOL;
91
-echo 'File has been created in ' , getcwd() , EOL;
90
+echo date('H:i:s'), " Done writing file", EOL;
91
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/31docproperties_write-xls.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
 
58 58
 echo date('H:i:s') , " Adjust properties" , EOL;
59 59
 $objPHPExcel->getProperties()->setTitle("Office 95 XLS Test Document")
60
-							 ->setSubject("Office 95 XLS Test Document")
61
-							 ->setDescription("Test XLS document, generated using PHPExcel")
62
-							 ->setKeywords("office 95 biff php");
60
+                                ->setSubject("Office 95 XLS Test Document")
61
+                                ->setDescription("Test XLS document, generated using PHPExcel")
62
+                                ->setKeywords("office 95 biff php");
63 63
 
64 64
 
65 65
 // Save Excel 95 file
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
 echo 'Core Properties:' , EOL;
85 85
 echo '    Created by - ' , $objPHPExcel->getProperties()->getCreator() , EOL;
86 86
 echo '    Created on - ' , date('d-M-Y',$objPHPExcel->getProperties()->getCreated()) , ' at ' ,
87
-                       date('H:i:s',$objPHPExcel->getProperties()->getCreated()) , EOL;
87
+                        date('H:i:s',$objPHPExcel->getProperties()->getCreated()) , EOL;
88 88
 echo '    Last Modified by - ' , $objPHPExcel->getProperties()->getLastModifiedBy() , EOL;
89 89
 echo '    Last Modified on - ' , date('d-M-Y',$objPHPExcel->getProperties()->getModified()) , ' at ' ,
90
-                             date('H:i:s',$objPHPExcel->getProperties()->getModified()) , EOL;
90
+                                date('H:i:s',$objPHPExcel->getProperties()->getModified()) , EOL;
91 91
 echo '    Title - ' , $objPHPExcel->getProperties()->getTitle() , EOL;
92 92
 echo '    Subject - ' , $objPHPExcel->getProperties()->getSubject() , EOL;
93 93
 echo '    Description - ' , $objPHPExcel->getProperties()->getDescription() , EOL;
@@ -103,16 +103,16 @@  discard block
 block discarded – undo
103 103
 echo 'Custom Properties:' , EOL;
104 104
 $customProperties = $objPHPExcel->getProperties()->getCustomProperties();
105 105
 foreach($customProperties as $customProperty) {
106
-	$propertyValue = $objPHPExcel->getProperties()->getCustomPropertyValue($customProperty);
107
-	$propertyType = $objPHPExcel->getProperties()->getCustomPropertyType($customProperty);
108
-	echo '    ' , $customProperty , ' - (' , $propertyType , ') - ';
109
-	if ($propertyType == \PHPExcel\Document\Properties::PROPERTY_TYPE_DATE) {
110
-		echo date('d-M-Y H:i:s',$propertyValue) , EOL;
111
-	} elseif ($propertyType == \PHPExcel\Document\Properties::PROPERTY_TYPE_BOOLEAN) {
112
-		echo (($propertyValue) ? 'TRUE' : 'FALSE') , EOL;
113
-	} else {
114
-		echo $propertyValue , EOL;
115
-	}
106
+    $propertyValue = $objPHPExcel->getProperties()->getCustomPropertyValue($customProperty);
107
+    $propertyType = $objPHPExcel->getProperties()->getCustomPropertyType($customProperty);
108
+    echo '    ' , $customProperty , ' - (' , $propertyType , ') - ';
109
+    if ($propertyType == \PHPExcel\Document\Properties::PROPERTY_TYPE_DATE) {
110
+        echo date('d-M-Y H:i:s',$propertyValue) , EOL;
111
+    } elseif ($propertyType == \PHPExcel\Document\Properties::PROPERTY_TYPE_BOOLEAN) {
112
+        echo (($propertyValue) ? 'TRUE' : 'FALSE') , EOL;
113
+    } else {
114
+        echo $propertyValue , EOL;
115
+    }
116 116
 }
117 117
 
118 118
 // Echo memory peak usage
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 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
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 $inputFileName = 'templates/31docproperties.xls';
43 43
 
44 44
 
45
-echo date('H:i:s') , " Load Tests from $inputFileType file" , EOL;
45
+echo date('H:i:s'), " Load Tests from $inputFileType file", EOL;
46 46
 $callStartTime = microtime(true);
47 47
 
48 48
 $objPHPExcelReader = \PHPExcel\IOFactory::createReader($inputFileType);
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
 
51 51
 $callEndTime = microtime(true);
52 52
 $callTime = $callEndTime - $callStartTime;
53
-echo 'Call time to read Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
53
+echo 'Call time to read 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
-echo date('H:i:s') , " Adjust properties" , EOL;
58
+echo date('H:i:s'), " Adjust properties", EOL;
59 59
 $objPHPExcel->getProperties()->setTitle("Office 95 XLS Test Document")
60 60
 							 ->setSubject("Office 95 XLS Test Document")
61 61
 							 ->setDescription("Test XLS document, generated using PHPExcel")
@@ -63,57 +63,57 @@  discard block
 block discarded – undo
63 63
 
64 64
 
65 65
 // Save Excel 95 file
66
-echo date('H:i:s') , " Write to Excel5 format" , EOL;
66
+echo date('H:i:s'), " Write to Excel5 format", EOL;
67 67
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
68 68
 $objWriter->save(str_replace('.php', '.xls', __FILE__));
69
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
69
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
70 70
 
71 71
 
72 72
 // Echo memory peak usage
73
-echo date('H:i:s') , " Peak memory usage: " . (memory_get_peak_usage(true) / 1024 / 1024) . " MB" , EOL;
73
+echo date('H:i:s'), " Peak memory usage: " . (memory_get_peak_usage(true) / 1024 / 1024) . " MB", EOL;
74 74
 
75 75
 
76 76
 echo EOL;
77 77
 // Reread File
78
-echo date('H:i:s') , " Reread Excel5 file" , EOL;
78
+echo date('H:i:s'), " Reread Excel5 file", EOL;
79 79
 $objPHPExcelRead = \PHPExcel\IOFactory::load(str_replace('.php', '.xls', __FILE__));
80 80
 
81 81
 // Set properties
82
-echo date('H:i:s') , " Get properties" , EOL;
82
+echo date('H:i:s'), " Get properties", EOL;
83 83
 
84
-echo 'Core Properties:' , EOL;
85
-echo '    Created by - ' , $objPHPExcel->getProperties()->getCreator() , EOL;
86
-echo '    Created on - ' , date('d-M-Y',$objPHPExcel->getProperties()->getCreated()) , ' at ' ,
87
-                       date('H:i:s',$objPHPExcel->getProperties()->getCreated()) , EOL;
88
-echo '    Last Modified by - ' , $objPHPExcel->getProperties()->getLastModifiedBy() , EOL;
89
-echo '    Last Modified on - ' , date('d-M-Y',$objPHPExcel->getProperties()->getModified()) , ' at ' ,
90
-                             date('H:i:s',$objPHPExcel->getProperties()->getModified()) , EOL;
91
-echo '    Title - ' , $objPHPExcel->getProperties()->getTitle() , EOL;
92
-echo '    Subject - ' , $objPHPExcel->getProperties()->getSubject() , EOL;
93
-echo '    Description - ' , $objPHPExcel->getProperties()->getDescription() , EOL;
94
-echo '    Keywords: - ' , $objPHPExcel->getProperties()->getKeywords() , EOL;
84
+echo 'Core Properties:', EOL;
85
+echo '    Created by - ', $objPHPExcel->getProperties()->getCreator(), EOL;
86
+echo '    Created on - ', date('d-M-Y', $objPHPExcel->getProperties()->getCreated()), ' at ',
87
+                       date('H:i:s', $objPHPExcel->getProperties()->getCreated()), EOL;
88
+echo '    Last Modified by - ', $objPHPExcel->getProperties()->getLastModifiedBy(), EOL;
89
+echo '    Last Modified on - ', date('d-M-Y', $objPHPExcel->getProperties()->getModified()), ' at ',
90
+                             date('H:i:s', $objPHPExcel->getProperties()->getModified()), EOL;
91
+echo '    Title - ', $objPHPExcel->getProperties()->getTitle(), EOL;
92
+echo '    Subject - ', $objPHPExcel->getProperties()->getSubject(), EOL;
93
+echo '    Description - ', $objPHPExcel->getProperties()->getDescription(), EOL;
94
+echo '    Keywords: - ', $objPHPExcel->getProperties()->getKeywords(), EOL;
95 95
 
96 96
 
97
-echo 'Extended (Application) Properties:' , EOL;
98
-echo '    Category - ' , $objPHPExcel->getProperties()->getCategory() , EOL;
99
-echo '    Company - ' , $objPHPExcel->getProperties()->getCompany() , EOL;
100
-echo '    Manager - ' , $objPHPExcel->getProperties()->getManager() , EOL;
97
+echo 'Extended (Application) Properties:', EOL;
98
+echo '    Category - ', $objPHPExcel->getProperties()->getCategory(), EOL;
99
+echo '    Company - ', $objPHPExcel->getProperties()->getCompany(), EOL;
100
+echo '    Manager - ', $objPHPExcel->getProperties()->getManager(), EOL;
101 101
 
102 102
 
103
-echo 'Custom Properties:' , EOL;
103
+echo 'Custom Properties:', EOL;
104 104
 $customProperties = $objPHPExcel->getProperties()->getCustomProperties();
105
-foreach($customProperties as $customProperty) {
105
+foreach ($customProperties as $customProperty) {
106 106
 	$propertyValue = $objPHPExcel->getProperties()->getCustomPropertyValue($customProperty);
107 107
 	$propertyType = $objPHPExcel->getProperties()->getCustomPropertyType($customProperty);
108
-	echo '    ' , $customProperty , ' - (' , $propertyType , ') - ';
108
+	echo '    ', $customProperty, ' - (', $propertyType, ') - ';
109 109
 	if ($propertyType == \PHPExcel\Document\Properties::PROPERTY_TYPE_DATE) {
110
-		echo date('d-M-Y H:i:s',$propertyValue) , EOL;
110
+		echo date('d-M-Y H:i:s', $propertyValue), EOL;
111 111
 	} elseif ($propertyType == \PHPExcel\Document\Properties::PROPERTY_TYPE_BOOLEAN) {
112
-		echo (($propertyValue) ? 'TRUE' : 'FALSE') , EOL;
112
+		echo (($propertyValue) ? 'TRUE' : 'FALSE'), EOL;
113 113
 	} else {
114
-		echo $propertyValue , EOL;
114
+		echo $propertyValue, EOL;
115 115
 	}
116 116
 }
117 117
 
118 118
 // Echo memory peak usage
119
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) . " MB" , EOL;
119
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024) . " MB", EOL;
Please login to merge, or discard this patch.
Examples/24readfilter.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -39,19 +39,19 @@
 block discarded – undo
39 39
 
40 40
 // Check prerequisites
41 41
 if (!file_exists("06largescale.xlsx")) {
42
-	exit("Please run 06largescale.php first.\n");
42
+    exit("Please run 06largescale.php first.\n");
43 43
 }
44 44
 
45 45
 class MyReadFilter implements \PHPExcel\Reader\IReadFilter
46 46
 {
47
-	public function readCell($column, $row, $worksheetName = '') {
48
-		// Read title row and rows 20 - 30
49
-		if ($row == 1 || ($row >= 20 && $row <= 30)) {
50
-			return true;
51
-		}
47
+    public function readCell($column, $row, $worksheetName = '') {
48
+        // Read title row and rows 20 - 30
49
+        if ($row == 1 || ($row >= 20 && $row <= 30)) {
50
+            return true;
51
+        }
52 52
 
53
-		return false;
54
-	}
53
+        return false;
54
+    }
55 55
 }
56 56
 
57 57
 
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 ini_set('display_errors', TRUE);
30 30
 ini_set('display_startup_errors', TRUE);
31 31
 
32
-define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
32
+define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
33 33
 
34 34
 date_default_timezone_set('Europe/London');
35 35
 
@@ -55,23 +55,23 @@  discard block
 block discarded – undo
55 55
 }
56 56
 
57 57
 
58
-echo date('H:i:s') , " Load from Excel2007 file" , EOL;
58
+echo date('H:i:s'), " Load from Excel2007 file", EOL;
59 59
 $objReader = \PHPExcel\IOFactory::createReader('Excel2007');
60
-$objReader->setReadFilter( new MyReadFilter() );
60
+$objReader->setReadFilter(new MyReadFilter());
61 61
 $objPHPExcel = $objReader->load("06largescale.xlsx");
62 62
 
63
-echo date('H:i:s') , " Remove unnecessary rows" , EOL;
63
+echo date('H:i:s'), " Remove unnecessary rows", EOL;
64 64
 $objPHPExcel->getActiveSheet()->removeRow(2, 18);
65 65
 
66
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
66
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
67 67
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
68 68
 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
69
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
69
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
70 70
 
71 71
 
72 72
 // Echo memory peak usage
73
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
73
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
74 74
 
75 75
 // Echo done
76
-echo date('H:i:s') , " Done writing file" , EOL;
77
-echo 'File has been created in ' , getcwd() , EOL;
76
+echo date('H:i:s'), " Done writing file", EOL;
77
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.