Completed
Push — develop ( 91417a...f02c33 )
by Adrien
18:11
created
Examples/16csv.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@
 block discarded – undo
45 45
 $callStartTime = microtime(true);
46 46
 
47 47
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'CSV')->setDelimiter(',')
48
-                                                                  ->setEnclosure('"')
49
-                                                                  ->setSheetIndex(0)
50
-                                                                  ->save(str_replace('.php', '.csv', __FILE__));
48
+                                                                    ->setEnclosure('"')
49
+                                                                    ->setSheetIndex(0)
50
+                                                                    ->save(str_replace('.php', '.csv', __FILE__));
51 51
 $callEndTime = microtime(true);
52 52
 $callTime = $callEndTime - $callStartTime;
53 53
 echo date('H:i:s') , " File written to " , str_replace('.php', '.csv', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 ini_set('display_startup_errors', TRUE);
32 32
 date_default_timezone_set('Europe/London');
33 33
 
34
-define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
34
+define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
35 35
 
36 36
 date_default_timezone_set('Europe/London');
37 37
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 require_once dirname(__FILE__) . '/../src/Bootstrap.php';
42 42
 
43 43
 
44
-echo date('H:i:s') , " Write to CSV format" , EOL;
44
+echo date('H:i:s'), " Write to CSV format", EOL;
45 45
 $callStartTime = microtime(true);
46 46
 
47 47
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'CSV')->setDelimiter(',')
@@ -50,13 +50,13 @@  discard block
 block discarded – undo
50 50
                                                                   ->save(str_replace('.php', '.csv', __FILE__));
51 51
 $callEndTime = microtime(true);
52 52
 $callTime = $callEndTime - $callStartTime;
