@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -require_once __DIR__ . '/../vendor/autoload.php'; |
|
2 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
3 | 3 | |
4 | 4 | $start = microtime(true); |
5 | 5 | $header = [ |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | } |
228 | 228 | |
229 | 229 | /** |
230 | - * @param $cellFormat |
|
230 | + * @param string $cellFormat |
|
231 | 231 | * |
232 | 232 | * @return string |
233 | 233 | */ |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | /** |
272 | 272 | * @todo check escaping |
273 | 273 | * |
274 | - * @param $cellFormat |
|
274 | + * @param string $cellFormat |
|
275 | 275 | * |
276 | 276 | * @return string |
277 | 277 | */ |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | * |
311 | 311 | * @param $cellFormat |
312 | 312 | * |
313 | - * @return int|mixed |
|
313 | + * @return integer |
|
314 | 314 | */ |
315 | 315 | private function addCellFormat($cellFormat) |
316 | 316 | { |
@@ -517,8 +517,8 @@ discard block |
||
517 | 517 | |
518 | 518 | /** |
519 | 519 | * @param Writer $file |
520 | - * @param $rowNumber |
|
521 | - * @param $columnNumber |
|
520 | + * @param integer $rowNumber |
|
521 | + * @param integer $columnNumber |
|
522 | 522 | * @param $value |
523 | 523 | * @param $cellIndex |
524 | 524 | */ |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | } |
648 | 648 | |
649 | 649 | /** |
650 | - * @param $v |
|
650 | + * @param string $v |
|
651 | 651 | * |
652 | 652 | * @return int|mixed |
653 | 653 | */ |
@@ -792,7 +792,7 @@ discard block |
||
792 | 792 | } |
793 | 793 | |
794 | 794 | /** |
795 | - * @param $string |
|
795 | + * @param string $string |
|
796 | 796 | */ |
797 | 797 | public static function log($string) |
798 | 798 | { |
@@ -807,7 +807,7 @@ discard block |
||
807 | 807 | * |
808 | 808 | * @param string $filename |
809 | 809 | * |
810 | - * @return mixed |
|
810 | + * @return string |
|
811 | 811 | */ |
812 | 812 | public static function checkFilename($filename) |
813 | 813 | { |
@@ -822,7 +822,7 @@ discard block |
||
822 | 822 | /** |
823 | 823 | * @param $val |
824 | 824 | * |
825 | - * @return mixed |
|
825 | + * @return string |
|
826 | 826 | */ |
827 | 827 | public static function xmlspecialchars($val) |
828 | 828 | { |
@@ -24,19 +24,19 @@ discard block |
||
24 | 24 | private $urlSchemaFormat = 'http://schemas.openxmlformats.org/officeDocument/2006'; |
25 | 25 | |
26 | 26 | /** @var string */ |
27 | - protected $author ='Unknown Author'; |
|
27 | + protected $author = 'Unknown Author'; |
|
28 | 28 | /** @var array */ |
29 | 29 | protected $sheets = []; |
30 | 30 | /** @var array */ |
31 | - protected $sharedStrings = [];//unique set |
|
31 | + protected $sharedStrings = []; //unique set |
|
32 | 32 | /** @var int */ |
33 | - protected $sharedStringCount = 0;//count of non-unique references to the unique set |
|
33 | + protected $sharedStringCount = 0; //count of non-unique references to the unique set |
|
34 | 34 | /** @var array */ |
35 | 35 | protected $tempFiles = []; |
36 | 36 | /** @var array */ |
37 | - protected $cellFormats = [];//contains excel format like YYYY-MM-DD HH:MM:SS |
|
37 | + protected $cellFormats = []; //contains excel format like YYYY-MM-DD HH:MM:SS |
|
38 | 38 | /** @var array */ |
39 | - protected $cellTypes = [];//contains friendly format like datetime |
|
39 | + protected $cellTypes = []; //contains friendly format like datetime |
|
40 | 40 | /** @var string */ |
41 | 41 | protected $currentSheet = ''; |
42 | 42 | /** @var null */ |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | public function writeToFile($filename) |
125 | 125 | { |
126 | 126 | foreach ($this->sheets as $sheetName => $sheet) { |
127 | - $this->finalizeSheet($sheetName);//making sure all footers have been written |
|
127 | + $this->finalizeSheet($sheetName); //making sure all footers have been written |
|
128 | 128 | } |
129 | 129 | if (file_exists($filename)) { |
130 | 130 | if (is_writable($filename)) { |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | return; |
188 | 188 | } |
189 | 189 | $sheetFilename = $this->tempFilename(); |
190 | - $sheetXmlName = 'sheet' . (count($this->sheets) + 1).".xml"; |
|
190 | + $sheetXmlName = 'sheet'.(count($this->sheets) + 1).".xml"; |
|
191 | 191 | $sheetObj = new Sheet(); |
192 | 192 | $sheetObj |
193 | 193 | ->setFilename($sheetFilename) |
@@ -198,8 +198,8 @@ discard block |
||
198 | 198 | $this->sheets[$sheetName] = $sheetObj; |
199 | 199 | /** @var Sheet $sheet */ |
200 | 200 | $sheet = &$this->sheets[$sheetName]; |
201 | - $selectedTab = count($this->sheets) == 1 ? 'true' : 'false';//only first sheet is selected |
|
202 | - $maxCell = ExcelWriter::xlsCell(self::EXCEL_MAX_ROW, self::EXCEL_MAX_COL);//XFE1048577 |
|
201 | + $selectedTab = count($this->sheets) == 1 ? 'true' : 'false'; //only first sheet is selected |
|
202 | + $maxCell = ExcelWriter::xlsCell(self::EXCEL_MAX_ROW, self::EXCEL_MAX_COL); //XFE1048577 |
|
203 | 203 | $sheet->getWriter()->write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'."\n"); |
204 | 204 | $sheet->getWriter()->write( |
205 | 205 | '<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | $sheet = &$this->sheets[$sheetName]; |
407 | 407 | $columns = $sheet->getColumns(); |
408 | 408 | if (empty($columns)) { |
409 | - $sheet->setColumns(array_fill($from = 0, $until = count($row), '0'));//'0'=>'string' |
|
409 | + $sheet->setColumns(array_fill($from = 0, $until = count($row), '0')); //'0'=>'string' |
|
410 | 410 | } |
411 | 411 | $sheet->getWriter()->write( |
412 | 412 | '<row collapsed="false" customFormat="false" customHeight="false" |
@@ -653,7 +653,7 @@ discard block |
||
653 | 653 | $stringValue = count($this->sharedStrings); |
654 | 654 | $this->sharedStrings[$v] = $stringValue; |
655 | 655 | } |
656 | - $this->sharedStringCount++;//non-unique count |
|
656 | + $this->sharedStringCount++; //non-unique count |
|
657 | 657 | |
658 | 658 | return $stringValue; |
659 | 659 | } |
@@ -856,8 +856,8 @@ discard block |
||
856 | 856 | $norm = 300; |
857 | 857 | $range = $year - $epoch; |
858 | 858 | # Set month days and check for leap year. |
859 | - $leap = (($year % 400 == 0) || (($year % 4 == 0) && ($year % 100)) ) ? 1 : 0; |
|
860 | - $mdays = array( 31, ($leap ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ); |
|
859 | + $leap = (($year % 400 == 0) || (($year % 4 == 0) && ($year % 100))) ? 1 : 0; |
|
860 | + $mdays = array(31, ($leap ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); |
|
861 | 861 | # Some boundary checks |
862 | 862 | if ($year < $epoch || $year > 9999) { |
863 | 863 | return 0; |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -require_once __DIR__ . '/../vendor/autoload.php'; |
|
2 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
3 | 3 | |
4 | 4 | $start = microtime(true); |
5 | 5 | $header = [ |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -require_once __DIR__ . '/../vendor/autoload.php'; |
|
2 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
3 | 3 | |
4 | 4 | $start = microtime(true); |
5 | 5 | $header = [ |