@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | // Check if file exists |
61 | 61 | if (!file_exists($pFilename)) { |
62 | - throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.'); |
|
62 | + throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.'); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | $zipClass = \PhpOffice\PhpSpreadsheet\Settings::getZipClass(); |
@@ -115,21 +115,21 @@ discard block |
||
115 | 115 | { |
116 | 116 | // Check if file exists |
117 | 117 | if (!file_exists($pFilename)) { |
118 | - throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.'); |
|
118 | + throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.'); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | $zipClass = \PhpOffice\PhpSpreadsheet\Settings::getZipClass(); |
122 | 122 | |
123 | 123 | $zip = new $zipClass(); |
124 | 124 | if (!$zip->open($pFilename)) { |
125 | - throw new Exception('Could not open '.$pFilename.' for reading! Error opening file.'); |
|
125 | + throw new Exception('Could not open ' . $pFilename . ' for reading! Error opening file.'); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | $worksheetNames = []; |
129 | 129 | |
130 | 130 | $xml = new XMLReader(); |
131 | 131 | $res = $xml->xml( |
132 | - $this->securityScanFile('zip://'.realpath($pFilename).'#content.xml'), |
|
132 | + $this->securityScanFile('zip://' . realpath($pFilename) . '#content.xml'), |
|
133 | 133 | null, |
134 | 134 | \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() |
135 | 135 | ); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | { |
173 | 173 | // Check if file exists |
174 | 174 | if (!file_exists($pFilename)) { |
175 | - throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.'); |
|
175 | + throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.'); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | $worksheetInfo = []; |
@@ -181,12 +181,12 @@ discard block |
||
181 | 181 | |
182 | 182 | $zip = new $zipClass(); |
183 | 183 | if (!$zip->open($pFilename)) { |
184 | - throw new Exception('Could not open '.$pFilename.' for reading! Error opening file.'); |
|
184 | + throw new Exception('Could not open ' . $pFilename . ' for reading! Error opening file.'); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | $xml = new XMLReader(); |
188 | 188 | $res = $xml->xml( |
189 | - $this->securityScanFile('zip://'.realpath($pFilename).'#content.xml'), |
|
189 | + $this->securityScanFile('zip://' . realpath($pFilename) . '#content.xml'), |
|
190 | 190 | null, |
191 | 191 | \PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions() |
192 | 192 | ); |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | { |
303 | 303 | // Check if file exists |
304 | 304 | if (!file_exists($pFilename)) { |
305 | - throw new Exception('Could not open '.$pFilename.' for reading! File does not exist.'); |
|
305 | + throw new Exception('Could not open ' . $pFilename . ' for reading! File does not exist.'); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | $timezoneObj = new DateTimeZone('Europe/London'); |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | |
313 | 313 | $zip = new $zipClass(); |
314 | 314 | if (!$zip->open($pFilename)) { |
315 | - throw new Exception('Could not open '.$pFilename.' for reading! Error opening file.'); |
|
315 | + throw new Exception('Could not open ' . $pFilename . ' for reading! Error opening file.'); |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | $xml = simplexml_load_string( |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | } |
477 | 477 | } |
478 | 478 | $text = implode("\n", $textArray); |
479 | - $spreadsheet->getActiveSheet()->getComment($columnID.$rowID)->setText($this->parseRichText($text)); |
|
479 | + $spreadsheet->getActiveSheet()->getComment($columnID . $rowID)->setText($this->parseRichText($text)); |
|
480 | 480 | // ->setAuthor( $author ) |
481 | 481 | } |
482 | 482 | |
@@ -552,14 +552,14 @@ discard block |
||
552 | 552 | list($year, $month, $day, $hour, $minute, $second) = explode(' ', $dateObj->format('Y m d H i s')); |
553 | 553 | $dataValue = \PhpOffice\PhpSpreadsheet\Shared\Date::formattedPHPToExcel($year, $month, $day, $hour, $minute, $second); |
554 | 554 | if ($dataValue != floor($dataValue)) { |
555 | - $formatting = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15.' '.\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4; |
|
555 | + $formatting = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15 . ' ' . \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4; |
|
556 | 556 | } else { |
557 | 557 | $formatting = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15; |
558 | 558 | } |
559 | 559 | break; |
560 | 560 | case 'time': |
561 | 561 | $type = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC; |
562 | - $dataValue = \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(strtotime('01-01-1970 '.implode(':', sscanf($cellDataOfficeAttributes['time-value'], 'PT%dH%dM%dS')))); |
|
562 | + $dataValue = \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel(strtotime('01-01-1970 ' . implode(':', sscanf($cellDataOfficeAttributes['time-value'], 'PT%dH%dM%dS')))); |
|
563 | 563 | $formatting = \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4; |
564 | 564 | break; |
565 | 565 | } |
@@ -597,17 +597,17 @@ discard block |
||
597 | 597 | if ($type !== \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NULL) { |
598 | 598 | for ($rowAdjust = 0; $rowAdjust < $rowRepeats; ++$rowAdjust) { |
599 | 599 | $rID = $rowID + $rowAdjust; |
600 | - $spreadsheet->getActiveSheet()->getCell($columnID.$rID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $dataValue), $type); |
|
600 | + $spreadsheet->getActiveSheet()->getCell($columnID . $rID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $dataValue), $type); |
|
601 | 601 | if ($hasCalculatedValue) { |
602 | - $spreadsheet->getActiveSheet()->getCell($columnID.$rID)->setCalculatedValue($dataValue); |
|
602 | + $spreadsheet->getActiveSheet()->getCell($columnID . $rID)->setCalculatedValue($dataValue); |
|
603 | 603 | } |
604 | 604 | if ($formatting !== null) { |
605 | - $spreadsheet->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode($formatting); |
|
605 | + $spreadsheet->getActiveSheet()->getStyle($columnID . $rID)->getNumberFormat()->setFormatCode($formatting); |
|
606 | 606 | } else { |
607 | - $spreadsheet->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL); |
|
607 | + $spreadsheet->getActiveSheet()->getStyle($columnID . $rID)->getNumberFormat()->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL); |
|
608 | 608 | } |
609 | 609 | if ($hyperlink !== null) { |
610 | - $spreadsheet->getActiveSheet()->getCell($columnID.$rID)->getHyperlink()->setUrl($hyperlink); |
|
610 | + $spreadsheet->getActiveSheet()->getCell($columnID . $rID)->getHyperlink()->setUrl($hyperlink); |
|
611 | 611 | } |
612 | 612 | } |
613 | 613 | } |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | if (isset($cellDataTableAttributes['number-rows-spanned'])) { |
626 | 626 | $rowTo = $rowTo + $cellDataTableAttributes['number-rows-spanned'] - 1; |
627 | 627 | } |
628 | - $cellRange = $columnID.$rowID.':'.$columnTo.$rowTo; |
|
628 | + $cellRange = $columnID . $rowID . ':' . $columnTo . $rowTo; |
|
629 | 629 | $spreadsheet->getActiveSheet()->mergeCells($cellRange); |
630 | 630 | } |
631 | 631 | } |
@@ -26,6 +26,6 @@ |
||
26 | 26 | * |
27 | 27 | * @version ##VERSION##, ##DATE## |
28 | 28 | */ |
29 | -include_once __DIR__.'/Autoloader.php'; |
|
29 | +include_once __DIR__ . '/Autoloader.php'; |
|
30 | 30 | |
31 | 31 | \PhpOffice\PhpSpreadsheet\Autoloader::register(); |
@@ -56,9 +56,9 @@ |
||
56 | 56 | return false; |
57 | 57 | } |
58 | 58 | |
59 | - $classFilePath = __DIR__.DIRECTORY_SEPARATOR. |
|
60 | - 'PhpSpreadsheet'.DIRECTORY_SEPARATOR. |
|
61 | - str_replace([$prefix, '\\'], ['', '/'], $className). |
|
59 | + $classFilePath = __DIR__ . DIRECTORY_SEPARATOR . |
|
60 | + 'PhpSpreadsheet' . DIRECTORY_SEPARATOR . |
|
61 | + str_replace([$prefix, '\\'], ['', '/'], $className) . |
|
62 | 62 | '.php'; |
63 | 63 | |
64 | 64 | if ((file_exists($classFilePath) === false) || (is_readable($classFilePath) === false)) { |