53
-echo date('H:i:s') , " File written to " , str_replace('.php', '.csv', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
54
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
53
+echo date('H:i:s'), " File written to ", str_replace('.php', '.csv', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
54
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
55 55
 // Echo memory usage
56
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
56
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
57 57
 
58 58
 
59
-echo date('H:i:s') , " Read from CSV format" , EOL;
59
+echo date('H:i:s'), " Read from CSV format", EOL;
60 60
 $callStartTime = microtime(true);
61 61
 $objReader = \PHPExcel\IOFactory::createReader('CSV')->setDelimiter(',')
62 62
                                                     ->setEnclosure('"')
@@ -65,25 +65,25 @@  discard block
 block discarded – undo
65 65
 
66 66
 $callEndTime = microtime(true);
67 67
 $callTime = $callEndTime - $callStartTime;
68
-echo 'Call time to reload Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
68
+echo 'Call time to reload Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
69 69
 // Echo memory usage
70
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
70
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
71 71
 
72 72
 
73
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
73
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
74 74
 $callStartTime = microtime(true);
75 75
 
76 76
 $objWriter2007 = \PHPExcel\IOFactory::createWriter($objPHPExcelFromCSV, 'Excel2007');
77 77
 $objWriter2007->save(str_replace('.php', '.xlsx', __FILE__));
78 78
 $callEndTime = microtime(true);
79 79
 $callTime = $callEndTime - $callStartTime;
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
-echo date('H:i:s') , " Write to CSV format" , EOL;
86
+echo date('H:i:s'), " Write to CSV format", EOL;
87 87
 $callStartTime = microtime(true);
88 88
 
89 89
 $objWriterCSV = \PHPExcel\IOFactory::createWriter($objPHPExcelFromCSV, 'CSV');
@@ -91,15 +91,15 @@  discard block
 block discarded – undo
91 91
 $objWriterCSV->save(str_replace('.php', '_excel.csv', __FILE__));
92 92
 $callEndTime = microtime(true);
93 93
 $callTime = $callEndTime - $callStartTime;
94
-echo date('H:i:s') , " File written to " , str_replace('.php', '_excel.csv', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
95
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
94
+echo date('H:i:s'), " File written to ", str_replace('.php', '_excel.csv', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
95
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
96 96
 // Echo memory usage
97
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
97
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
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 writing files" , EOL;
105
-echo 'Files have been created in ' , getcwd() , EOL;
104
+echo date('H:i:s'), " Done writing files", EOL;
105
+echo 'Files have been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
Examples/OOCalcReader.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 /** \PHPExcel\IOFactory */
34 34
 require_once dirname(__FILE__) . '/../Classes/PHPExcel/IOFactory.php';
35 35
 
36
-echo date('H:i:s') , " Load from OOCalc file" , PHP_EOL;
36
+echo date('H:i:s'), " Load from OOCalc file", PHP_EOL;
37 37
 $callStartTime = microtime(true);
38 38
 
39 39
 $objReader = \PHPExcel\IOFactory::createReader('OOCalc');
@@ -42,20 +42,20 @@  discard block
 block discarded – undo
42 42
 
43 43
 $callEndTime = microtime(true);
44 44
 $callTime = $callEndTime - $callStartTime;
45
-echo 'Call time to read Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , PHP_EOL;
45
+echo 'Call time to read Workbook was ', sprintf('%.4f', $callTime), " seconds", PHP_EOL;
46 46
 // Echo memory usage
47
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , PHP_EOL;
47
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", PHP_EOL;
48 48
 
49 49
 
50
-echo date('H:i:s') , " Write to Excel2007 format" , PHP_EOL;
50
+echo date('H:i:s'), " Write to Excel2007 format", PHP_EOL;
51 51
 $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
52 52
 $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
53
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', __FILE__) , PHP_EOL;
53
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', __FILE__), PHP_EOL;
54 54
 
55 55
 
56 56
 // Echo memory peak usage
57
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , PHP_EOL;
57
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", PHP_EOL;
58 58
 
59 59
 // Echo done
60
-echo date('H:i:s') , " Done writing file" , PHP_EOL;
60
+echo date('H:i:s'), " Done writing file", PHP_EOL;
61 61
 
Please login to merge, or discard this patch.
Examples/11documentsecurity.php 2 patches
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.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,12 +45,12 @@
 block discarded – undo
45 45
 // Set document properties
46 46
 echo date('H:i:s') , " Set document properties" , EOL;
47 47
 $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
48
-							 ->setLastModifiedBy("Maarten Balliauw")
49
-							 ->setTitle("Office 2007 XLSX Test Document")
50
-							 ->setSubject("Office 2007 XLSX Test Document")
51
-							 ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
52
-							 ->setKeywords("office 2007 openxml php")
53
-							 ->setCategory("Test result file");
48
+                                ->setLastModifiedBy("Maarten Balliauw")
49
+                                ->setTitle("Office 2007 XLSX Test Document")
50
+                                ->setSubject("Office 2007 XLSX Test Document")
51
+                                ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
52
+                                ->setKeywords("office 2007 openxml php")
53
+                                ->setCategory("Test result file");
54 54
 
55 55
 
56 56
 // Add some data
Please login to merge, or discard this patch.
Examples/31docproperties_write.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 2007 XLSX Test Document")
60
-							 ->setSubject("Office 2007 XLSX Test Document")
61
-							 ->setDescription("Test XLSX document, generated using PHPExcel")
62
-							 ->setKeywords("office 2007 openxml php");
60
+                                ->setSubject("Office 2007 XLSX Test Document")
61
+                                ->setDescription("Test XLSX document, generated using PHPExcel")
62
+                                ->setKeywords("office 2007 openxml php");
63 63
 
64 64
 
65 65
 // Save Excel 2007 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.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 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,12 +45,12 @@
 block discarded – undo
45 45
 // Set document properties
46 46
 echo date('H:i:s') , " Set document properties" , EOL;
47 47
 $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
48
-							 ->setLastModifiedBy("Maarten Balliauw")
49
-							 ->setTitle("Office 2007 XLSX Test Document")
50
-							 ->setSubject("Office 2007 XLSX Test Document")
51
-							 ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
52
-							 ->setKeywords("office 2007 openxml php")
53
-							 ->setCategory("Test result file");
48
+                                ->setLastModifiedBy("Maarten Balliauw")
49
+                                ->setTitle("Office 2007 XLSX Test Document")
50
+                                ->setSubject("Office 2007 XLSX Test Document")
51
+                                ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
52
+                                ->setKeywords("office 2007 openxml php")
53
+                                ->setCategory("Test result file");
54 54
 
55 55
 
56 56
 // Add some data
Please login to merge, or discard this patch.
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 2 patches
Indentation   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -44,22 +44,22 @@  discard block
 block discarded – undo
44 44
 // Set document properties
45 45
 echo date('H:i:s').' Set document properties'.EOL;
46 46
 $objPHPExcel->getProperties()->setCreator('Maarten Balliauw')
47
-							 ->setLastModifiedBy('Maarten Balliauw')
48
-							 ->setTitle('PHPExcel Test Document')
49
-							 ->setSubject('PHPExcel Test Document')
50
-							 ->setDescription('Test document for PHPExcel, generated using PHP classes.')
51
-							 ->setKeywords('office PHPExcel php')
52
-							 ->setCategory('Test result file');
47
+                                ->setLastModifiedBy('Maarten Balliauw')
48
+                                ->setTitle('PHPExcel Test Document')
49
+                                ->setSubject('PHPExcel Test Document')
50
+                                ->setDescription('Test document for PHPExcel, generated using PHP classes.')
51
+                                ->setKeywords('office PHPExcel php')
52
+                                ->setCategory('Test result file');
53 53
 
54 54
 // Create the worksheet
55 55
 echo date('H:i:s').' Add data'.EOL;
56 56
 $objPHPExcel->setActiveSheetIndex(0);
57 57
 $objPHPExcel->getActiveSheet()->setCellValue('A1', 'Financial Year')
58
-                              ->setCellValue('B1', 'Financial Period')
59
-                              ->setCellValue('C1', 'Country')
60
-                              ->setCellValue('D1', 'Date')
61
-                              ->setCellValue('E1', 'Sales Value')
62
-                              ->setCellValue('F1', 'Expenditure');
58
+                                ->setCellValue('B1', 'Financial Period')
59
+                                ->setCellValue('C1', 'Country')
60
+                                ->setCellValue('D1', 'Date')
61
+                                ->setCellValue('E1', 'Sales Value')
62
+                                ->setCellValue('F1', 'Expenditure');
63 63
 $startYear = $endYear = $currentYear = date('Y');
64 64
 $startYear--;
65 65
 $endYear++;
@@ -67,44 +67,44 @@  discard block
 block discarded – undo
67 67
 $years = range($startYear,$endYear);
68 68
 $periods = range(1,12);
69 69
 $countries = array(	'United States',	'UK',		'France',	'Germany',
70
-					'Italy',			'Spain',	'Portugal',	'Japan'
71
-				  );
70
+                    'Italy',			'Spain',	'Portugal',	'Japan'
71
+                    );
72 72
 
73 73
 $row = 2;
74 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
-				$eDate = \PHPExcel\Shared\Date::formattedPHPToExcel(
80
-					$year,
81
-					$period,
82
-					$i
83
-				);
84
-				$value = rand(500,1000) * (1 + rand(-0.25,+0.25));
85
-				$salesValue = $invoiceValue = NULL;
86
-				$incomeOrExpenditure = rand(-1,1);
87
-				if ($incomeOrExpenditure == -1) {
88
-					$expenditure = rand(-500,-1000) * (1 + rand(-0.25,+0.25));
89
-					$income = NULL;
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));;
93
-				} else {
94
-					$expenditure = NULL;
95
-					$income = rand(500,1000) * (1 + rand(-0.25,+0.25));;
96
-				}
97
-				$dataArray = array(	$year,
98
-									$period,
99
-									$country,
100
-									$eDate,
101
-									$income,
102
-									$expenditure,
103
-								  );
104
-				$objPHPExcel->getActiveSheet()->fromArray($dataArray, NULL, 'A'.$row++);
105
-			}
106
-		}
107
-	}
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
+                $eDate = \PHPExcel\Shared\Date::formattedPHPToExcel(
80
+                    $year,
81
+                    $period,
82
+                    $i
83
+                );
84
+                $value = rand(500,1000) * (1 + rand(-0.25,+0.25));
85
+                $salesValue = $invoiceValue = NULL;
86
+                $incomeOrExpenditure = rand(-1,1);
87
+                if ($incomeOrExpenditure == -1) {
88
+                    $expenditure = rand(-500,-1000) * (1 + rand(-0.25,+0.25));
89
+                    $income = NULL;
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));;
93
+                } else {
94
+                    $expenditure = NULL;
95
+                    $income = rand(500,1000) * (1 + rand(-0.25,+0.25));;
96
+                }
97
+                $dataArray = array(	$year,
98
+                                    $period,
99
+                                    $country,
100
+                                    $eDate,
101
+                                    $income,
102
+                                    $expenditure,
103
+                                    );
104
+                $objPHPExcel->getActiveSheet()->fromArray($dataArray, NULL, 'A'.$row++);
105
+            }
106
+        }
107
+    }
108 108
 }
