Completed
Push — develop ( 685e29...09d456 )
by Adrien
14:14
created
Examples/32chartreadwrite.php 2 patches
Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -17,81 +17,81 @@
 block discarded – undo
17 17
 $inputFileNames = 'templates/32readwrite*[0-9].xlsx';
18 18
 
19 19
 if ((isset($argc)) && ($argc > 1)) {
20
-	$inputFileNames = array();
21
-	for($i = 1; $i < $argc; ++$i) {
22
-		$inputFileNames[] = dirname(__FILE__) . '/templates/' . $argv[$i];
23
-	}
20
+    $inputFileNames = array();
21
+    for($i = 1; $i < $argc; ++$i) {
22
+        $inputFileNames[] = dirname(__FILE__) . '/templates/' . $argv[$i];
23
+    }
24 24
 } else {
25
-	$inputFileNames = glob($inputFileNames);
25
+    $inputFileNames = glob($inputFileNames);
26 26
 }
27 27
 foreach($inputFileNames as $inputFileName) {
28
-	$inputFileNameShort = basename($inputFileName);
29
-
30
-	if (!file_exists($inputFileName)) {
31
-		echo date('H:i:s') , " File " , $inputFileNameShort , ' does not exist' , EOL;
32
-		continue;
33
-	}
34
-
35
-	echo date('H:i:s') , " Load Test from $inputFileType file " , $inputFileNameShort , EOL;
36
-
37
-	$objReader = \PHPExcel\IOFactory::createReader($inputFileType);
38
-	$objReader->setIncludeCharts(TRUE);
39
-	$objPHPExcel = $objReader->load($inputFileName);
40
-
41
-
42
-	echo date('H:i:s') , " Iterate worksheets looking at the charts" , EOL;
43
-	foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
44
-		$sheetName = $worksheet->getTitle();
45
-		echo 'Worksheet: ' , $sheetName , EOL;
46
-
47
-		$chartNames = $worksheet->getChartNames();
48
-		if(empty($chartNames)) {
49
-			echo '    There are no charts in this worksheet' , EOL;
50
-		} else {
51
-			natsort($chartNames);
52
-			foreach($chartNames as $i => $chartName) {
53
-				$chart = $worksheet->getChartByName($chartName);
54
-				if (!is_null($chart->getTitle())) {
55
-					$caption = '"' . implode(' ',$chart->getTitle()->getCaption()) . '"';
56
-				} else {
57
-					$caption = 'Untitled';
58
-				}
59
-				echo '    ' , $chartName , ' - ' , $caption , EOL;
60
-				echo str_repeat(' ',strlen($chartName)+3);
61
-				$groupCount = $chart->getPlotArea()->getPlotGroupCount();
62
-				if ($groupCount == 1) {
63
-					$chartType = $chart->getPlotArea()->getPlotGroupByIndex(0)->getPlotType();
64
-					echo '    ' , $chartType , EOL;
65
-				} else {
66
-					$chartTypes = array();
67
-					for($i = 0; $i < $groupCount; ++$i) {
68
-						$chartTypes[] = $chart->getPlotArea()->getPlotGroupByIndex($i)->getPlotType();
69
-					}
70
-					$chartTypes = array_unique($chartTypes);
71
-					if (count($chartTypes) == 1) {
72
-						$chartType = 'Multiple Plot ' . array_pop($chartTypes);
73
-						echo '    ' , $chartType , EOL;
74
-					} elseif (count($chartTypes) == 0) {
75
-						echo '    *** Type not yet implemented' , EOL;
76
-					} else {
77
-						echo '    Combination Chart' , EOL;
78
-					}
79
-				}
80
-			}
81
-		}
82
-	}
83
-
84
-
85
-	$outputFileName = basename($inputFileName);
86
-
87
-	echo date('H:i:s') , " Write Tests to Excel2007 file " , EOL;
88
-	$objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
89
-	$objWriter->setIncludeCharts(TRUE);
90
-	$objWriter->save($outputFileName);
91
-	echo date('H:i:s') , " File written to " , $outputFileName , EOL;
92
-
93
-	$objPHPExcel->disconnectWorksheets();
94
-	unset($objPHPExcel);
28
+    $inputFileNameShort = basename($inputFileName);
29
+
30
+    if (!file_exists($inputFileName)) {
31
+        echo date('H:i:s') , " File " , $inputFileNameShort , ' does not exist' , EOL;
32
+        continue;
33
+    }
34
+
35
+    echo date('H:i:s') , " Load Test from $inputFileType file " , $inputFileNameShort , EOL;
36
+
37
+    $objReader = \PHPExcel\IOFactory::createReader($inputFileType);
38
+    $objReader->setIncludeCharts(TRUE);
39
+    $objPHPExcel = $objReader->load($inputFileName);
40
+
41
+
42
+    echo date('H:i:s') , " Iterate worksheets looking at the charts" , EOL;
43
+    foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
44
+        $sheetName = $worksheet->getTitle();
45
+        echo 'Worksheet: ' , $sheetName , EOL;
46
+
47
+        $chartNames = $worksheet->getChartNames();
48
+        if(empty($chartNames)) {
49
+            echo '    There are no charts in this worksheet' , EOL;
50
+        } else {
51
+            natsort($chartNames);
52
+            foreach($chartNames as $i => $chartName) {
53
+                $chart = $worksheet->getChartByName($chartName);
54
+                if (!is_null($chart->getTitle())) {
55
+                    $caption = '"' . implode(' ',$chart->getTitle()->getCaption()) . '"';
56
+                } else {
57
+                    $caption = 'Untitled';
58
+                }
59
+                echo '    ' , $chartName , ' - ' , $caption , EOL;
60
+                echo str_repeat(' ',strlen($chartName)+3);
61
+                $groupCount = $chart->getPlotArea()->getPlotGroupCount();
62
+                if ($groupCount == 1) {
63
+                    $chartType = $chart->getPlotArea()->getPlotGroupByIndex(0)->getPlotType();
64
+                    echo '    ' , $chartType , EOL;
65
+                } else {
66
+                    $chartTypes = array();
67
+                    for($i = 0; $i < $groupCount; ++$i) {
68
+                        $chartTypes[] = $chart->getPlotArea()->getPlotGroupByIndex($i)->getPlotType();
69
+                    }
70
+                    $chartTypes = array_unique($chartTypes);
71
+                    if (count($chartTypes) == 1) {
72
+                        $chartType = 'Multiple Plot ' . array_pop($chartTypes);
73
+                        echo '    ' , $chartType , EOL;
74
+                    } elseif (count($chartTypes) == 0) {
75
+                        echo '    *** Type not yet implemented' , EOL;
76
+                    } else {
77
+                        echo '    Combination Chart' , EOL;
78
+                    }
79
+                }
80
+            }
81
+        }
82
+    }
83
+
84
+
85
+    $outputFileName = basename($inputFileName);
86
+
87
+    echo date('H:i:s') , " Write Tests to Excel2007 file " , EOL;
88
+    $objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
89
+    $objWriter->setIncludeCharts(TRUE);
90
+    $objWriter->save($outputFileName);
91
+    echo date('H:i:s') , " File written to " , $outputFileName , EOL;
92
+
93
+    $objPHPExcel->disconnectWorksheets();
94
+    unset($objPHPExcel);
95 95
 }
