Completed
Push — develop ( 6acd40...67d526 )
by Adrien
16:21
created
Examples/11documentsecurity.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("Maarten Balliauw")
48 48
 							 ->setLastModifiedBy("Maarten Balliauw")
49 49
 							 ->setTitle("Office 2007 XLSX Test Document")
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 
56 56
 // 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', 'Hello');
60 60
 $objPHPExcel->getActiveSheet()->setCellValue('B2', 'world!');
@@ -62,19 +62,19 @@  discard block
 block discarded – undo
62 62
 $objPHPExcel->getActiveSheet()->setCellValue('D2', 'world!');
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 document security" , EOL;
70
+echo date('H:i:s'), " Set document security", EOL;
71 71
 $objPHPExcel->getSecurity()->setLockWindows(true);
72 72
 $objPHPExcel->getSecurity()->setLockStructure(true);
73 73
 $objPHPExcel->getSecurity()->setWorkbookPassword("PHPExcel");
74 74
 
75 75
 
76 76
 // Set sheet security
77
-echo date('H:i:s') , " Set sheet security" , EOL;
77
+echo date('H:i:s'), " Set sheet security", EOL;
78 78
 $objPHPExcel->getActiveSheet()->getProtection()->setPassword('PHPExcel');
79 79
 $objPHPExcel->getActiveSheet()->getProtection()->setSheet(true); // This should be enabled in order to enable any of the following!
80 80
 $objPHPExcel->getActiveSheet()->getProtection()->setSort(true);
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
 
89 89
 // Save Excel 2007 file
90
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
90
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
91 91
 $callStartTime = microtime(true);
92 92
 
93 93
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
@@ -95,15 +95,15 @@  discard block
 block discarded – undo
95 95
 $callEndTime = microtime(true);
96 96
 $callTime = $callEndTime - $callStartTime;
97 97
 
98
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
99
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
98
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
99
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
100 100
 // Echo memory usage
101
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
101
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
102 102
 
103 103
 
104 104
 // Echo memory peak usage
105
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
105
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
106 106
 
107 107
 // Echo done
108
-echo date('H:i:s') , " Done writing file" , EOL;
109
-echo 'File has been created in ' , getcwd() , EOL;
108
+echo date('H:i:s'), " Done writing file", EOL;
109
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/31docproperties_write.php 1 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.xlsx';
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 2007 XLSX Test Document")
60 60
 							 ->setSubject("Office 2007 XLSX Test Document")
61 61
 							 ->setDescription("Test XLSX document, generated using PHPExcel")
@@ -63,57 +63,57 @@  discard block
 block discarded – undo
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->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
 
76 76
 echo EOL;
77 77
 // Reread File