109 109
 $row--;
110 110
 
@@ -137,37 +137,37 @@  discard block
 block discarded – undo
137 137
 $autoFilter->getColumn('C')
138 138
     ->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER)
139 139
     ->createRule()
140
-		->setRule(
141
-			\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL,
142
-			'Germany'
143
-		);
140
+        ->setRule(
141
+            \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL,
142
+            'Germany'
143
+        );
144 144
 // Filter the Date column on a filter value of the year to date
145 145
 $autoFilter->getColumn('D')
146
-	->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER)
147
-	->createRule()
148
-		->setRule(
149
-			\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL,
150
-			NULL,
151
-			\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE
152
-		)
153
-		->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER);
146
+    ->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER)
147
+    ->createRule()
148
+        ->setRule(
149
+            \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL,
150
+            NULL,
151
+            \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE
152
+        )
153
+        ->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER);
154 154
 // Display only sales values that are between 400 and 600
155 155
 $autoFilter->getColumn('E')
156 156
     ->setFilterType(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER)
157 157
     ->createRule()
158
-		->setRule(
159
-			\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL,
160
-			400
161
-		)
162
-		->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER);
158
+        ->setRule(
159
+            \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL,
160
+            400
161
+        )
162
+        ->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER);
163 163
 $autoFilter->getColumn('E')