96 96
 
97 97
 // Echo memory peak usage
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 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
 
@@ -18,63 +18,63 @@  discard block
 block discarded – undo
18 18
 
19 19
 if ((isset($argc)) && ($argc > 1)) {
20 20
 	$inputFileNames = array();
21
-	for($i = 1; $i < $argc; ++$i) {
21
+	for ($i = 1; $i < $argc; ++$i) {
22 22
 		$inputFileNames[] = dirname(__FILE__) . '/templates/' . $argv[$i];
23 23
 	}
24 24
 } else {
25 25
 	$inputFileNames = glob($inputFileNames);
26 26
 }
27
-foreach($inputFileNames as $inputFileName) {
27
+foreach ($inputFileNames as $inputFileName) {
28 28
 	$inputFileNameShort = basename($inputFileName);
29 29
 
30 30
 	if (!file_exists($inputFileName)) {
31
-		echo date('H:i:s') , " File " , $inputFileNameShort , ' does not exist' , EOL;
31
+		echo date('H:i:s'), " File ", $inputFileNameShort, ' does not exist', EOL;
32 32
 		continue;
33 33
 	}
34 34
 
35
-	echo date('H:i:s') , " Load Test from $inputFileType file " , $inputFileNameShort , EOL;
35
+	echo date('H:i:s'), " Load Test from $inputFileType file ", $inputFileNameShort, EOL;
36 36
 
37 37
 	$objReader = \PHPExcel\IOFactory::createReader($inputFileType);
38 38
 	$objReader->setIncludeCharts(TRUE);
39 39
 	$objPHPExcel = $objReader->load($inputFileName);
40 40
 
41 41
 
42
-	echo date('H:i:s') , " Iterate worksheets looking at the charts" , EOL;
42
+	echo date('H:i:s'), " Iterate worksheets looking at the charts", EOL;
43 43
 	foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
44 44
 		$sheetName = $worksheet->getTitle();
45
-		echo 'Worksheet: ' , $sheetName , EOL;
45
+		echo 'Worksheet: ', $sheetName, EOL;
46 46
 
47 47
 		$chartNames = $worksheet->getChartNames();
48
-		if(empty($chartNames)) {
49
-			echo '    There are no charts in this worksheet' , EOL;
48
+		if (empty($chartNames)) {
49
+			echo '    There are no charts in this worksheet', EOL;
50 50
 		} else {
51 51
 			natsort($chartNames);
52
-			foreach($chartNames as $i => $chartName) {
52
+			foreach ($chartNames as $i => $chartName) {
53 53
 				$chart = $worksheet->getChartByName($chartName);
54 54
 				if (!is_null($chart->getTitle())) {
55
-					$caption = '"' . implode(' ',$chart->getTitle()->getCaption()) . '"';
55
+					$caption = '"' . implode(' ', $chart->getTitle()->getCaption()) . '"';
56 56
 				} else {
57 57
 					$caption = 'Untitled';
58 58
 				}
59
-				echo '    ' , $chartName , ' - ' , $caption , EOL;
60
-				echo str_repeat(' ',strlen($chartName)+3);
59
+				echo '    ', $chartName, ' - ', $caption, EOL;
60
+				echo str_repeat(' ', strlen($chartName) + 3);
61 61
 				$groupCount = $chart->getPlotArea()->getPlotGroupCount();
62 62
 				if ($groupCount == 1) {
63 63
 					$chartType = $chart->getPlotArea()->getPlotGroupByIndex(0)->getPlotType();
64
-					echo '    ' , $chartType , EOL;
64
+					echo '    ', $chartType, EOL;
65 65
 				} else {
66 66
 					$chartTypes = array();
67
-					for($i = 0; $i < $groupCount; ++$i) {
67
+					for ($i = 0; $i < $groupCount; ++$i) {
68 68
 						$chartTypes[] = $chart->getPlotArea()->getPlotGroupByIndex($i)->getPlotType();
69 69
 					}
70 70
 					$chartTypes = array_unique($chartTypes);
71 71
 					if (count($chartTypes) == 1) {
72 72
 						$chartType = 'Multiple Plot ' . array_pop($chartTypes);
73
-						echo '    ' , $chartType , EOL;
73
+						echo '    ', $chartType, EOL;
74 74
 					} elseif (count($chartTypes) == 0) {
75
-						echo '    *** Type not yet implemented' , EOL;
75
+						echo '    *** Type not yet implemented', EOL;
76 76
 					} else {
77
-						echo '    Combination Chart' , EOL;
77
+						echo '    Combination Chart', EOL;
78 78
 					}
79 79
 				}
80 80
 			}
@@ -84,19 +84,19 @@  discard block
 block discarded – undo
84 84
 
85 85
 	$outputFileName = basename($inputFileName);
86 86
 
87
-	echo date('H:i:s') , " Write Tests to Excel2007 file " , EOL;
87
+	echo date('H:i:s'), " Write Tests to Excel2007 file ", EOL;
88 88
 	$objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
89 89
 	$objWriter->setIncludeCharts(TRUE);
90 90
 	$objWriter->save($outputFileName);
91
-	echo date('H:i:s') , " File written to " , $outputFileName , EOL;
91
+	echo date('H:i:s'), " File written to ", $outputFileName, EOL;
92 92
 
93 93
 	$objPHPExcel->disconnectWorksheets();
94 94
 	unset($objPHPExcel);
95 95
 }
96 96
 
97 97
 // Echo memory peak usage
98
-echo date('H:i:s') , ' Peak memory usage: ' , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
98
+echo date('H:i:s'), ' Peak memory usage: ', (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
99 99
 
100 100
 // Echo done
101
-echo date('H:i:s') , " Done writing files" , EOL;
102
-echo 'Files have been created in ' , getcwd() , EOL;
101
+echo date('H:i:s'), " Done writing files", EOL;
102
+echo 'Files have been created in ', getcwd(), EOL;
Please login to merge, or discard this patch.
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/01simplePCLZip.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,12 +44,12 @@
 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
 
55 55
 // Add some data
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 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")
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
 
55 55
 // Add some data
56
-echo date('H:i:s') , " Add some data" , EOL;
56
+echo date('H:i:s'), " Add some data", EOL;
57 57
 $objPHPExcel->setActiveSheetIndex(0)
58 58
             ->setCellValue('A1', 'Hello')
59 59
             ->setCellValue('B2', 'world!')
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
             ->setCellValue('A5', 'éàèùâêîôûëïüÿäöüç');
67 67
 
68 68
 
69
-$objPHPExcel->getActiveSheet()->setCellValue('A8',"Hello\nWorld");
69
+$objPHPExcel->getActiveSheet()->setCellValue('A8', "Hello\nWorld");
70 70
 $objPHPExcel->getActiveSheet()->getRowDimension(8)->setRowHeight(-1);
71 71
 $objPHPExcel->getActiveSheet()->getStyle('A8')->getAlignment()->setWrapText(true);
72 72
 
73 73
 
74 74
 // Rename worksheet
75
-echo date('H:i:s') , " Rename worksheet" , EOL;
75
+echo date('H:i:s'), " Rename worksheet", EOL;
76 76
 $objPHPExcel->getActiveSheet()->setTitle('Simple');
77 77
 
78 78
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
 
83 83
 // Save Excel 2007 file
84
-echo date('H:i:s') , " Write to Excel2007 format" , EOL;
84
+echo date('H:i:s'), " Write to Excel2007 format", EOL;
85 85
 $callStartTime = microtime(true);
86 86
 
87 87
 // Use PCLZip rather than ZipArchive to create the Excel2007 OfficeOpenXML file
@@ -92,15 +92,15 @@  discard block
 block discarded – undo
92 92
 $callEndTime = microtime(true);
93 93
 $callTime = $callEndTime - $callStartTime;
94 94
 
95
-echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
96
-echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
95
+echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', pathinfo(__FILE__, PATHINFO_BASENAME)), EOL;
96
+echo 'Call time to write Workbook was ', sprintf('%.4f', $callTime), " seconds", EOL;
97 97
 // Echo memory usage
98
-echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
98
+echo date('H:i:s'), ' Current memory usage: ', (memory_get_usage(true) / 1024 / 1024), " MB", EOL;
99 99
 
100 100
 
101 101
 // Echo memory peak usage
102
-echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
102
+echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL;
103 103
 
104 104
 // Echo done
105
-echo date('H:i:s') , " Done writing files" , EOL;
106
-echo 'Files have been created in ' , getcwd() , EOL;
105
+echo date('H:i:s'), " Done writing files", EOL;
106
+echo 'Files have been created in ', getcwd(), EOL;
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
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 date_default_timezone_set('Europe/London');
33 33
 
34 34
 if (PHP_SAPI == 'cli')
35
-	die('This example should only be run from a Web Browser');
35
+    die('This example should only be run from a Web Browser');
36 36
 
37 37
 /** Include PHPExcel */
38 38
 require_once dirname(__FILE__) . '/../src/Bootstrap.php';
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
 
55 55
 // Set document properties
56 56
 $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
57
-							 ->setLastModifiedBy("Maarten Balliauw")
58
-							 ->setTitle("PDF Test Document")
59
-							 ->setSubject("PDF Test Document")
60
-							 ->setDescription("Test document for PDF, generated using PHP classes.")
61
-							 ->setKeywords("pdf php")
62
-							 ->setCategory("Test result file");
57
+                                ->setLastModifiedBy("Maarten Balliauw")
58
+                                ->setTitle("PDF Test Document")
59
+                                ->setSubject("PDF Test Document")
60
+                                ->setDescription("Test document for PDF, generated using PHP classes.")
61
+                                ->setKeywords("pdf php")
62
+                                ->setCategory("Test result file");
63 63
 
64 64
 
65 65
 // Add some data
@@ -83,14 +83,14 @@  discard block
 block discarded – undo
83 83
 
84 84
 
85 85
 if (!PHPExcel\Settings::setPdfRenderer(
86
-		$rendererName,
87
-		$rendererLibraryPath
88
-	)) {
89
-	die(
90
-		'NOTICE: Please set the $rendererName and $rendererLibraryPath values' .
91
-		'<br />' .
92
-		'at the top of this script as appropriate for your directory structure'
93
-	);
86
+        $rendererName,
87
+        $rendererLibraryPath
88
+    )) {
89
+    die(
90
+        'NOTICE: Please set the $rendererName and $rendererLibraryPath values' .
91
+        '<br />' .
92
+        'at the top of this script as appropriate for your directory structure'
93
+    );
94 94
 }
95 95
 
96 96
 
Please login to merge, or discard this 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.
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.