78
-echo date('H:i:s') , " Reread Excel2007 file" , EOL;
78
+echo date('H:i:s'), " Reread Excel2007 file", EOL;
79 79
 $objPHPExcelRead = \PHPExcel\IOFactory::load(str_replace('.php', '.xlsx', __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/11documentsecurity-xls.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("Maarten Balliauw")
48 48
 							 ->setLastModifiedBy("Maarten Balliauw")
49 49
 							 ->setTitle("Office 2007 XLSX Test Document")
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 
56 56
 // 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', 'Hello');
60 60
 $objPHPExcel->getActiveSheet()->setCellValue('B2', 'world!');
@@ -62,19 +62,19 @@  discard block
 block discarded – undo
62 62
 $objPHPExcel->getActiveSheet()->setCellValue('D2', 'world!');
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 document security" , EOL;
70
+echo date('H:i:s'), " Set document security", EOL;
71 71
 $objPHPExcel->getSecurity()->setLockWindows(true);
72 72
 $objPHPExcel->getSecurity()->setLockStructure(true);
73 73
 $objPHPExcel->getSecurity()->setWorkbookPassword("PHPExcel");
74 74
 
75 75
 
76 76
 // Set sheet security
77
-echo date('H:i:s') , " Set sheet security" , EOL;
77
+echo date('H:i:s'), " Set sheet security", EOL;
78 78
 $objPHPExcel->getActiveSheet()->getProtection()->setPassword('PHPExcel');
79 79
 $objPHPExcel->getActiveSheet()->getProtection()->setSheet(true); // This should be enabled in order to enable any of the following!
80 80
 $objPHPExcel->getActiveSheet()->getProtection()->setSort(true);
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
 
89 89
 // Save Excel 95 file
90
-echo date('H:i:s') , " Write to Excel5 format" , EOL;
90
+echo date('H:i:s'), " Write to Excel5 format", EOL;
91 91
 $callStartTime = microtime(true);
92 92
 
93 93
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
@@ -95,15 +95,15 @@  discard block
 block discarded – undo
95 95
 $callEndTime = microtime(true);
96 96
 $callTime = $callEndTime - $callStartTime;
97 97
 
98
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
99
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
98
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
99
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
100 100
 // Echo memory usage
101
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
101
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
102 102
 
103 103
 
104 104
 // Echo memory peak usage
105
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
105
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
106 106
 
107 107
 // Echo done
108
-echo date('H:i:s') , " Done writing file" , EOL;
109
-echo 'File has been created in ' , getcwd() , EOL;
108
+echo date('H:i:s'), " Done writing file", EOL;
109
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/10autofilter-selection-2.php 1 patch
Spacing   +37 added lines, -37 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')
@@ -64,44 +64,44 @@  discard block
 block discarded – undo
64 64
 $startYear--;
65 65
 $endYear++;
66 66
 
67
-$years = range($startYear,$endYear);
68
-$periods = range(1,12);
69
-$countries = array(	'United States',	'UK',		'France',	'Germany',
70
-					'Italy',			'Spain',	'Portugal',	'Japan'
67
+$years = range($startYear, $endYear);
68
+$periods = range(1, 12);
69
+$countries = array('United States', 'UK', 'France', 'Germany',
70
+					'Italy', 'Spain', 'Portugal', 'Japan'
71 71
 				  );
72 72
 
73 73
 $row = 2;
74
-foreach($years as $year) {
75
-	foreach($periods as $period) {
76
-		foreach($countries as $country) {
77
-			$endDays = date('t',mktime(0,0,0,$period,1,$year));
78
-			for($i = 1; $i <= $endDays; ++$i) {
74
+foreach ($years as $year) {
75
+	foreach ($periods as $period) {
76
+		foreach ($countries as $country) {
77
+			$endDays = date('t', mktime(0, 0, 0, $period, 1, $year));
78
+			for ($i = 1; $i <= $endDays; ++$i) {
79 79
 				$eDate = \PHPExcel\Shared\Date::formattedPHPToExcel(
80 80
 					$year,
81 81
 					$period,
82 82
 					$i
83 83
 				);
84
-				$value = rand(500,1000) * (1 + rand(-0.25,+0.25));
84
+				$value = rand(500, 1000) * (1 + rand(-0.25, +0.25));
85 85
 				$salesValue = $invoiceValue = NULL;
86
-				$incomeOrExpenditure = rand(-1,1);
86
+				$incomeOrExpenditure = rand(-1, 1);
87 87
 				if ($incomeOrExpenditure == -1) {
88
-					$expenditure = rand(-500,-1000) * (1 + rand(-0.25,+0.25));
88
+					$expenditure = rand(-500, -1000) * (1 + rand(-0.25, +0.25));
89 89
 					$income = NULL;
90 90
 				} elseif ($incomeOrExpenditure == 1) {
91
-					$expenditure = rand(-500,-1000) * (1 + rand(-0.25,+0.25));
92
-					$income = rand(500,1000) * (1 + rand(-0.25,+0.25));;
91
+					$expenditure = rand(-500, -1000) * (1 + rand(-0.25, +0.25));
92
+					$income = rand(500, 1000) * (1 + rand(-0.25, +0.25)); ;
93 93
 				} else {
94 94
 					$expenditure = NULL;
95
-					$income = rand(500,1000) * (1 + rand(-0.25,+0.25));;
95
+					$income = rand(500, 1000) * (1 + rand(-0.25, +0.25)); ;
96 96
 				}
97
-				$dataArray = array(	$year,
97
+				$dataArray = array($year,
98 98
 									$period,
99 99
 									$country,
100 100
 									$eDate,
101 101
 									$income,
102 102
 									$expenditure,
103 103
 								  );
104
-				$objPHPExcel->getActiveSheet()->fromArray($dataArray, NULL, 'A'.$row++);
104
+				$objPHPExcel->getActiveSheet()->fromArray($dataArray, NULL, 'A' . $row++);
105 105
 			}
106 106
 		}
107 107
 	}
@@ -110,20 +110,20 @@  discard block
 block discarded – undo
110 110
 
111 111
 
112 112
 // Set styling
113
-echo date('H:i:s').' Set styling'.EOL;
113
+echo date('H:i:s') . ' Set styling' . EOL;
114 114
 $objPHPExcel->getActiveSheet()->getStyle('A1:F1')->getFont()->setBold(true);
115 115
 $objPHPExcel->getActiveSheet()->getStyle('A1:F1')->getAlignment()->setWrapText(TRUE);
116 116
 $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(12.5);
117 117
 $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(10.5);
118
-$objPHPExcel->getActiveSheet()->getStyle('D2:D'.$row)->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2);
119
-$objPHPExcel->getActiveSheet()->getStyle('E2:F'.$row)->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);
118
+$objPHPExcel->getActiveSheet()->getStyle('D2:D' . $row)->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2);
119
+$objPHPExcel->getActiveSheet()->getStyle('E2:F' . $row)->getNumberFormat()->setFormatCode(\PHPExcel\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);
120 120
 $objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(14);
121 121
 $objPHPExcel->getActiveSheet()->freezePane('A2');
122 122
 
123 123
 
124 124
 
125 125
 // Set autofilter range
126
-echo date('H:i:s').' Set autofilter range'.EOL;
126
+echo date('H:i:s') . ' Set autofilter range' . 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...
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
 // Set active filters
133 133
 $autoFilter = $objPHPExcel->getActiveSheet()->getAutoFilter();
134
-echo date('H:i:s').' Set active filters'.EOL;
134
+echo date('H:i:s') . ' Set active filters' . EOL;
135 135
 // Filter the Country column on a filter value of Germany
136 136
 //	As it's just a simple value filter, we can use FILTERTYPE_FILTER
137 137
 $autoFilter->getColumn('C')
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
 
177 177
 // Save Excel 2007 file
178
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
178
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
179 179
 $callStartTime = microtime(true);
180 180
 
181 181
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
@@ -183,14 +183,14 @@  discard block
 block discarded – undo
183 183
 $callEndTime = microtime(true);
184 184
 $callTime = $callEndTime - $callStartTime;
185 185
 
186
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
187
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
186
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
187
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
188 188
 // Echo memory usage
189
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
189
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
190 190
 
191 191
 
192 192
 // Save Excel 95 file
193
-echo date('H:i:s') , " Write to Excel5 format" , EOL;
193
+echo date('H:i:s'), " Write to Excel5 format", EOL;
194 194
 $callStartTime = microtime(true);
195 195
 
196 196
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
@@ -198,15 +198,15 @@  discard block
 block discarded – undo
198 198
 $callEndTime = microtime(true);
199 199
 $callTime = $callEndTime - $callStartTime;
200 200
 
201
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
202
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
201
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
202
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
203 203
 // Echo memory usage
204
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
204
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
205 205
 
206 206
 
207 207
 // Echo memory peak usage
208
-echo date('H:i:s').' Peak memory usage: '.(memory_get_peak_usage(true) / 1024 / 1024).' MB'.EOL;
208
+echo date('H:i:s') . ' Peak memory usage: ' . (memory_get_peak_usage(true) / 1024 / 1024) . ' MB' . EOL;
209 209
 
210 210
 // Echo done
211
-echo date('H:i:s').' Done writing files'.EOL;
212
-echo 'Files have been created in ' , getcwd() , EOL;
211
+echo date('H:i:s') . ' Done writing files' . EOL;
212
+echo 'Files have been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/01simple-download-pdf.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
 //$rendererLibrary = 'tcPDF5.9';
47 47
 $rendererLibrary = 'mPDF5.4';
48 48
 //$rendererLibrary = 'domPDF0.6.0beta3';
49
-$rendererLibraryPath = dirname(__FILE__).'/../../../libraries/PDF/' . $rendererLibrary;
49
+$rendererLibraryPath = dirname(__FILE__) . '/../../../libraries/PDF/' . $rendererLibrary;
50 50
 
51 51
 
52 52
 // Create new PHPExcel object
Please login to merge, or discard this patch.
Examples/35chartrender.php 1 patch
Spacing   +18 added lines, -18 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
 
@@ -38,55 +38,55 @@  discard block
 block discarded – undo
38 38
 
39 39
 	if ((isset($argc)) && ($argc > 1)) {
40 40
 	$inputFileNames = array();
41
-	for($i = 1; $i < $argc; ++$i) {
41
+	for ($i = 1; $i < $argc; ++$i) {
42 42
 		$inputFileNames[] = dirname(__FILE__) . '/templates/' . $argv[$i];
43 43
 	}
44 44
 } else {
45 45
 	$inputFileNames = glob($inputFileNames);
46 46
 }
47
-foreach($inputFileNames as $inputFileName) {
47
+foreach ($inputFileNames as $inputFileName) {
48 48
 	$inputFileNameShort = basename($inputFileName);
49 49
 
50 50
 	if (!file_exists($inputFileName)) {
51
-		echo date('H:i:s') , " File " , $inputFileNameShort , ' does not exist' , EOL;
51
+		echo date('H:i:s'), " File ", $inputFileNameShort, ' does not exist', EOL;
52 52
 		continue;
53 53
 	}
54 54
 
55
-	echo date('H:i:s') , " Load Test from $inputFileType file " , $inputFileNameShort , EOL;
55
+	echo date('H:i:s'), " Load Test from $inputFileType file ", $inputFileNameShort, EOL;
56 56
 
57 57
 	$objReader = \PHPExcel\IOFactory::createReader($inputFileType);
58 58
 	$objReader->setIncludeCharts(TRUE);
59 59
 	$objPHPExcel = $objReader->load($inputFileName);
60 60
 
61 61
 
62
-	echo date('H:i:s') , " Iterate worksheets looking at the charts" , EOL;
62
+	echo date('H:i:s'), " Iterate worksheets looking at the charts", EOL;
63 63
 	foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
64 64
 		$sheetName = $worksheet->getTitle();
65
-		echo 'Worksheet: ' , $sheetName , EOL;
65
+		echo 'Worksheet: ', $sheetName, EOL;
66 66
 
67 67
 		$chartNames = $worksheet->getChartNames();
68
-		if(empty($chartNames)) {
69
-			echo '    There are no charts in this worksheet' , EOL;
68
+		if (empty($chartNames)) {
69
+			echo '    There are no charts in this worksheet', EOL;
70 70
 		} else {
71 71
 			natsort($chartNames);
72
-			foreach($chartNames as $i => $chartName) {
72
+			foreach ($chartNames as $i => $chartName) {
73 73
 				$chart = $worksheet->getChartByName($chartName);
74 74
 				if (!is_null($chart->getTitle())) {
75
-					$caption = '"' . implode(' ',$chart->getTitle()->getCaption()) . '"';
75
+					$caption = '"' . implode(' ', $chart->getTitle()->getCaption()) . '"';
76 76
 				} else {
77 77
 					$caption = 'Untitled';
78 78
 				}
79
-				echo '    ' , $chartName , ' - ' , $caption , EOL;
80
-				echo str_repeat(' ',strlen($chartName)+3);
79
+				echo '    ', $chartName, ' - ', $caption, EOL;
80
+				echo str_repeat(' ', strlen($chartName) + 3);
81 81
 
82
-				$jpegFile = '35'.str_replace('.xlsx', '.jpg', substr($inputFileNameShort,2));
82
+				$jpegFile = '35' . str_replace('.xlsx', '.jpg', substr($inputFileNameShort, 2));
83 83
 				if (file_exists($jpegFile)) {
84 84
 					unlink($jpegFile);
85 85
 				}
86 86
 				try {
87 87
 					$chart->render($jpegFile);
88 88
 				} catch (Exception $e) {
89
-					echo 'Error rendering chart: ',$e->getMessage();
89
+					echo 'Error rendering chart: ', $e->getMessage();
90 90
 				}
91 91
 			}
92 92
 		}
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 }
99 99
 
100 100
 // Echo memory peak usage
101
-echo date('H:i:s') , ' Peak memory usage: ' , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
101
+echo date('H:i:s'), ' Peak memory usage: ', (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
102 102
 
103 103
 // Echo done
104
-echo date('H:i:s') , " Done rendering charts as images" , EOL;
105
-echo 'Image files have been created in ' , getcwd() , EOL;
104
+echo date('H:i:s'), " Done rendering charts as images", EOL;
105
+echo 'Image files have been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/33chartcreate-pie.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 ini_set('display_startup_errors', TRUE);
7 7
 date_default_timezone_set('Europe/London');
8 8
 
9
-define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
9
+define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
10 10
 
11 11
 date_default_timezone_set('Europe/London');
12 12
 
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
 $objWorksheet = $objPHPExcel->getActiveSheet();
45 45
 $objWorksheet->fromArray(
46 46
 	array(
47
-		array('',	2010,	2011,	2012),
48
-		array('Q1',   12,   15,		21),
49
-		array('Q2',   56,   73,		86),
50
-		array('Q3',   52,   61,		69),
51
-		array('Q4',   30,   32,		0),
47
+		array('', 2010, 2011, 2012),
48
+		array('Q1', 12, 15, 21),
49
+		array('Q2', 56, 73, 86),
50
+		array('Q3', 52, 61, 69),
51
+		array('Q4', 30, 32, 0),
52 52
 	)
53 53
 );
54 54
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 //		Data values
62 62
 //		Data Marker
63 63
 $dataSeriesLabels1 = array(
64
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	2011
64
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1), //	2011
65 65
 );
66 66
 //	Set the X-Axis Labels
67 67
 //		Datatype
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 //		Data values
72 72
 //		Data Marker
73 73
 $xAxisTickValues1 = array(
74
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4),	//	Q1 to Q4
74
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4), //	Q1 to Q4
75 75
 );
76 76
 //	Set the Data values for each data series we want to plot
77 77
 //		Datatype
@@ -86,11 +86,11 @@  discard block
 block discarded – undo
86 86
 
87 87
 //	Build the dataseries
88 88
 $series1 = new \PHPExcel\Chart\DataSeries(
89
-	\PHPExcel\Chart\DataSeries::TYPE_PIECHART,				// plotType
90
-	NULL,			                                        // plotGrouping (Pie charts don't have any grouping)
91
-	range(0, count($dataSeriesValues1)-1),					// plotOrder
92
-	$dataSeriesLabels1,										// plotLabel
93
-	$xAxisTickValues1,										// plotCategory
89
+	\PHPExcel\Chart\DataSeries::TYPE_PIECHART, // plotType
90
+	NULL, // plotGrouping (Pie charts don't have any grouping)
91
+	range(0, count($dataSeriesValues1) - 1), // plotOrder
92
+	$dataSeriesLabels1, // plotLabel
93
+	$xAxisTickValues1, // plotCategory
94 94
 	$dataSeriesValues1										// plotValues
95 95
 );
96 96
 
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
 
110 110
 //	Create the chart
111 111
 $chart1 = new \PHPExcel\Chart(
112
-	'chart1',		// name
113
-	$title1,		// title
114
-	$legend1,		// legend
115
-	$plotArea1,		// plotArea
116
-	true,			// plotVisibleOnly
117
-	0,				// displayBlanksAs
118
-	NULL,			// xAxisLabel
112
+	'chart1', // name
113
+	$title1, // title
114
+	$legend1, // legend
115
+	$plotArea1, // plotArea
116
+	true, // plotVisibleOnly
117
+	0, // displayBlanksAs
118
+	NULL, // xAxisLabel
119 119
 	NULL			// yAxisLabel		- Pie charts don't have a Y-Axis
120 120
 );
121 121
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 //		Data values
136 136
 //		Data Marker
137 137
 $dataSeriesLabels2 = array(
138
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1),	//	2011
138
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$C$1', NULL, 1), //	2011
139 139
 );
140 140
 //	Set the X-Axis Labels
141 141
 //		Datatype
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 //		Data values
146 146
 //		Data Marker
147 147
 $xAxisTickValues2 = array(
148
-	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4),	//	Q1 to Q4
148
+	new \PHPExcel\Chart\DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4), //	Q1 to Q4
149 149
 );
150 150
 //	Set the Data values for each data series we want to plot
151 151
 //		Datatype
@@ -160,11 +160,11 @@  discard block
 block discarded – undo
160 160
 
161 161
 //	Build the dataseries
162 162
 $series2 = new \PHPExcel\Chart\DataSeries(
163
-	\PHPExcel\Chart\DataSeries::TYPE_DONUTCHART,		// plotType
164
-	NULL,			                                // plotGrouping (Donut charts don't have any grouping)
165
-	range(0, count($dataSeriesValues2)-1),			// plotOrder
166
-	$dataSeriesLabels2,								// plotLabel
167
-	$xAxisTickValues2,								// plotCategory
163
+	\PHPExcel\Chart\DataSeries::TYPE_DONUTCHART, // plotType
164
+	NULL, // plotGrouping (Donut charts don't have any grouping)
165
+	range(0, count($dataSeriesValues2) - 1), // plotOrder
166
+	$dataSeriesLabels2, // plotLabel
167
+	$xAxisTickValues2, // plotCategory
168 168
 	$dataSeriesValues2								// plotValues
169 169
 );
170 170
 
@@ -181,13 +181,13 @@  discard block
 block discarded – undo
181 181
 
182 182
 //	Create the chart
183 183
 $chart2 = new \PHPExcel\Chart(
184
-	'chart2',		// name
185
-	$title2,		// title
186
-	NULL,			// legend
187
-	$plotArea2,		// plotArea
188
-	true,			// plotVisibleOnly
189
-	0,				// displayBlanksAs
190
-	NULL,			// xAxisLabel
184
+	'chart2', // name
185
+	$title2, // title
186
+	NULL, // legend
187
+	$plotArea2, // plotArea
188
+	true, // plotVisibleOnly
189
+	0, // displayBlanksAs
190
+	NULL, // xAxisLabel
191 191
 	NULL			// yAxisLabel		- Like Pie charts, Donut charts don't have a Y-Axis
192 192
 );
193 193
 
@@ -200,16 +200,16 @@  discard block
 block discarded – undo
200 200
 
201 201
 
202 202
 // Save Excel 2007 file
203
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
203
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
204 204
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
205 205
 $objWriter->setIncludeCharts(TRUE);
206 206
 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
207
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
207
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
208 208
 
209 209
 
210 210
 // Echo memory peak usage
211
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
211
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
212 212
 
213 213
 // Echo done
214
-echo date('H:i:s') , " Done writing file" , EOL;
215
-echo 'File has been created in ' , getcwd() , EOL;
214
+echo date('H:i:s'), " Done writing file", EOL;
215
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/06largescale-xls.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 ini_set('display_errors', TRUE);
31 31
 ini_set('display_startup_errors', TRUE);
32 32
 
33
-define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
33
+define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
34 34
 
35 35
 date_default_timezone_set('Europe/London');
36 36
 
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
 */
54 54
 
55 55
 // Create new PHPExcel object
56
-echo date('H:i:s') , " Create new PHPExcel object" , EOL;
56
+echo date('H:i:s'), " Create new PHPExcel object", EOL;
57 57
 $objPHPExcel = new \PHPExcel\Spreadsheet();
58 58
 
59 59
 // Set document properties
60
-echo date('H:i:s') , " Set properties" , EOL;
60
+echo date('H:i:s'), " Set properties", EOL;
61 61
 $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
62 62
 							 ->setLastModifiedBy("Maarten Balliauw")
63 63
 							 ->setTitle("Office 2007 XLSX Test Document")
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
 
70 70
 // Create a first sheet
71
-echo date('H:i:s') , " Add data" , EOL;
71
+echo date('H:i:s'), " Add data", EOL;
72 72
 $objPHPExcel->setActiveSheetIndex(0);
73 73
 $objPHPExcel->getActiveSheet()->setCellValue('A1', "Firstname");
74 74
 $objPHPExcel->getActiveSheet()->setCellValue('B1', "Lastname");
@@ -78,24 +78,24 @@  discard block
 block discarded – undo
78 78
 
79 79
 
80 80
 // Hide "Phone" and "fax" column
81
-echo date('H:i:s') , " Hide 'Phone' and 'fax' columns" , EOL;
81
+echo date('H:i:s'), " Hide 'Phone' and 'fax' columns", EOL;
82 82
 $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setVisible(false);
83 83
 $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setVisible(false);
84 84
 
85 85
 
86 86
 // Set outline levels
87
-echo date('H:i:s') , " Set outline levels" , EOL;
87
+echo date('H:i:s'), " Set outline levels", EOL;
88 88
 $objPHPExcel->getActiveSheet()->getColumnDimension('E')->setOutlineLevel(1)
89 89
                                                        ->setVisible(false)
90 90
                                                        ->setCollapsed(true);
91 91
 
92 92
 // Freeze panes
93
-echo date('H:i:s') , " Freeze panes" , EOL;
93
+echo date('H:i:s'), " Freeze panes", EOL;
94 94
 $objPHPExcel->getActiveSheet()->freezePane('A2');
95 95
 
96 96
 
97 97
 // Rows to repeat at top
98
-echo date('H:i:s') , " Rows to repeat at top" , EOL;
98
+echo date('H:i:s'), " Rows to repeat at top", EOL;
99 99
 $objPHPExcel->getActiveSheet()->getPageSetup()->setRowsToRepeatAtTopByStartAndEnd(1, 1);
100 100
 
101 101
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 
115 115
 
116 116
 // Save Excel 95 file
117
-echo date('H:i:s') , " Write to Excel5 format" , EOL;
117
+echo date('H:i:s'), " Write to Excel5 format", EOL;
118 118
 $callStartTime = microtime(true);
119 119
 
120 120
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
@@ -122,15 +122,15 @@  discard block
 block discarded – undo
122 122
 $callEndTime = microtime(true);
123 123
 $callTime = $callEndTime - $callStartTime;
124 124
 
125
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
126
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
125
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
126
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
127 127
 // Echo memory usage
128
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
128
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
129 129
 
130 130
 
131 131
 // Echo memory peak usage
132
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
132
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
133 133
 
134 134
 // Echo done
135
-echo date('H:i:s') , " Done writing file" , EOL;
136
-echo 'File has been created in ' , getcwd() , EOL;
135
+echo date('H:i:s'), " Done writing file", EOL;
136
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/13calculation.php 1 patch
Spacing   +16 added lines, -16 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
 mt_srand(1234567890);
@@ -41,16 +41,16 @@  discard block
 block discarded – undo
41 41
 
42 42
 
43 43
 // List functions
44
-echo date('H:i:s') , " List implemented functions" , EOL;
44
+echo date('H:i:s'), " List implemented functions", EOL;
45 45
 $objCalc = \PHPExcel\Calculation::getInstance();
46 46
 print_r($objCalc->listFunctionNames());
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
 // Add some data, we will use some formulas here
53
-echo date('H:i:s') , " Add some data and formulas" , EOL;
53
+echo date('H:i:s'), " Add some data and formulas", EOL;
54 54
 $objPHPExcel->getActiveSheet()->setCellValue('A14', 'Count:')
55 55
                               ->setCellValue('A15', 'Sum:')
56 56
                               ->setCellValue('A16', 'Max:')
@@ -191,20 +191,20 @@  discard block
 block discarded – undo
191 191
 
192 192
 
193 193
 // Calculated data
194
-echo date('H:i:s') , " Calculated data" , EOL;
194
+echo date('H:i:s'), " Calculated data", EOL;
195 195
 for ($col = 'B'; $col != 'G'; ++$col) {
196
-    for($row = 14; $row <= 41; ++$row) {
197
-        if ((!is_null($formula = $objPHPExcel->getActiveSheet()->getCell($col.$row)->getValue())) &&
196
+    for ($row = 14; $row <= 41; ++$row) {
197
+        if ((!is_null($formula = $objPHPExcel->getActiveSheet()->getCell($col . $row)->getValue())) &&
198 198
 			($formula[0] == '=')) {
199
-            echo 'Value of ' , $col , $row , ' [' , $formula , ']: ' ,
200
-                               $objPHPExcel->getActiveSheet()->getCell($col.$row)->getCalculatedValue() . EOL;
199
+            echo 'Value of ', $col, $row, ' [', $formula, ']: ',
200
+                               $objPHPExcel->getActiveSheet()->getCell($col . $row)->getCalculatedValue() . EOL;
201 201
         }
202 202
     }
203 203
 }
204 204
 
205 205
 
206 206
 // Save Excel 2007 file
207
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
207
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
208 208
 $callStartTime = microtime(true);
209 209
 
210 210
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
@@ -221,15 +221,15 @@  discard block
 block discarded – undo
221 221
 $callEndTime = microtime(true);
222 222
 $callTime = $callEndTime - $callStartTime;
223 223
 
224
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
225
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
224
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
225
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
226 226
 // Echo memory usage
227
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
227
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
228 228
 
229 229
 
230 230
 // Echo memory peak usage
231
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
231
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
232 232
 
233 233
 // Echo done
234
-echo date('H:i:s') , " Done writing file" , EOL;
235
-echo 'File has been created in ' , getcwd() , EOL;
234
+echo date('H:i:s'), " Done writing file", EOL;
235
+echo 'File has been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.