164 164
     ->setJoin(\PHPExcel\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND)
165 165
     ->createRule()
166
-		->setRule(
167
-			\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL,
168
-			600
169
-		)
170
-		->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER);
166
+        ->setRule(
167
+            \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL,
168
+            600
169
+        )
170
+        ->setRuleType(\PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER);
171 171
 
172 172
 
173 173
 // Set active sheet index to the first sheet, so Excel opens this as the first sheet
Please login to merge, or discard this patch.
Spacing   +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 3 patches
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.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,8 +31,9 @@
 block discarded – undo
31 31
 ini_set('display_startup_errors', TRUE);
32 32
 date_default_timezone_set('Europe/London');
33 33
 
34
-if (PHP_SAPI == 'cli')
34
+if (PHP_SAPI == 'cli') {
35 35
 	die('This example should only be run from a Web Browser');
36
+}
36 37
 
37 38
 /** Include PHPExcel */
38 39
 require_once dirname(__FILE__) . '/../src/Bootstrap.php';
Please login to merge, or discard this patch.
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 date_default_timezone_set('Europe/London');
32 32
 
33 33
 if (PHP_SAPI == 'cli')
34
-	die('This example should only be run from a Web Browser');
34
+    die('This example should only be run from a Web Browser');
35 35
 
