@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | parent::__construct($spreadsheet); |
39 | 39 | |
40 | 40 | /* Require tcPDF library */ |
41 | - $pdfRendererClassFile = \PhpOffice\PhpSpreadsheet\Settings::getPdfRendererPath().'/tcpdf.php'; |
|
41 | + $pdfRendererClassFile = \PhpOffice\PhpSpreadsheet\Settings::getPdfRendererPath() . '/tcpdf.php'; |
|
42 | 42 | if (file_exists($pdfRendererClassFile)) { |
43 | 43 | $k_path_url = \PhpOffice\PhpSpreadsheet\Settings::getPdfRendererPath(); |
44 | 44 | require_once $pdfRendererClassFile; |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | // Set the appropriate font |
105 | 105 | $pdf->SetFont($this->getFont()); |
106 | 106 | $pdf->writeHTML( |
107 | - $this->generateHTMLHeader(false). |
|
108 | - $this->generateSheetData(). |
|
107 | + $this->generateHTMLHeader(false) . |
|
108 | + $this->generateSheetData() . |
|
109 | 109 | $this->generateHTMLFooter() |
110 | 110 | ); |
111 | 111 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | parent::__construct($spreadsheet); |
39 | 39 | |
40 | 40 | /* Require mPDF library */ |
41 | - $pdfRendererClassFile = \PhpOffice\PhpSpreadsheet\Settings::getPdfRendererPath().'/mpdf.php'; |
|
41 | + $pdfRendererClassFile = \PhpOffice\PhpSpreadsheet\Settings::getPdfRendererPath() . '/mpdf.php'; |
|
42 | 42 | if (file_exists($pdfRendererClassFile)) { |
43 | 43 | require_once $pdfRendererClassFile; |
44 | 44 | } else { |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | $pdf->SetCreator($this->spreadsheet->getProperties()->getCreator()); |
107 | 107 | |
108 | 108 | $pdf->WriteHTML( |
109 | - $this->generateHTMLHeader(false). |
|
110 | - $this->generateSheetData(). |
|
109 | + $this->generateHTMLHeader(false) . |
|
110 | + $this->generateSheetData() . |
|
111 | 111 | $this->generateHTMLFooter() |
112 | 112 | ); |
113 | 113 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | parent::__construct($spreadsheet); |
39 | 39 | |
40 | 40 | /* Require DomPDF library */ |
41 | - $pdfRendererClassFile = \PhpOffice\PhpSpreadsheet\Settings::getPdfRendererPath().'/dompdf_config.inc.php'; |
|
41 | + $pdfRendererClassFile = \PhpOffice\PhpSpreadsheet\Settings::getPdfRendererPath() . '/dompdf_config.inc.php'; |
|
42 | 42 | if (file_exists($pdfRendererClassFile)) { |
43 | 43 | require_once $pdfRendererClassFile; |
44 | 44 | } else { |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | $pdf->set_paper(strtolower($paperSize), $orientation); |
96 | 96 | |
97 | 97 | $pdf->load_html( |
98 | - $this->generateHTMLHeader(false). |
|
99 | - $this->generateSheetData(). |
|
98 | + $this->generateHTMLHeader(false) . |
|
99 | + $this->generateSheetData() . |
|
100 | 100 | $this->generateHTMLFooter() |
101 | 101 | ); |
102 | 102 | $pdf->render(); |
@@ -357,46 +357,46 @@ discard block |
||
357 | 357 | |
358 | 358 | // Construct HTML |
359 | 359 | $properties = $this->spreadsheet->getProperties(); |
360 | - $html = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'.PHP_EOL; |
|
361 | - $html .= '<!-- Generated by Spreadsheet - https://github.com/PHPOffice/Spreadsheet -->'.PHP_EOL; |
|
362 | - $html .= '<html>'.PHP_EOL; |
|
363 | - $html .= ' <head>'.PHP_EOL; |
|
364 | - $html .= ' <meta http-equiv="Content-Type" content="text/html; charset=utf-8">'.PHP_EOL; |
|
360 | + $html = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">' . PHP_EOL; |
|
361 | + $html .= '<!-- Generated by Spreadsheet - https://github.com/PHPOffice/Spreadsheet -->' . PHP_EOL; |
|
362 | + $html .= '<html>' . PHP_EOL; |
|
363 | + $html .= ' <head>' . PHP_EOL; |
|
364 | + $html .= ' <meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . PHP_EOL; |
|
365 | 365 | if ($properties->getTitle() > '') { |
366 | - $html .= ' <title>'.htmlspecialchars($properties->getTitle()).'</title>'.PHP_EOL; |
|
366 | + $html .= ' <title>' . htmlspecialchars($properties->getTitle()) . '</title>' . PHP_EOL; |
|
367 | 367 | } |
368 | 368 | if ($properties->getCreator() > '') { |
369 | - $html .= ' <meta name="author" content="'.htmlspecialchars($properties->getCreator()).'" />'.PHP_EOL; |
|
369 | + $html .= ' <meta name="author" content="' . htmlspecialchars($properties->getCreator()) . '" />' . PHP_EOL; |
|
370 | 370 | } |
371 | 371 | if ($properties->getTitle() > '') { |
372 | - $html .= ' <meta name="title" content="'.htmlspecialchars($properties->getTitle()).'" />'.PHP_EOL; |
|
372 | + $html .= ' <meta name="title" content="' . htmlspecialchars($properties->getTitle()) . '" />' . PHP_EOL; |
|
373 | 373 | } |
374 | 374 | if ($properties->getDescription() > '') { |
375 | - $html .= ' <meta name="description" content="'.htmlspecialchars($properties->getDescription()).'" />'.PHP_EOL; |
|
375 | + $html .= ' <meta name="description" content="' . htmlspecialchars($properties->getDescription()) . '" />' . PHP_EOL; |
|
376 | 376 | } |
377 | 377 | if ($properties->getSubject() > '') { |
378 | - $html .= ' <meta name="subject" content="'.htmlspecialchars($properties->getSubject()).'" />'.PHP_EOL; |
|
378 | + $html .= ' <meta name="subject" content="' . htmlspecialchars($properties->getSubject()) . '" />' . PHP_EOL; |
|
379 | 379 | } |
380 | 380 | if ($properties->getKeywords() > '') { |
381 | - $html .= ' <meta name="keywords" content="'.htmlspecialchars($properties->getKeywords()).'" />'.PHP_EOL; |
|
381 | + $html .= ' <meta name="keywords" content="' . htmlspecialchars($properties->getKeywords()) . '" />' . PHP_EOL; |
|
382 | 382 | } |
383 | 383 | if ($properties->getCategory() > '') { |
384 | - $html .= ' <meta name="category" content="'.htmlspecialchars($properties->getCategory()).'" />'.PHP_EOL; |
|
384 | + $html .= ' <meta name="category" content="' . htmlspecialchars($properties->getCategory()) . '" />' . PHP_EOL; |
|
385 | 385 | } |
386 | 386 | if ($properties->getCompany() > '') { |
387 | - $html .= ' <meta name="company" content="'.htmlspecialchars($properties->getCompany()).'" />'.PHP_EOL; |
|
387 | + $html .= ' <meta name="company" content="' . htmlspecialchars($properties->getCompany()) . '" />' . PHP_EOL; |
|
388 | 388 | } |
389 | 389 | if ($properties->getManager() > '') { |
390 | - $html .= ' <meta name="manager" content="'.htmlspecialchars($properties->getManager()).'" />'.PHP_EOL; |
|
390 | + $html .= ' <meta name="manager" content="' . htmlspecialchars($properties->getManager()) . '" />' . PHP_EOL; |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | if ($pIncludeStyles) { |
394 | 394 | $html .= $this->generateStyles(true); |
395 | 395 | } |
396 | 396 | |
397 | - $html .= ' </head>'.PHP_EOL; |
|
398 | - $html .= ''.PHP_EOL; |
|
399 | - $html .= ' <body>'.PHP_EOL; |
|
397 | + $html .= ' </head>' . PHP_EOL; |
|
398 | + $html .= '' . PHP_EOL; |
|
399 | + $html .= ' <body>' . PHP_EOL; |
|
400 | 400 | |
401 | 401 | return $html; |
402 | 402 | } |
@@ -467,13 +467,13 @@ discard block |
||
467 | 467 | while ($row++ < $rowMax) { |
468 | 468 | // <thead> ? |
469 | 469 | if ($row == $theadStart) { |
470 | - $html .= ' <thead>'.PHP_EOL; |
|
470 | + $html .= ' <thead>' . PHP_EOL; |
|
471 | 471 | $cellType = 'th'; |
472 | 472 | } |
473 | 473 | |
474 | 474 | // <tbody> ? |
475 | 475 | if ($row == $tbodyStart) { |
476 | - $html .= ' <tbody>'.PHP_EOL; |
|
476 | + $html .= ' <tbody>' . PHP_EOL; |
|
477 | 477 | $cellType = 'td'; |
478 | 478 | } |
479 | 479 | |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | while ($column++ < $dimension[1][0]) { |
487 | 487 | // Cell exists? |
488 | 488 | if ($sheet->cellExistsByColumnAndRow($column, $row)) { |
489 | - $rowData[$column] = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column).$row; |
|
489 | + $rowData[$column] = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($column) . $row; |
|
490 | 490 | } else { |
491 | 491 | $rowData[$column] = ''; |
492 | 492 | } |
@@ -496,13 +496,13 @@ discard block |
||
496 | 496 | |
497 | 497 | // </thead> ? |
498 | 498 | if ($row == $theadEnd) { |
499 | - $html .= ' </thead>'.PHP_EOL; |
|
499 | + $html .= ' </thead>' . PHP_EOL; |
|
500 | 500 | } |
501 | 501 | } |
502 | 502 | $html .= $this->extendRowsForChartsAndImages($sheet, $row); |
503 | 503 | |
504 | 504 | // Close table body. |
505 | - $html .= ' </tbody>'.PHP_EOL; |
|
505 | + $html .= ' </tbody>' . PHP_EOL; |
|
506 | 506 | |
507 | 507 | // Write table footer |
508 | 508 | $html .= $this->generateTableFooter(); |
@@ -551,14 +551,14 @@ discard block |
||
551 | 551 | // Loop all sheets |
552 | 552 | $sheetId = 0; |
553 | 553 | |
554 | - $html .= '<ul class="navigation">'.PHP_EOL; |
|
554 | + $html .= '<ul class="navigation">' . PHP_EOL; |
|
555 | 555 | |
556 | 556 | foreach ($sheets as $sheet) { |
557 | - $html .= ' <li class="sheet'.$sheetId.'"><a href="#sheet'.$sheetId.'">'.$sheet->getTitle().'</a></li>'.PHP_EOL; |
|
557 | + $html .= ' <li class="sheet' . $sheetId . '"><a href="#sheet' . $sheetId . '">' . $sheet->getTitle() . '</a></li>' . PHP_EOL; |
|
558 | 558 | ++$sheetId; |
559 | 559 | } |
560 | 560 | |
561 | - $html .= '</ul>'.PHP_EOL; |
|
561 | + $html .= '</ul>' . PHP_EOL; |
|
562 | 562 | } |
563 | 563 | |
564 | 564 | return $html; |
@@ -602,9 +602,9 @@ discard block |
||
602 | 602 | $html .= '<tr>'; |
603 | 603 | for ($col = 'A'; $col != $colMax; ++$col) { |
604 | 604 | $html .= '<td>'; |
605 | - $html .= $this->writeImageInCell($pSheet, $col.$row); |
|
605 | + $html .= $this->writeImageInCell($pSheet, $col . $row); |
|
606 | 606 | if ($this->includeCharts) { |
607 | - $html .= $this->writeChartInCell($pSheet, $col.$row); |
|
607 | + $html .= $this->writeChartInCell($pSheet, $col . $row); |
|
608 | 608 | } |
609 | 609 | $html .= '</td>'; |
610 | 610 | } |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | } |
643 | 643 | |
644 | 644 | // Prepend images root |
645 | - $filename = $this->getImagesRoot().$filename; |
|
645 | + $filename = $this->getImagesRoot() . $filename; |
|
646 | 646 | |
647 | 647 | // Strip off eventual '.' |
648 | 648 | if (substr($filename, 0, 1) == '.' && substr($filename, 0, 2) != './') { |
@@ -663,17 +663,17 @@ discard block |
||
663 | 663 | // base64 encode the binary data, then break it |
664 | 664 | // into chunks according to RFC 2045 semantics |
665 | 665 | $base64 = chunk_split(base64_encode($picture)); |
666 | - $imageData = 'data:'.$imageDetails['mime'].';base64,'.$base64; |
|
666 | + $imageData = 'data:' . $imageDetails['mime'] . ';base64,' . $base64; |
|
667 | 667 | } else { |
668 | 668 | $imageData = $filename; |
669 | 669 | } |
670 | 670 | } |
671 | 671 | |
672 | 672 | $html .= '<div style="position: relative;">'; |
673 | - $html .= '<img style="position: absolute; z-index: 1; left: '. |
|
674 | - $drawing->getOffsetX().'px; top: '.$drawing->getOffsetY().'px; width: '. |
|
675 | - $drawing->getWidth().'px; height: '.$drawing->getHeight().'px;" src="'. |
|
676 | - $imageData.'" border="0" />'; |
|
673 | + $html .= '<img style="position: absolute; z-index: 1; left: ' . |
|
674 | + $drawing->getOffsetX() . 'px; top: ' . $drawing->getOffsetY() . 'px; width: ' . |
|
675 | + $drawing->getWidth() . 'px; height: ' . $drawing->getHeight() . 'px;" src="' . |
|
676 | + $imageData . '" border="0" />'; |
|
677 | 677 | $html .= '</div>'; |
678 | 678 | } |
679 | 679 | } elseif ($drawing instanceof \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing) { |
@@ -685,13 +685,13 @@ discard block |
||
685 | 685 | $contents = ob_get_contents(); // Instead, output above is saved to $contents |
686 | 686 | ob_end_clean(); // End the output buffer. |
687 | 687 | |
688 | - $dataUri = 'data:image/jpeg;base64,'.base64_encode($contents); |
|
688 | + $dataUri = 'data:image/jpeg;base64,' . base64_encode($contents); |
|
689 | 689 | |
690 | 690 | // Because of the nature of tables, width is more important than height. |
691 | 691 | // max-width: 100% ensures that image doesnt overflow containing cell |
692 | 692 | // width: X sets width of supplied image. |
693 | 693 | // As a result, images bigger than cell will be contained and images smaller will not get stretched |
694 | - $html .= '<img src="'.$dataUri.'" style="max-width:100%;width:'.$drawing->getWidth().'px;" />'; |
|
694 | + $html .= '<img src="' . $dataUri . '" style="max-width:100%;width:' . $drawing->getWidth() . 'px;" />'; |
|
695 | 695 | } |
696 | 696 | } |
697 | 697 | |
@@ -718,7 +718,7 @@ discard block |
||
718 | 718 | if ($chart instanceof \PhpOffice\PhpSpreadsheet\Chart) { |
719 | 719 | $chartCoordinates = $chart->getTopLeftPosition(); |
720 | 720 | if ($chartCoordinates['cell'] == $coordinates) { |
721 | - $chartFileName = \PhpOffice\PhpSpreadsheet\Shared\File::sysGetTempDir().'/'.uniqid().'.png'; |
|
721 | + $chartFileName = \PhpOffice\PhpSpreadsheet\Shared\File::sysGetTempDir() . '/' . uniqid() . '.png'; |
|
722 | 722 | if (!$chart->render($chartFileName)) { |
723 | 723 | return; |
724 | 724 | } |
@@ -731,10 +731,10 @@ discard block |
||
731 | 731 | // base64 encode the binary data, then break it |
732 | 732 | // into chunks according to RFC 2045 semantics |
733 | 733 | $base64 = chunk_split(base64_encode($picture)); |
734 | - $imageData = 'data:'.$imageDetails['mime'].';base64,'.$base64; |
|
734 | + $imageData = 'data:' . $imageDetails['mime'] . ';base64,' . $base64; |
|
735 | 735 | |
736 | 736 | $html .= '<div style="position: relative;">'; |
737 | - $html .= '<img style="position: absolute; z-index: 1; left: '.$chartCoordinates['xOffset'].'px; top: '.$chartCoordinates['yOffset'].'px; width: '.$imageDetails[0].'px; height: '.$imageDetails[1].'px;" src="'.$imageData.'" border="0" />'.PHP_EOL; |
|
737 | + $html .= '<img style="position: absolute; z-index: 1; left: ' . $chartCoordinates['xOffset'] . 'px; top: ' . $chartCoordinates['yOffset'] . 'px; width: ' . $imageDetails[0] . 'px; height: ' . $imageDetails[1] . 'px;" src="' . $imageData . '" border="0" />' . PHP_EOL; |
|
738 | 738 | $html .= '</div>'; |
739 | 739 | |
740 | 740 | unlink($chartFileName); |
@@ -771,20 +771,20 @@ discard block |
||
771 | 771 | |
772 | 772 | // Start styles |
773 | 773 | if ($generateSurroundingHTML) { |
774 | - $html .= ' <style type="text/css">'.PHP_EOL; |
|
775 | - $html .= ' html { '.$this->assembleCSS($css['html']).' }'.PHP_EOL; |
|
774 | + $html .= ' <style type="text/css">' . PHP_EOL; |
|
775 | + $html .= ' html { ' . $this->assembleCSS($css['html']) . ' }' . PHP_EOL; |
|
776 | 776 | } |
777 | 777 | |
778 | 778 | // Write all other styles |
779 | 779 | foreach ($css as $styleName => $styleDefinition) { |
780 | 780 | if ($styleName != 'html') { |
781 | - $html .= ' '.$styleName.' { '.$this->assembleCSS($styleDefinition).' }'.PHP_EOL; |
|
781 | + $html .= ' ' . $styleName . ' { ' . $this->assembleCSS($styleDefinition) . ' }' . PHP_EOL; |
|
782 | 782 | } |
783 | 783 | } |
784 | 784 | |
785 | 785 | // End styles |
786 | 786 | if ($generateSurroundingHTML) { |
787 | - $html .= ' </style>'.PHP_EOL; |
|
787 | + $html .= ' </style>' . PHP_EOL; |
|
788 | 788 | } |
789 | 789 | |
790 | 790 | // Return |
@@ -858,8 +858,8 @@ discard block |
||
858 | 858 | |
859 | 859 | // Calculate cell style hashes |
860 | 860 | foreach ($this->spreadsheet->getCellXfCollection() as $index => $style) { |
861 | - $css['td.style'.$index] = $this->createCSSStyle($style); |
|
862 | - $css['th.style'.$index] = $this->createCSSStyle($style); |
|
861 | + $css['td.style' . $index] = $this->createCSSStyle($style); |
|
862 | + $css['th.style' . $index] = $this->createCSSStyle($style); |
|
863 | 863 | } |
864 | 864 | |
865 | 865 | // Fetch sheets |
@@ -884,7 +884,7 @@ discard block |
||
884 | 884 | $column = -1; |
885 | 885 | while ($column++ < $highestColumnIndex) { |
886 | 886 | $this->columnWidths[$sheetIndex][$column] = 42; // approximation |
887 | - $css['table.sheet'.$sheetIndex.' col.col'.$column]['width'] = '42pt'; |
|
887 | + $css['table.sheet' . $sheetIndex . ' col.col' . $column]['width'] = '42pt'; |
|
888 | 888 | } |
889 | 889 | |
890 | 890 | // col elements, loop through columnDimensions and set width |
@@ -893,11 +893,11 @@ discard block |
||
893 | 893 | $width = \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToPoints($width); |
894 | 894 | $column = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($columnDimension->getColumnIndex()) - 1; |
895 | 895 | $this->columnWidths[$sheetIndex][$column] = $width; |
896 | - $css['table.sheet'.$sheetIndex.' col.col'.$column]['width'] = $width.'pt'; |
|
896 | + $css['table.sheet' . $sheetIndex . ' col.col' . $column]['width'] = $width . 'pt'; |
|
897 | 897 | |
898 | 898 | if ($columnDimension->getVisible() === false) { |
899 | - $css['table.sheet'.$sheetIndex.' col.col'.$column]['visibility'] = 'collapse'; |
|
900 | - $css['table.sheet'.$sheetIndex.' col.col'.$column]['*display'] = 'none'; // target IE6+7 |
|
899 | + $css['table.sheet' . $sheetIndex . ' col.col' . $column]['visibility'] = 'collapse'; |
|
900 | + $css['table.sheet' . $sheetIndex . ' col.col' . $column]['*display'] = 'none'; // target IE6+7 |
|
901 | 901 | } |
902 | 902 | } |
903 | 903 | } |
@@ -906,17 +906,17 @@ discard block |
||
906 | 906 | $rowDimension = $sheet->getDefaultRowDimension(); |
907 | 907 | |
908 | 908 | // table.sheetN tr { } |
909 | - $css['table.sheet'.$sheetIndex.' tr'] = []; |
|
909 | + $css['table.sheet' . $sheetIndex . ' tr'] = []; |
|
910 | 910 | |
911 | 911 | if ($rowDimension->getRowHeight() == -1) { |
912 | 912 | $pt_height = Font::getDefaultRowHeightByFont($this->spreadsheet->getDefaultStyle()->getFont()); |
913 | 913 | } else { |
914 | 914 | $pt_height = $rowDimension->getRowHeight(); |
915 | 915 | } |
916 | - $css['table.sheet'.$sheetIndex.' tr']['height'] = $pt_height.'pt'; |
|
916 | + $css['table.sheet' . $sheetIndex . ' tr']['height'] = $pt_height . 'pt'; |
|
917 | 917 | if ($rowDimension->getVisible() === false) { |
918 | - $css['table.sheet'.$sheetIndex.' tr']['display'] = 'none'; |
|
919 | - $css['table.sheet'.$sheetIndex.' tr']['visibility'] = 'hidden'; |
|
918 | + $css['table.sheet' . $sheetIndex . ' tr']['display'] = 'none'; |
|
919 | + $css['table.sheet' . $sheetIndex . ' tr']['visibility'] = 'hidden'; |
|
920 | 920 | } |
921 | 921 | |
922 | 922 | // Calculate row heights |
@@ -924,17 +924,17 @@ discard block |
||
924 | 924 | $row = $rowDimension->getRowIndex() - 1; |
925 | 925 | |
926 | 926 | // table.sheetN tr.rowYYYYYY { } |
927 | - $css['table.sheet'.$sheetIndex.' tr.row'.$row] = []; |
|
927 | + $css['table.sheet' . $sheetIndex . ' tr.row' . $row] = []; |
|
928 | 928 | |
929 | 929 | if ($rowDimension->getRowHeight() == -1) { |
930 | 930 | $pt_height = Font::getDefaultRowHeightByFont($this->spreadsheet->getDefaultStyle()->getFont()); |
931 | 931 | } else { |
932 | 932 | $pt_height = $rowDimension->getRowHeight(); |
933 | 933 | } |
934 | - $css['table.sheet'.$sheetIndex.' tr.row'.$row]['height'] = $pt_height.'pt'; |
|
934 | + $css['table.sheet' . $sheetIndex . ' tr.row' . $row]['height'] = $pt_height . 'pt'; |
|
935 | 935 | if ($rowDimension->getVisible() === false) { |
936 | - $css['table.sheet'.$sheetIndex.' tr.row'.$row]['display'] = 'none'; |
|
937 | - $css['table.sheet'.$sheetIndex.' tr.row'.$row]['visibility'] = 'hidden'; |
|
936 | + $css['table.sheet' . $sheetIndex . ' tr.row' . $row]['display'] = 'none'; |
|
937 | + $css['table.sheet' . $sheetIndex . ' tr.row' . $row]['visibility'] = 'hidden'; |
|
938 | 938 | } |
939 | 939 | } |
940 | 940 | } |
@@ -989,7 +989,7 @@ discard block |
||
989 | 989 | if ($textAlign = $this->mapHAlign($pStyle->getHorizontal())) { |
990 | 990 | $css['text-align'] = $textAlign; |
991 | 991 | if (in_array($textAlign, ['left', 'right'])) { |
992 | - $css['padding-'.$textAlign] = (string) ((int) $pStyle->getIndent() * 9).'px'; |
|
992 | + $css['padding-' . $textAlign] = (string) ((int) $pStyle->getIndent() * 9) . 'px'; |
|
993 | 993 | } |
994 | 994 | } |
995 | 995 | |
@@ -1023,9 +1023,9 @@ discard block |
||
1023 | 1023 | $css['font-style'] = 'italic'; |
1024 | 1024 | } |
1025 | 1025 | |
1026 | - $css['color'] = '#'.$pStyle->getColor()->getRGB(); |
|
1027 | - $css['font-family'] = '\''.$pStyle->getName().'\''; |
|
1028 | - $css['font-size'] = $pStyle->getSize().'pt'; |
|
1026 | + $css['color'] = '#' . $pStyle->getColor()->getRGB(); |
|
1027 | + $css['font-family'] = '\'' . $pStyle->getName() . '\''; |
|
1028 | + $css['font-size'] = $pStyle->getSize() . 'pt'; |
|
1029 | 1029 | |
1030 | 1030 | return $css; |
1031 | 1031 | } |
@@ -1062,7 +1062,7 @@ discard block |
||
1062 | 1062 | { |
1063 | 1063 | // Create CSS - add !important to non-none border styles for merged cells |
1064 | 1064 | $borderStyle = $this->mapBorderStyle($pStyle->getBorderStyle()); |
1065 | - $css = $borderStyle.' #'.$pStyle->getColor()->getRGB().(($borderStyle == 'none') ? '' : ' !important'); |
|
1065 | + $css = $borderStyle . ' #' . $pStyle->getColor()->getRGB() . (($borderStyle == 'none') ? '' : ' !important'); |
|
1066 | 1066 | |
1067 | 1067 | return $css; |
1068 | 1068 | } |
@@ -1081,7 +1081,7 @@ discard block |
||
1081 | 1081 | |
1082 | 1082 | // Create CSS |
1083 | 1083 | $value = $pStyle->getFillType() == \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_NONE ? |
1084 | - 'white' : '#'.$pStyle->getStartColor()->getRGB(); |
|
1084 | + 'white' : '#' . $pStyle->getStartColor()->getRGB(); |
|
1085 | 1085 | $css['background-color'] = $value; |
1086 | 1086 | |
1087 | 1087 | return $css; |
@@ -1094,8 +1094,8 @@ discard block |
||
1094 | 1094 | { |
1095 | 1095 | // Construct HTML |
1096 | 1096 | $html = ''; |
1097 | - $html .= ' </body>'.PHP_EOL; |
|
1098 | - $html .= '</html>'.PHP_EOL; |
|
1097 | + $html .= ' </body>' . PHP_EOL; |
|
1098 | + $html .= '</html>' . PHP_EOL; |
|
1099 | 1099 | |
1100 | 1100 | return $html; |
1101 | 1101 | } |
@@ -1119,15 +1119,15 @@ discard block |
||
1119 | 1119 | |
1120 | 1120 | if (!$this->useInlineCss) { |
1121 | 1121 | $gridlines = $pSheet->getShowGridlines() ? ' gridlines' : ''; |
1122 | - $html .= ' <table border="0" cellpadding="0" cellspacing="0" id="sheet'.$sheetIndex.'" class="sheet'.$sheetIndex.$gridlines.'">'.PHP_EOL; |
|
1122 | + $html .= ' <table border="0" cellpadding="0" cellspacing="0" id="sheet' . $sheetIndex . '" class="sheet' . $sheetIndex . $gridlines . '">' . PHP_EOL; |
|
1123 | 1123 | } else { |
1124 | 1124 | $style = isset($this->cssStyles['table']) ? |
1125 | 1125 | $this->assembleCSS($this->cssStyles['table']) : ''; |
1126 | 1126 | |
1127 | 1127 | if ($this->isPdf && $pSheet->getShowGridlines()) { |
1128 | - $html .= ' <table border="1" cellpadding="1" id="sheet'.$sheetIndex.'" cellspacing="1" style="'.$style.'">'.PHP_EOL; |
|
1128 | + $html .= ' <table border="1" cellpadding="1" id="sheet' . $sheetIndex . '" cellspacing="1" style="' . $style . '">' . PHP_EOL; |
|
1129 | 1129 | } else { |
1130 | - $html .= ' <table border="0" cellpadding="1" id="sheet'.$sheetIndex.'" cellspacing="0" style="'.$style.'">'.PHP_EOL; |
|
1130 | + $html .= ' <table border="0" cellpadding="1" id="sheet' . $sheetIndex . '" cellspacing="0" style="' . $style . '">' . PHP_EOL; |
|
1131 | 1131 | } |
1132 | 1132 | } |
1133 | 1133 | |
@@ -1137,11 +1137,11 @@ discard block |
||
1137 | 1137 | while ($i++ < $highestColumnIndex) { |
1138 | 1138 | if (!$this->isPdf) { |
1139 | 1139 | if (!$this->useInlineCss) { |
1140 | - $html .= ' <col class="col'.$i.'">'.PHP_EOL; |
|
1140 | + $html .= ' <col class="col' . $i . '">' . PHP_EOL; |
|
1141 | 1141 | } else { |
1142 | - $style = isset($this->cssStyles['table.sheet'.$sheetIndex.' col.col'.$i]) ? |
|
1143 | - $this->assembleCSS($this->cssStyles['table.sheet'.$sheetIndex.' col.col'.$i]) : ''; |
|
1144 | - $html .= ' <col style="'.$style.'">'.PHP_EOL; |
|
1142 | + $style = isset($this->cssStyles['table.sheet' . $sheetIndex . ' col.col' . $i]) ? |
|
1143 | + $this->assembleCSS($this->cssStyles['table.sheet' . $sheetIndex . ' col.col' . $i]) : ''; |
|
1144 | + $html .= ' <col style="' . $style . '">' . PHP_EOL; |
|
1145 | 1145 | } |
1146 | 1146 | } |
1147 | 1147 | } |
@@ -1156,7 +1156,7 @@ discard block |
||
1156 | 1156 | */ |
1157 | 1157 | private function generateTableFooter() |
1158 | 1158 | { |
1159 | - $html = ' </table>'.PHP_EOL; |
|
1159 | + $html = ' </table>' . PHP_EOL; |
|
1160 | 1160 | |
1161 | 1161 | return $html; |
1162 | 1162 | } |
@@ -1186,7 +1186,7 @@ discard block |
||
1186 | 1186 | $breaks = $pSheet->getBreaks(); |
1187 | 1187 | |
1188 | 1188 | // check if a break is needed before this row |
1189 | - if (isset($breaks['A'.$pRow])) { |
|
1189 | + if (isset($breaks['A' . $pRow])) { |
|
1190 | 1190 | // close table: </table> |
1191 | 1191 | $html .= $this->generateTableFooter(); |
1192 | 1192 | |
@@ -1200,31 +1200,31 @@ discard block |
||
1200 | 1200 | |
1201 | 1201 | // Write row start |
1202 | 1202 | if (!$this->useInlineCss) { |
1203 | - $html .= ' <tr class="row'.$pRow.'">'.PHP_EOL; |
|
1203 | + $html .= ' <tr class="row' . $pRow . '">' . PHP_EOL; |
|
1204 | 1204 | } else { |
1205 | - $style = isset($this->cssStyles['table.sheet'.$sheetIndex.' tr.row'.$pRow]) |
|
1206 | - ? $this->assembleCSS($this->cssStyles['table.sheet'.$sheetIndex.' tr.row'.$pRow]) : ''; |
|
1205 | + $style = isset($this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]) |
|
1206 | + ? $this->assembleCSS($this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]) : ''; |
|
1207 | 1207 | |
1208 | - $html .= ' <tr style="'.$style.'">'.PHP_EOL; |
|
1208 | + $html .= ' <tr style="' . $style . '">' . PHP_EOL; |
|
1209 | 1209 | } |
1210 | 1210 | |
1211 | 1211 | // Write cells |
1212 | 1212 | $colNum = 0; |
1213 | 1213 | foreach ($pValues as $cellAddress) { |
1214 | 1214 | $cell = ($cellAddress > '') ? $pSheet->getCell($cellAddress) : ''; |
1215 | - $coordinate = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($colNum).($pRow + 1); |
|
1215 | + $coordinate = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($colNum) . ($pRow + 1); |
|
1216 | 1216 | if (!$this->useInlineCss) { |
1217 | 1217 | $cssClass = ''; |
1218 | - $cssClass = 'column'.$colNum; |
|
1218 | + $cssClass = 'column' . $colNum; |
|
1219 | 1219 | } else { |
1220 | 1220 | $cssClass = []; |
1221 | 1221 | if ($cellType == 'th') { |
1222 | - if (isset($this->cssStyles['table.sheet'.$sheetIndex.' th.column'.$colNum])) { |
|
1223 | - $this->cssStyles['table.sheet'.$sheetIndex.' th.column'.$colNum]; |
|
1222 | + if (isset($this->cssStyles['table.sheet' . $sheetIndex . ' th.column' . $colNum])) { |
|
1223 | + $this->cssStyles['table.sheet' . $sheetIndex . ' th.column' . $colNum]; |
|
1224 | 1224 | } |
1225 | 1225 | } else { |
1226 | - if (isset($this->cssStyles['table.sheet'.$sheetIndex.' td.column'.$colNum])) { |
|
1227 | - $this->cssStyles['table.sheet'.$sheetIndex.' td.column'.$colNum]; |
|
1226 | + if (isset($this->cssStyles['table.sheet' . $sheetIndex . ' td.column' . $colNum])) { |
|
1227 | + $this->cssStyles['table.sheet' . $sheetIndex . ' td.column' . $colNum]; |
|
1228 | 1228 | } |
1229 | 1229 | } |
1230 | 1230 | } |
@@ -1247,7 +1247,7 @@ discard block |
||
1247 | 1247 | foreach ($elements as $element) { |
1248 | 1248 | // Rich text start? |
1249 | 1249 | if ($element instanceof \PhpOffice\PhpSpreadsheet\RichText\Run) { |
1250 | - $cellData .= '<span style="'.$this->assembleCSS($this->createCSSStyleFont($element->getFont())).'">'; |
|
1250 | + $cellData .= '<span style="' . $this->assembleCSS($this->createCSSStyleFont($element->getFont())) . '">'; |
|
1251 | 1251 | |
1252 | 1252 | if ($element->getFont()->getSuperScript()) { |
1253 | 1253 | $cellData .= '<sup>'; |
@@ -1286,9 +1286,9 @@ discard block |
||
1286 | 1286 | } |
1287 | 1287 | $cellData = htmlspecialchars($cellData); |
1288 | 1288 | if ($pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont()->getSuperScript()) { |
1289 | - $cellData = '<sup>'.$cellData.'</sup>'; |
|
1289 | + $cellData = '<sup>' . $cellData . '</sup>'; |
|
1290 | 1290 | } elseif ($pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont()->getSubScript()) { |
1291 | - $cellData = '<sub>'.$cellData.'</sub>'; |
|
1291 | + $cellData = '<sub>' . $cellData . '</sub>'; |
|
1292 | 1292 | } |
1293 | 1293 | } |
1294 | 1294 | |
@@ -1301,31 +1301,31 @@ discard block |
||
1301 | 1301 | |
1302 | 1302 | // Extend CSS class? |
1303 | 1303 | if (!$this->useInlineCss) { |
1304 | - $cssClass .= ' style'.$cell->getXfIndex(); |
|
1305 | - $cssClass .= ' '.$cell->getDataType(); |
|
1304 | + $cssClass .= ' style' . $cell->getXfIndex(); |
|
1305 | + $cssClass .= ' ' . $cell->getDataType(); |
|
1306 | 1306 | } else { |
1307 | 1307 | if ($cellType == 'th') { |
1308 | - if (isset($this->cssStyles['th.style'.$cell->getXfIndex()])) { |
|
1309 | - $cssClass = array_merge($cssClass, $this->cssStyles['th.style'.$cell->getXfIndex()]); |
|
1308 | + if (isset($this->cssStyles['th.style' . $cell->getXfIndex()])) { |
|
1309 | + $cssClass = array_merge($cssClass, $this->cssStyles['th.style' . $cell->getXfIndex()]); |
|
1310 | 1310 | } |
1311 | 1311 | } else { |
1312 | - if (isset($this->cssStyles['td.style'.$cell->getXfIndex()])) { |
|
1313 | - $cssClass = array_merge($cssClass, $this->cssStyles['td.style'.$cell->getXfIndex()]); |
|
1312 | + if (isset($this->cssStyles['td.style' . $cell->getXfIndex()])) { |
|
1313 | + $cssClass = array_merge($cssClass, $this->cssStyles['td.style' . $cell->getXfIndex()]); |
|
1314 | 1314 | } |
1315 | 1315 | } |
1316 | 1316 | |
1317 | 1317 | // General horizontal alignment: Actual horizontal alignment depends on dataType |
1318 | 1318 | $sharedStyle = $pSheet->getParent()->getCellXfByIndex($cell->getXfIndex()); |
1319 | 1319 | if ($sharedStyle->getAlignment()->getHorizontal() == \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_GENERAL |
1320 | - && isset($this->cssStyles['.'.$cell->getDataType()]['text-align'])) { |
|
1321 | - $cssClass['text-align'] = $this->cssStyles['.'.$cell->getDataType()]['text-align']; |
|
1320 | + && isset($this->cssStyles['.' . $cell->getDataType()]['text-align'])) { |
|
1321 | + $cssClass['text-align'] = $this->cssStyles['.' . $cell->getDataType()]['text-align']; |
|
1322 | 1322 | } |
1323 | 1323 | } |
1324 | 1324 | } |
1325 | 1325 | |
1326 | 1326 | // Hyperlink? |
1327 | 1327 | if ($pSheet->hyperlinkExists($coordinate) && !$pSheet->getHyperlink($coordinate)->isInternal()) { |
1328 | - $cellData = '<a href="'.htmlspecialchars($pSheet->getHyperlink($coordinate)->getUrl()).'" title="'.htmlspecialchars($pSheet->getHyperlink($coordinate)->getTooltip()).'">'.$cellData.'</a>'; |
|
1328 | + $cellData = '<a href="' . htmlspecialchars($pSheet->getHyperlink($coordinate)->getUrl()) . '" title="' . htmlspecialchars($pSheet->getHyperlink($coordinate)->getTooltip()) . '">' . $cellData . '</a>'; |
|
1329 | 1329 | } |
1330 | 1330 | |
1331 | 1331 | // Should the cell be written or is it swallowed by a rowspan or colspan? |
@@ -1342,18 +1342,18 @@ discard block |
||
1342 | 1342 | |
1343 | 1343 | // Also apply style from last cell in merge to fix borders - |
1344 | 1344 | // relies on !important for non-none border declarations in createCSSStyleBorder |
1345 | - $endCellCoord = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($colNum + $colSpan - 1).($pRow + $rowSpan); |
|
1345 | + $endCellCoord = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($colNum + $colSpan - 1) . ($pRow + $rowSpan); |
|
1346 | 1346 | if (!$this->useInlineCss) { |
1347 | - $cssClass .= ' style'.$pSheet->getCell($endCellCoord)->getXfIndex(); |
|
1347 | + $cssClass .= ' style' . $pSheet->getCell($endCellCoord)->getXfIndex(); |
|
1348 | 1348 | } |
1349 | 1349 | } |
1350 | 1350 | |
1351 | 1351 | // Write |
1352 | 1352 | if ($writeCell) { |
1353 | 1353 | // Column start |
1354 | - $html .= ' <'.$cellType; |
|
1354 | + $html .= ' <' . $cellType; |
|
1355 | 1355 | if (!$this->useInlineCss) { |
1356 | - $html .= ' class="'.$cssClass.'"'; |
|
1356 | + $html .= ' class="' . $cssClass . '"'; |
|
1357 | 1357 | } else { |
1358 | 1358 | //** Necessary redundant code for the sake of \PhpOffice\PhpSpreadsheet\Writer\PDF ** |
1359 | 1359 | // We must explicitly write the width of the <td> element because TCPDF |
@@ -1366,23 +1366,23 @@ discard block |
||
1366 | 1366 | $width += $this->columnWidths[$sheetIndex][$i]; |
1367 | 1367 | } |
1368 | 1368 | } |
1369 | - $cssClass['width'] = $width.'pt'; |
|
1369 | + $cssClass['width'] = $width . 'pt'; |
|
1370 | 1370 | |
1371 | 1371 | // We must also explicitly write the height of the <td> element because TCPDF |
1372 | 1372 | // does not recognize e.g. <tr style="height:50pt"> |
1373 | - if (isset($this->cssStyles['table.sheet'.$sheetIndex.' tr.row'.$pRow]['height'])) { |
|
1374 | - $height = $this->cssStyles['table.sheet'.$sheetIndex.' tr.row'.$pRow]['height']; |
|
1373 | + if (isset($this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]['height'])) { |
|
1374 | + $height = $this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]['height']; |
|
1375 | 1375 | $cssClass['height'] = $height; |
1376 | 1376 | } |
1377 | 1377 | //** end of redundant code ** |
1378 | 1378 | |
1379 | - $html .= ' style="'.$this->assembleCSS($cssClass).'"'; |
|
1379 | + $html .= ' style="' . $this->assembleCSS($cssClass) . '"'; |
|
1380 | 1380 | } |
1381 | 1381 | if ($colSpan > 1) { |
1382 | - $html .= ' colspan="'.$colSpan.'"'; |
|
1382 | + $html .= ' colspan="' . $colSpan . '"'; |
|
1383 | 1383 | } |
1384 | 1384 | if ($rowSpan > 1) { |
1385 | - $html .= ' rowspan="'.$rowSpan.'"'; |
|
1385 | + $html .= ' rowspan="' . $rowSpan . '"'; |
|
1386 | 1386 | } |
1387 | 1387 | $html .= '>'; |
1388 | 1388 | |
@@ -1398,7 +1398,7 @@ discard block |
||
1398 | 1398 | $html .= $cellData; |
1399 | 1399 | |
1400 | 1400 | // Column end |
1401 | - $html .= '</'.$cellType.'>'.PHP_EOL; |
|
1401 | + $html .= '</' . $cellType . '>' . PHP_EOL; |
|
1402 | 1402 | } |
1403 | 1403 | |
1404 | 1404 | // Next column |
@@ -1406,7 +1406,7 @@ discard block |
||
1406 | 1406 | } |
1407 | 1407 | |
1408 | 1408 | // Write row end |
1409 | - $html .= ' </tr>'.PHP_EOL; |
|
1409 | + $html .= ' </tr>' . PHP_EOL; |
|
1410 | 1410 | |
1411 | 1411 | // Return |
1412 | 1412 | return $html; |
@@ -1426,7 +1426,7 @@ discard block |
||
1426 | 1426 | { |
1427 | 1427 | $pairs = []; |
1428 | 1428 | foreach ($pValue as $property => $value) { |
1429 | - $pairs[] = $property.':'.$value; |
|
1429 | + $pairs[] = $property . ':' . $value; |
|
1430 | 1430 | } |
1431 | 1431 | $string = implode('; ', $pairs); |
1432 | 1432 | |
@@ -1531,7 +1531,7 @@ discard block |
||
1531 | 1531 | |
1532 | 1532 | // color span tag |
1533 | 1533 | if ($color !== null) { |
1534 | - $value = '<span style="color:'.$color.'">'.$value.'</span>'; |
|
1534 | + $value = '<span style="color:' . $color . '">' . $value . '</span>'; |
|
1535 | 1535 | } |
1536 | 1536 | |
1537 | 1537 | return $value; |
@@ -1632,22 +1632,22 @@ discard block |
||
1632 | 1632 | $htmlPage = '@page { '; |
1633 | 1633 | $htmlBody = 'body { '; |
1634 | 1634 | |
1635 | - $left = StringHelper::formatNumber($pSheet->getPageMargins()->getLeft()).'in; '; |
|
1636 | - $htmlPage .= 'margin-left: '.$left; |
|
1637 | - $htmlBody .= 'margin-left: '.$left; |
|
1638 | - $right = StringHelper::formatNumber($pSheet->getPageMargins()->getRight()).'in; '; |
|
1639 | - $htmlPage .= 'margin-right: '.$right; |
|
1640 | - $htmlBody .= 'margin-right: '.$right; |
|
1641 | - $top = StringHelper::formatNumber($pSheet->getPageMargins()->getTop()).'in; '; |
|
1642 | - $htmlPage .= 'margin-top: '.$top; |
|
1643 | - $htmlBody .= 'margin-top: '.$top; |
|
1644 | - $bottom = StringHelper::formatNumber($pSheet->getPageMargins()->getBottom()).'in; '; |
|
1645 | - $htmlPage .= 'margin-bottom: '.$bottom; |
|
1646 | - $htmlBody .= 'margin-bottom: '.$bottom; |
|
1635 | + $left = StringHelper::formatNumber($pSheet->getPageMargins()->getLeft()) . 'in; '; |
|
1636 | + $htmlPage .= 'margin-left: ' . $left; |
|
1637 | + $htmlBody .= 'margin-left: ' . $left; |
|
1638 | + $right = StringHelper::formatNumber($pSheet->getPageMargins()->getRight()) . 'in; '; |
|
1639 | + $htmlPage .= 'margin-right: ' . $right; |
|
1640 | + $htmlBody .= 'margin-right: ' . $right; |
|
1641 | + $top = StringHelper::formatNumber($pSheet->getPageMargins()->getTop()) . 'in; '; |
|
1642 | + $htmlPage .= 'margin-top: ' . $top; |
|
1643 | + $htmlBody .= 'margin-top: ' . $top; |
|
1644 | + $bottom = StringHelper::formatNumber($pSheet->getPageMargins()->getBottom()) . 'in; '; |
|
1645 | + $htmlPage .= 'margin-bottom: ' . $bottom; |
|
1646 | + $htmlBody .= 'margin-bottom: ' . $bottom; |
|
1647 | 1647 | |
1648 | 1648 | $htmlPage .= "}\n"; |
1649 | 1649 | $htmlBody .= "}\n"; |
1650 | 1650 | |
1651 | - return "<style>\n".$htmlPage.$htmlBody."</style>\n"; |
|
1651 | + return "<style>\n" . $htmlPage . $htmlBody . "</style>\n"; |
|
1652 | 1652 | } |
1653 | 1653 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | |
181 | 181 | $header = pack('vv', $record, $length); |
182 | 182 | $data = pack('vvvv', $version, $type, $build, $year); |
183 | - $this->append($header.$data.$unknown); |
|
183 | + $this->append($header . $data . $unknown); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | /** |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | |
227 | 227 | // The first 2080/8224 bytes remain intact. However, we have to change |
228 | 228 | // the length field of the record. |
229 | - $tmp = substr($data, 0, 2).pack('v', $limit).substr($data, 4, $limit); |
|
229 | + $tmp = substr($data, 0, 2) . pack('v', $limit) . substr($data, 4, $limit); |
|
230 | 230 | |
231 | 231 | $header = pack('vv', $record, $limit); // Headers for continue records |
232 | 232 |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | $header = pack('vvV', $recVerInstance, $recType, strlen($dggData)); |
119 | - $innerData .= $header.$dggData; |
|
119 | + $innerData .= $header . $dggData; |
|
120 | 120 | |
121 | 121 | // write the bstoreContainer |
122 | 122 | if ($bstoreContainer = $this->object->getBstoreContainer()) { |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | $header = pack('vvV', $recVerInstance, $recType, $length); |
137 | 137 | |
138 | - $this->data = $header.$innerData; |
|
138 | + $this->data = $header . $innerData; |
|
139 | 139 | break; |
140 | 140 | case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer': |
141 | 141 | // this is a container record |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | $header = pack('vvV', $recVerInstance, $recType, $length); |
164 | 164 | |
165 | - $this->data = $header.$innerData; |
|
165 | + $this->data = $header . $innerData; |
|
166 | 166 | break; |
167 | 167 | case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DggContainer\\BstoreContainer\\BSE': |
168 | 168 | // this is a semi-container record |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | |
293 | 293 | // number of shapes in this drawing (including group shape) |
294 | 294 | $countShapes = count($this->object->getSpgrContainer()->getChildren()); |
295 | - $innerData .= $header.pack('VV', $countShapes, $this->object->getLastSpId()); |
|
295 | + $innerData .= $header . pack('VV', $countShapes, $this->object->getLastSpId()); |
|
296 | 296 | |
297 | 297 | // write the spgrContainer |
298 | 298 | if ($spgrContainer = $this->object->getSpgrContainer()) { |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | |
324 | 324 | $header = pack('vvV', $recVerInstance, $recType, $length); |
325 | 325 | |
326 | - $this->data = $header.$innerData; |
|
326 | + $this->data = $header . $innerData; |
|
327 | 327 | break; |
328 | 328 | case '\\PhpOffice\\PhpSpreadsheet\\Shared\\Escher\\DgContainer\\SpgrContainer': |
329 | 329 | // this is a container record |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | |
361 | 361 | $header = pack('vvV', $recVerInstance, $recType, $length); |
362 | 362 | |
363 | - $this->data = $header.$innerData; |
|
363 | + $this->data = $header . $innerData; |
|
364 | 364 | $this->spOffsets = $spOffsets; |
365 | 365 | $this->spTypes = $spTypes; |
366 | 366 | break; |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | |
383 | 383 | $header = pack('vvV', $recVerInstance, $recType, $length); |
384 | 384 | |
385 | - $data .= $header.pack('VVVV', 0, 0, 0, 0); |
|
385 | + $data .= $header . pack('VVVV', 0, 0, 0, 0); |
|
386 | 386 | } |
387 | 387 | $this->spTypes[] = ($this->object->getSpType()); |
388 | 388 | |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | |
398 | 398 | $header = pack('vvV', $recVerInstance, $recType, $length); |
399 | 399 | |
400 | - $data .= $header.pack('VV', $this->object->getSpId(), $this->object->getSpgr() ? 0x0005 : 0x0A00); |
|
400 | + $data .= $header . pack('VV', $this->object->getSpId(), $this->object->getSpgr() ? 0x0005 : 0x0A00); |
|
401 | 401 | |
402 | 402 | // the options |
403 | 403 | if ($this->object->getOPTCollection()) { |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | $recVerInstance |= $recInstance << 4; |
416 | 416 | |
417 | 417 | $header = pack('vvV', $recVerInstance, $recType, $length); |
418 | - $data .= $header.$optData; |
|
418 | + $data .= $header . $optData; |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | // the client anchor |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | $recVerInstance |= $recInstance << 4; |
457 | 457 | |
458 | 458 | $header = pack('vvV', $recVerInstance, $recType, $length); |
459 | - $data .= $header.$clientAnchorData; |
|
459 | + $data .= $header . $clientAnchorData; |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | // the client data, just empty for now |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | $recVerInstance |= $recInstance << 4; |
474 | 474 | |
475 | 475 | $header = pack('vvV', $recVerInstance, $recType, $length); |
476 | - $data .= $header.$clientDataData; |
|
476 | + $data .= $header . $clientDataData; |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | // write the record |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | |
488 | 488 | $header = pack('vvV', $recVerInstance, $recType, $length); |
489 | 489 | |
490 | - $this->data = $header.$data; |
|
490 | + $this->data = $header . $data; |
|
491 | 491 | break; |
492 | 492 | } |
493 | 493 |
@@ -258,7 +258,7 @@ |
||
258 | 258 | $data .= pack('CCC', self::mapTextRotation($this->_style->getAlignment()->getTextRotation()), $biff8_options, $used_attrib); |
259 | 259 | $data .= pack('VVv', $border1, $border2, $icv); |
260 | 260 | |
261 | - return $header.$data; |
|
261 | + return $header . $data; |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | /** |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | $bFamily = 0; // Font family |
85 | 85 | $bCharSet = \PhpOffice\PhpSpreadsheet\Shared\Font::getCharsetFromFontName($this->font->getName()); // Character set |
86 | 86 | |
87 | - $record = 0x31; // Record identifier |
|
88 | - $reserved = 0x00; // Reserved |
|
89 | - $grbit = 0x00; // Font attributes |
|
87 | + $record = 0x31; // Record identifier |
|
88 | + $reserved = 0x00; // Reserved |
|
89 | + $grbit = 0x00; // Font attributes |
|
90 | 90 | if ($this->font->getItalic()) { |
91 | 91 | $grbit |= 0x02; |
92 | 92 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $length = strlen($data); |
122 | 122 | $header = pack('vv', $record, $length); |
123 | 123 | |
124 | - return $header.$data; |
|
124 | + return $header . $data; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -134,10 +134,10 @@ discard block |
||
134 | 134 | private static function mapBold($bold) |
135 | 135 | { |
136 | 136 | if ($bold) { |
137 | - return 0x2BC; // 700 = Bold font weight |
|
137 | + return 0x2BC; // 700 = Bold font weight |
|
138 | 138 | } |
139 | 139 | |
140 | - return 0x190; // 400 = Normal font weight |
|
140 | + return 0x190; // 400 = Normal font weight |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | /** |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | if ($sheetState != 'visible' && $sheetState != '') { |
254 | 254 | $objWriter->writeAttribute('state', $sheetState); |
255 | 255 | } |
256 | - $objWriter->writeAttribute('r:id', 'rId'.$pRelId); |
|
256 | + $objWriter->writeAttribute('r:id', 'rId' . $pRelId); |
|
257 | 257 | $objWriter->endElement(); |
258 | 258 | } else { |
259 | 259 | throw new \PhpOffice\PhpSpreadsheet\Writer\WriteException('Invalid parameters passed.'); |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | // Create absolute coordinate and write as raw text |
333 | 333 | $range = \PhpOffice\PhpSpreadsheet\Cell::splitRange($pNamedRange->getRange()); |
334 | 334 | for ($i = 0; $i < count($range); ++$i) { |
335 | - $range[$i][0] = '\''.str_replace("'", "''", $pNamedRange->getWorksheet()->getTitle()).'\'!'.\PhpOffice\PhpSpreadsheet\Cell::absoluteReference($range[$i][0]); |
|
335 | + $range[$i][0] = '\'' . str_replace("'", "''", $pNamedRange->getWorksheet()->getTitle()) . '\'!' . \PhpOffice\PhpSpreadsheet\Cell::absoluteReference($range[$i][0]); |
|
336 | 336 | if (isset($range[$i][1])) { |
337 | 337 | $range[$i][1] = \PhpOffice\PhpSpreadsheet\Cell::absoluteReference($range[$i][1]); |
338 | 338 | } |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | $range[1] = \PhpOffice\PhpSpreadsheet\Cell::absoluteCoordinate($range[1]); |
376 | 376 | $range = implode(':', $range); |
377 | 377 | |
378 | - $objWriter->writeRawData('\''.str_replace("'", "''", $pSheet->getTitle()).'\'!'.$range); |
|
378 | + $objWriter->writeRawData('\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . $range); |
|
379 | 379 | |
380 | 380 | $objWriter->endElement(); |
381 | 381 | } |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet()) { |
406 | 406 | $repeat = $pSheet->getPageSetup()->getColumnsToRepeatAtLeft(); |
407 | 407 | |
408 | - $settingString .= '\''.str_replace("'", "''", $pSheet->getTitle()).'\'!$'.$repeat[0].':$'.$repeat[1]; |
|
408 | + $settingString .= '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!$' . $repeat[0] . ':$' . $repeat[1]; |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | // Rows to repeat |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | |
417 | 417 | $repeat = $pSheet->getPageSetup()->getRowsToRepeatAtTop(); |
418 | 418 | |
419 | - $settingString .= '\''.str_replace("'", "''", $pSheet->getTitle()).'\'!$'.$repeat[0].':$'.$repeat[1]; |
|
419 | + $settingString .= '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!$' . $repeat[0] . ':$' . $repeat[1]; |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | $objWriter->writeRawData($settingString); |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | foreach ($printArea as $printAreaRect) { |
453 | 453 | $printAreaRect[0] = \PhpOffice\PhpSpreadsheet\Cell::absoluteReference($printAreaRect[0]); |
454 | 454 | $printAreaRect[1] = \PhpOffice\PhpSpreadsheet\Cell::absoluteReference($printAreaRect[1]); |
455 | - $chunks[] = '\''.str_replace("'", "''", $pSheet->getTitle()).'\'!'.implode(':', $printAreaRect); |
|
455 | + $chunks[] = '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . implode(':', $printAreaRect); |
|
456 | 456 | } |
457 | 457 | |
458 | 458 | $objWriter->writeRawData(implode(',', $chunks)); |