36 36
 /** Include PhpSpreadsheet */
37 37
 require_once dirname(__FILE__) . '/../src/Bootstrap.php';
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
 
54 54
 // Set document properties
55 55
 $objPhpSpreadsheet->getProperties()->setCreator("Maarten Balliauw")
56
-	->setLastModifiedBy("Maarten Balliauw")
57
-	->setTitle("PDF Test Document")
58
-	->setSubject("PDF Test Document")
59
-	->setDescription("Test document for PDF, generated using PHP classes.")
60
-	->setKeywords("pdf php")
61
-	->setCategory("Test result file");
56
+    ->setLastModifiedBy("Maarten Balliauw")
57
+    ->setTitle("PDF Test Document")
58
+    ->setSubject("PDF Test Document")
59
+    ->setDescription("Test document for PDF, generated using PHP classes.")
60
+    ->setKeywords("pdf php")
61
+    ->setCategory("Test result file");
62 62
 
63 63
 
64 64
 // Add some data
@@ -83,13 +83,13 @@  discard block
 block discarded – undo
83 83
 
84 84
 if (!PhpSpreadsheet\Settings::setPdfRenderer(
85 85
         $rendererName,
86
-		$rendererLibraryPath
87
-	)) {
88
-	die(
89
-		'NOTICE: Please set the $rendererName and $rendererLibraryPath values' .
90
-		'<br />' .
91
-		'at the top of this script as appropriate for your directory structure'
92
-	);
86
+        $rendererLibraryPath
87
+    )) {
88
+    die(
89
+        'NOTICE: Please set the $rendererName and $rendererLibraryPath values' .
90
+        '<br />' .
91
+        'at the top of this script as appropriate for your directory structure'
92
+    );
93 93
 }
94 94
 
95 95
 
Please login to merge, or discard this patch.
Examples/35chartrender.php 2 patches
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -22,79 +22,79 @@
 block discarded – undo
22 22
 
23 23
 
24 24
 if (!PHPExcel\Settings::setChartRenderer(
25
-		$rendererName,
26
-		$rendererLibraryPath
27
-	)) {
28
-	die(
29
-		'NOTICE: Please set the $rendererName and $rendererLibraryPath values' .
30
-		EOL .
31
-		'at the top of this script as appropriate for your directory structure'
32
-	);
25
+        $rendererName,
26
+        $rendererLibraryPath
27
+    )) {
28
+    die(
29
+        'NOTICE: Please set the $rendererName and $rendererLibraryPath values' .
30
+        EOL .
31
+        'at the top of this script as appropriate for your directory structure'
32
+    );
33 33
 }
34 34
 
35 35
 
36 36
 $inputFileType = 'Excel2007';
37 37
 $inputFileNames = 'templates/32readwrite*[0-9].xlsx';
38 38
 
39
-	if ((isset($argc)) && ($argc > 1)) {
40
-	$inputFileNames = array();
41
-	for($i = 1; $i < $argc; ++$i) {
42
-		$inputFileNames[] = dirname(__FILE__) . '/templates/' . $argv[$i];
43
-	}
39
+    if ((isset($argc)) && ($argc > 1)) {
40
+    $inputFileNames = array();
41
+    for($i = 1; $i < $argc; ++$i) {
42
+        $inputFileNames[] = dirname(__FILE__) . '/templates/' . $argv[$i];
43
+    }
44 44
 } else {
45
-	$inputFileNames = glob($inputFileNames);
45
+    $inputFileNames = glob($inputFileNames);
46 46
 }
47 47
 foreach($inputFileNames as $inputFileName) {
48
-	$inputFileNameShort = basename($inputFileName);
49
-
50
-	if (!file_exists($inputFileName)) {
51
-		echo date('H:i:s') , " File " , $inputFileNameShort , ' does not exist' , EOL;
52
-		continue;
53
-	}
54
-
55
-	echo date('H:i:s') , " Load Test from $inputFileType file " , $inputFileNameShort , EOL;
56
-
57
-	$objReader = \PHPExcel\IOFactory::createReader($inputFileType);
58
-	$objReader->setIncludeCharts(TRUE);
59
-	$objPHPExcel = $objReader->load($inputFileName);
60
-
61
-
62
-	echo date('H:i:s') , " Iterate worksheets looking at the charts" , EOL;
63
-	foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
64
-		$sheetName = $worksheet->getTitle();
65
-		echo 'Worksheet: ' , $sheetName , EOL;
66
-
67
-		$chartNames = $worksheet->getChartNames();
68
-		if(empty($chartNames)) {
69
-			echo '    There are no charts in this worksheet' , EOL;
70
-		} else {
71
-			natsort($chartNames);
72
-			foreach($chartNames as $i => $chartName) {
73
-				$chart = $worksheet->getChartByName($chartName);
74
-				if (!is_null($chart->getTitle())) {
75
-					$caption = '"' . implode(' ',$chart->getTitle()->getCaption()) . '"';
76
-				} else {
77
-					$caption = 'Untitled';
78
-				}
79
-				echo '    ' , $chartName , ' - ' , $caption , EOL;
80
-				echo str_repeat(' ',strlen($chartName)+3);
81
-
82
-				$jpegFile = '35'.str_replace('.xlsx', '.jpg', substr($inputFileNameShort,2));
83
-				if (file_exists($jpegFile)) {
84
-					unlink($jpegFile);
85
-				}
86
-				try {
87
-					$chart->render($jpegFile);
88
-				} catch (Exception $e) {
89
-					echo 'Error rendering chart: ',$e->getMessage();
90
-				}
91
-			}
92
-		}
93
-	}
94
-
95
-
96
-	$objPHPExcel->disconnectWorksheets();
97
-	unset($objPHPExcel);
48
+    $inputFileNameShort = basename($inputFileName);
49
+
50
+    if (!file_exists($inputFileName)) {
51
+        echo date('H:i:s') , " File " , $inputFileNameShort , ' does not exist' , EOL;
52
+        continue;
53
+    }
54
+
55
+    echo date('H:i:s') , " Load Test from $inputFileType file " , $inputFileNameShort , EOL;
56
+
57
+    $objReader = \PHPExcel\IOFactory::createReader($inputFileType);
58
+    $objReader->setIncludeCharts(TRUE);
59
+    $objPHPExcel = $objReader->load($inputFileName);
60
+
61
+
62
+    echo date('H:i:s') , " Iterate worksheets looking at the charts" , EOL;
63
+    foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
64
+        $sheetName = $worksheet->getTitle();
65
+        echo 'Worksheet: ' , $sheetName , EOL;
66
+
67
+        $chartNames = $worksheet->getChartNames();
68
+        if(empty($chartNames)) {
69
+            echo '    There are no charts in this worksheet' , EOL;
70
+        } else {
71
+            natsort($chartNames);
72
+            foreach($chartNames as $i => $chartName) {
73
+                $chart = $worksheet->getChartByName($chartName);
74
+                if (!is_null($chart->getTitle())) {
75
+                    $caption = '"' . implode(' ',$chart->getTitle()->getCaption()) . '"';
76
+                } else {
77
+                    $caption = 'Untitled';
78
+                }
79
+                echo '    ' , $chartName , ' - ' , $caption , EOL;
80
+                echo str_repeat(' ',strlen($chartName)+3);
81
+
82
+                $jpegFile = '35'.str_replace('.xlsx', '.jpg', substr($inputFileNameShort,2));
83
+                if (file_exists($jpegFile)) {
84
+                    unlink($jpegFile);
85
+                }
86
+                try {
87
+                    $chart->render($jpegFile);
88
+                } catch (Exception $e) {
89
+                    echo 'Error rendering chart: ',$e->getMessage();
90
+                }
91
+            }
92
+        }
93
+    }
94
+
95
+
96
+    $objPHPExcel->disconnectWorksheets();
97
+    unset($objPHPExcel);
98 98
 }
99 99
 
100 100
 // Echo memory peak usage
Please login to merge, or discard this 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 2 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
 $objPHPExcel = new \PHPExcel\Spreadsheet();
44 44
 $objWorksheet = $objPHPExcel->getActiveSheet();
45 45
 $objWorksheet->fromArray(
46
-	array(
47
-		array('',	2010,	2011,	2012),
48
-		array('Q1',   12,   15,		21),
49
-		array('Q2',   56,   73,		86),
50
-		array('Q3',   52,   61,		69),
51
-		array('Q4',   30,   32,		0),
52
-	)
46
+    array(
47
+        array('',	2010,	2011,	2012),
48
+        array('Q1',   12,   15,		21),
49
+        array('Q2',   56,   73,		86),
50
+        array('Q3',   52,   61,		69),
51
+        array('Q4',   30,   32,		0),
52
+    )
53 53
 );
54 54
 
55 55
 
@@ -61,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
@@ -81,17 +81,17 @@  discard block
 block discarded – undo
81 81
 //		Data values
82 82
 //		Data Marker
83 83
 $dataSeriesValues1 = array(
84
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', NULL, 4),
84
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', NULL, 4),
85 85
 );
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
94
-	$dataSeriesValues1										// plotValues
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
+    $dataSeriesValues1										// plotValues
95 95
 );
96 96
 
97 97
 //	Set up a layout object for the Pie chart
@@ -109,14 +109,14 @@  discard block
 block discarded – undo
109 109
 
110 110
 //	Create the chart
111 111
 $chart1 = new \PHPExcel\Chart(
112
-	'chart1',		// name
113
-	$title1,		// title
114
-	$legend1,		// legend
115
-	$plotArea1,		// plotArea
116
-	true,			// plotVisibleOnly
117
-	0,				// displayBlanksAs
118
-	NULL,			// xAxisLabel
119
-	NULL			// yAxisLabel		- Pie charts don't have a Y-Axis
112
+    'chart1',		// name
113
+    $title1,		// title
114
+    $legend1,		// legend
115
+    $plotArea1,		// plotArea
116
+    true,			// plotVisibleOnly
117
+    0,				// displayBlanksAs
118
+    NULL,			// xAxisLabel
119
+    NULL			// yAxisLabel		- Pie charts don't have a Y-Axis
120 120
 );
121 121
 
122 122
 //	Set the position where the chart should appear in the worksheet
@@ -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
@@ -155,17 +155,17 @@  discard block
 block discarded – undo
155 155
 //		Data values
156 156
 //		Data Marker
157 157
 $dataSeriesValues2 = array(
158
-	new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', NULL, 4),
158
+    new \PHPExcel\Chart\DataSeriesValues('Number', 'Worksheet!$C$2:$C$5', NULL, 4),
159 159
 );
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
168
-	$dataSeriesValues2								// plotValues
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
+    $dataSeriesValues2								// plotValues
169 169
 );
170 170
 
171 171
 //	Set up a layout object for the Pie chart
@@ -181,14 +181,14 @@  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
191
-	NULL			// yAxisLabel		- Like Pie charts, Donut charts don't have a Y-Axis
184
+    'chart2',		// name
185
+    $title2,		// title
186
+    NULL,			// legend
187
+    $plotArea2,		// plotArea
188
+    true,			// plotVisibleOnly
189
+    0,				// displayBlanksAs
190
+    NULL,			// xAxisLabel
191
+    NULL			// yAxisLabel		- Like Pie charts, Donut charts don't have a Y-Axis
192 192
 );
193 193
 
194 194
 //	Set the position where the chart should appear in the worksheet
Please login to merge, or discard this 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.