@@ -214,14 +214,14 @@ discard block |
||
214 | 214 | $this->documentSummaryInformation = $this->writeDocumentSummaryInformation(); |
215 | 215 | // initialize OLE Document Summary Information |
216 | 216 | if (isset($this->documentSummaryInformation) && !empty($this->documentSummaryInformation)) { |
217 | - $OLE_DocumentSummaryInformation = new \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS\File(OLE::ascToUcs(chr(5).'DocumentSummaryInformation')); |
|
217 | + $OLE_DocumentSummaryInformation = new \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS\File(OLE::ascToUcs(chr(5) . 'DocumentSummaryInformation')); |
|
218 | 218 | $OLE_DocumentSummaryInformation->append($this->documentSummaryInformation); |
219 | 219 | } |
220 | 220 | |
221 | 221 | $this->summaryInformation = $this->writeSummaryInformation(); |
222 | 222 | // initialize OLE Summary Information |
223 | 223 | if (isset($this->summaryInformation) && !empty($this->summaryInformation)) { |
224 | - $OLE_SummaryInformation = new \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS\File(OLE::ascToUcs(chr(5).'SummaryInformation')); |
|
224 | + $OLE_SummaryInformation = new \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS\File(OLE::ascToUcs(chr(5) . 'SummaryInformation')); |
|
225 | 225 | $OLE_SummaryInformation->append($this->summaryInformation); |
226 | 226 | } |
227 | 227 | |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | // create an Drawing Object for the dropdown |
368 | 368 | $oDrawing = new BaseDrawing(); |
369 | 369 | // get the coordinates of drawing |
370 | - $cDrawing = Cell::stringFromColumnIndex($iInc - 1).$rangeBounds[0][1]; |
|
370 | + $cDrawing = Cell::stringFromColumnIndex($iInc - 1) . $rangeBounds[0][1]; |
|
371 | 371 | $oDrawing->setCoordinates($cDrawing); |
372 | 372 | $oDrawing->setWorksheet($sheet); |
373 | 373 | |
@@ -666,7 +666,7 @@ discard block |
||
666 | 666 | $dataProp .= pack('v', 0x000A); |
667 | 667 | $dataProp .= pack('v', 0x0000); |
668 | 668 | // value |
669 | - $dataProp .= 'Worksheet'.chr(0); |
|
669 | + $dataProp .= 'Worksheet' . chr(0); |
|
670 | 670 | |
671 | 671 | $dataSection[] = [ |
672 | 672 | 'summary' => ['pack' => 'V', 'data' => 0x0D], |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | if ($this->includeSeparatorLine) { |
133 | 133 | // Write the separator line if required |
134 | - fwrite($fileHandle, 'sep='.$this->getDelimiter().$this->lineEnding); |
|
134 | + fwrite($fileHandle, 'sep=' . $this->getDelimiter() . $this->lineEnding); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | // Identify the range that we need to extract from the worksheet |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | // Write rows to file |
142 | 142 | for ($row = 1; $row <= $maxRow; ++$row) { |
143 | 143 | // Convert the row to an array... |
144 | - $cellsArray = $sheet->rangeToArray('A'.$row.':'.$maxCol.$row, '', $this->preCalculateFormulas); |
|
144 | + $cellsArray = $sheet->rangeToArray('A' . $row . ':' . $maxCol . $row, '', $this->preCalculateFormulas); |
|
145 | 145 | // ... and write to the file |
146 | 146 | $this->writeLine($fileHandle, $cellsArray[0]); |
147 | 147 | } |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | |
345 | 345 | foreach ($pValues as $element) { |
346 | 346 | // Escape enclosures |
347 | - $element = str_replace($this->enclosure, $this->enclosure.$this->enclosure, $element); |
|
347 | + $element = str_replace($this->enclosure, $this->enclosure . $this->enclosure, $element); |
|
348 | 348 | |
349 | 349 | // Add delimiter |
350 | 350 | if ($writeDelimiter) { |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | } |
355 | 355 | |
356 | 356 | // Add enclosed string |
357 | - $line .= $this->enclosure.$element.$this->enclosure; |
|
357 | + $line .= $this->enclosure . $element . $this->enclosure; |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | // Add line ending |
@@ -212,7 +212,7 @@ |
||
212 | 212 | } catch (Exception $e) { |
213 | 213 | $formula_value = $cell->getValue(); |
214 | 214 | } |
215 | - $objWriter->writeAttribute('table:formula', 'of:'.$cell->getValue()); |
|
215 | + $objWriter->writeAttribute('table:formula', 'of:' . $cell->getValue()); |
|
216 | 216 | if (is_numeric($formula_value)) { |
217 | 217 | $objWriter->writeAttribute('office:value-type', 'float'); |
218 | 218 | } else { |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | // Try opening the ZIP file |
239 | 239 | if ($objZip->open($pFilename, $zipOverWrite) !== true) { |
240 | 240 | if ($objZip->open($pFilename, $zipCreate) !== true) { |
241 | - throw new \PhpOffice\PhpSpreadsheet\Writer\WriteException('Could not open '.$pFilename.' for writing.'); |
|
241 | + throw new \PhpOffice\PhpSpreadsheet\Writer\WriteException('Could not open ' . $pFilename . ' for writing.'); |
|
242 | 242 | } |
243 | 243 | } |
244 | 244 | |
@@ -264,13 +264,13 @@ discard block |
||
264 | 264 | $tmpRibbonTarget = $this->spreadSheet->getRibbonXMLData('target'); |
265 | 265 | $objZip->addFromString($tmpRibbonTarget, $this->spreadSheet->getRibbonXMLData('data')); |
266 | 266 | if ($this->spreadSheet->hasRibbonBinObjects()) { |
267 | - $tmpRootPath = dirname($tmpRibbonTarget).'/'; |
|
267 | + $tmpRootPath = dirname($tmpRibbonTarget) . '/'; |
|
268 | 268 | $ribbonBinObjects = $this->spreadSheet->getRibbonBinObjects('data'); //the files to write |
269 | 269 | foreach ($ribbonBinObjects as $aPath => $aContent) { |
270 | - $objZip->addFromString($tmpRootPath.$aPath, $aContent); |
|
270 | + $objZip->addFromString($tmpRootPath . $aPath, $aContent); |
|
271 | 271 | } |
272 | 272 | //the rels for files |
273 | - $objZip->addFromString($tmpRootPath.'_rels/'.basename($tmpRibbonTarget).'.rels', $this->getWriterPart('RelsRibbonObjects')->writeRibbonRelationships($this->spreadSheet)); |
|
273 | + $objZip->addFromString($tmpRootPath . '_rels/' . basename($tmpRibbonTarget) . '.rels', $this->getWriterPart('RelsRibbonObjects')->writeRibbonRelationships($this->spreadSheet)); |
|
274 | 274 | } |
275 | 275 | } |
276 | 276 | |
@@ -301,12 +301,12 @@ discard block |
||
301 | 301 | $chartCount = 0; |
302 | 302 | // Add worksheets |
303 | 303 | for ($i = 0; $i < $this->spreadSheet->getSheetCount(); ++$i) { |
304 | - $objZip->addFromString('xl/worksheets/sheet'.($i + 1).'.xml', $this->getWriterPart('Worksheet')->writeWorksheet($this->spreadSheet->getSheet($i), $this->stringTable, $this->includeCharts)); |
|
304 | + $objZip->addFromString('xl/worksheets/sheet' . ($i + 1) . '.xml', $this->getWriterPart('Worksheet')->writeWorksheet($this->spreadSheet->getSheet($i), $this->stringTable, $this->includeCharts)); |
|
305 | 305 | if ($this->includeCharts) { |
306 | 306 | $charts = $this->spreadSheet->getSheet($i)->getChartCollection(); |
307 | 307 | if (count($charts) > 0) { |
308 | 308 | foreach ($charts as $chart) { |
309 | - $objZip->addFromString('xl/charts/chart'.($chartCount + 1).'.xml', $this->getWriterPart('Chart')->writeChart($chart, $this->preCalculateFormulas)); |
|
309 | + $objZip->addFromString('xl/charts/chart' . ($chartCount + 1) . '.xml', $this->getWriterPart('Chart')->writeChart($chart, $this->preCalculateFormulas)); |
|
310 | 310 | ++$chartCount; |
311 | 311 | } |
312 | 312 | } |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | // Add worksheet relationships (drawings, ...) |
318 | 318 | for ($i = 0; $i < $this->spreadSheet->getSheetCount(); ++$i) { |
319 | 319 | // Add relationships |
320 | - $objZip->addFromString('xl/worksheets/_rels/sheet'.($i + 1).'.xml.rels', $this->getWriterPart('Rels')->writeWorksheetRelationships($this->spreadSheet->getSheet($i), ($i + 1), $this->includeCharts)); |
|
320 | + $objZip->addFromString('xl/worksheets/_rels/sheet' . ($i + 1) . '.xml.rels', $this->getWriterPart('Rels')->writeWorksheetRelationships($this->spreadSheet->getSheet($i), ($i + 1), $this->includeCharts)); |
|
321 | 321 | |
322 | 322 | $drawings = $this->spreadSheet->getSheet($i)->getDrawingCollection(); |
323 | 323 | $drawingCount = count($drawings); |
@@ -328,32 +328,32 @@ discard block |
||
328 | 328 | // Add drawing and image relationship parts |
329 | 329 | if (($drawingCount > 0) || ($chartCount > 0)) { |
330 | 330 | // Drawing relationships |
331 | - $objZip->addFromString('xl/drawings/_rels/drawing'.($i + 1).'.xml.rels', $this->getWriterPart('Rels')->writeDrawingRelationships($this->spreadSheet->getSheet($i), $chartRef1, $this->includeCharts)); |
|
331 | + $objZip->addFromString('xl/drawings/_rels/drawing' . ($i + 1) . '.xml.rels', $this->getWriterPart('Rels')->writeDrawingRelationships($this->spreadSheet->getSheet($i), $chartRef1, $this->includeCharts)); |
|
332 | 332 | |
333 | 333 | // Drawings |
334 | - $objZip->addFromString('xl/drawings/drawing'.($i + 1).'.xml', $this->getWriterPart('Drawing')->writeDrawings($this->spreadSheet->getSheet($i), $chartRef2, $this->includeCharts)); |
|
334 | + $objZip->addFromString('xl/drawings/drawing' . ($i + 1) . '.xml', $this->getWriterPart('Drawing')->writeDrawings($this->spreadSheet->getSheet($i), $chartRef2, $this->includeCharts)); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | // Add comment relationship parts |
338 | 338 | if (count($this->spreadSheet->getSheet($i)->getComments()) > 0) { |
339 | 339 | // VML Comments |
340 | - $objZip->addFromString('xl/drawings/vmlDrawing'.($i + 1).'.vml', $this->getWriterPart('Comments')->writeVMLComments($this->spreadSheet->getSheet($i))); |
|
340 | + $objZip->addFromString('xl/drawings/vmlDrawing' . ($i + 1) . '.vml', $this->getWriterPart('Comments')->writeVMLComments($this->spreadSheet->getSheet($i))); |
|
341 | 341 | |
342 | 342 | // Comments |
343 | - $objZip->addFromString('xl/comments'.($i + 1).'.xml', $this->getWriterPart('Comments')->writeComments($this->spreadSheet->getSheet($i))); |
|
343 | + $objZip->addFromString('xl/comments' . ($i + 1) . '.xml', $this->getWriterPart('Comments')->writeComments($this->spreadSheet->getSheet($i))); |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | // Add header/footer relationship parts |
347 | 347 | if (count($this->spreadSheet->getSheet($i)->getHeaderFooter()->getImages()) > 0) { |
348 | 348 | // VML Drawings |
349 | - $objZip->addFromString('xl/drawings/vmlDrawingHF'.($i + 1).'.vml', $this->getWriterPart('Drawing')->writeVMLHeaderFooterImages($this->spreadSheet->getSheet($i))); |
|
349 | + $objZip->addFromString('xl/drawings/vmlDrawingHF' . ($i + 1) . '.vml', $this->getWriterPart('Drawing')->writeVMLHeaderFooterImages($this->spreadSheet->getSheet($i))); |
|
350 | 350 | |
351 | 351 | // VML Drawing relationships |
352 | - $objZip->addFromString('xl/drawings/_rels/vmlDrawingHF'.($i + 1).'.vml.rels', $this->getWriterPart('Rels')->writeHeaderFooterDrawingRelationships($this->spreadSheet->getSheet($i))); |
|
352 | + $objZip->addFromString('xl/drawings/_rels/vmlDrawingHF' . ($i + 1) . '.vml.rels', $this->getWriterPart('Rels')->writeHeaderFooterDrawingRelationships($this->spreadSheet->getSheet($i))); |
|
353 | 353 | |
354 | 354 | // Media |
355 | 355 | foreach ($this->spreadSheet->getSheet($i)->getHeaderFooter()->getImages() as $image) { |
356 | - $objZip->addFromString('xl/media/'.$image->getIndexedFilename(), file_get_contents($image->getPath())); |
|
356 | + $objZip->addFromString('xl/media/' . $image->getIndexedFilename(), file_get_contents($image->getPath())); |
|
357 | 357 | } |
358 | 358 | } |
359 | 359 | } |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | $imageContents = file_get_contents($imagePath); |
378 | 378 | } |
379 | 379 | |
380 | - $objZip->addFromString('xl/media/'.str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents); |
|
380 | + $objZip->addFromString('xl/media/' . str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents); |
|
381 | 381 | } elseif ($this->getDrawingHashTable()->getByIndex($i) instanceof MemoryDrawing) { |
382 | 382 | ob_start(); |
383 | 383 | call_user_func( |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | $imageContents = ob_get_contents(); |
388 | 388 | ob_end_clean(); |
389 | 389 | |
390 | - $objZip->addFromString('xl/media/'.str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents); |
|
390 | + $objZip->addFromString('xl/media/' . str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents); |
|
391 | 391 | } |
392 | 392 | } |
393 | 393 |
@@ -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 | } |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | // Create absolute coordinate |
658 | 658 | $range = \PhpOffice\PhpSpreadsheet\Cell::splitRange($namedRange->getRange()); |
659 | 659 | for ($i = 0; $i < count($range); ++$i) { |
660 | - $range[$i][0] = '\''.str_replace("'", "''", $namedRange->getWorksheet()->getTitle()).'\'!'.\PhpOffice\PhpSpreadsheet\Cell::absoluteCoordinate($range[$i][0]); |
|
660 | + $range[$i][0] = '\'' . str_replace("'", "''", $namedRange->getWorksheet()->getTitle()) . '\'!' . \PhpOffice\PhpSpreadsheet\Cell::absoluteCoordinate($range[$i][0]); |
|
661 | 661 | if (isset($range[$i][1])) { |
662 | 662 | $range[$i][1] = \PhpOffice\PhpSpreadsheet\Cell::absoluteCoordinate($range[$i][1]); |
663 | 663 | } |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | |
672 | 672 | // make sure tRef3d is of type tRef3dR (0x3A) |
673 | 673 | if (isset($formulaData{0}) and ($formulaData{0} == "\x7A" or $formulaData{0} == "\x5A")) { |
674 | - $formulaData = "\x3A".substr($formulaData, 1); |
|
674 | + $formulaData = "\x3A" . substr($formulaData, 1); |
|
675 | 675 | } |
676 | 676 | |
677 | 677 | if ($namedRange->getLocalOnly()) { |
@@ -819,12 +819,12 @@ discard block |
||
819 | 819 | |
820 | 820 | // combine the parts |
821 | 821 | $data = pack('vCCvvvCCCC', $options, 0, $nlen, $sz, 0, $sheetIndex, 0, 0, 0, 0) |
822 | - .$name.$formulaData; |
|
822 | + .$name . $formulaData; |
|
823 | 823 | $length = strlen($data); |
824 | 824 | |
825 | 825 | $header = pack('vv', $record, $length); |
826 | 826 | |
827 | - return $header.$data; |
|
827 | + return $header . $data; |
|
828 | 828 | } |
829 | 829 | |
830 | 830 | /** |
@@ -859,12 +859,12 @@ discard block |
||
859 | 859 | |
860 | 860 | // combine the parts |
861 | 861 | $data = pack('vCCvvvCCCCC', $options, 0, 1, $sz, 0, $sheetIndex, 0, 0, 0, 0, 0) |
862 | - .$name.$extra; |
|
862 | + .$name . $extra; |
|
863 | 863 | $length = strlen($data); |
864 | 864 | |
865 | 865 | $header = pack('vv', $record, $length); |
866 | 866 | |
867 | - return $header.$data; |
|
867 | + return $header . $data; |
|
868 | 868 | } |
869 | 869 | |
870 | 870 | /** |
@@ -879,7 +879,7 @@ discard block |
||
879 | 879 | $header = pack('vv', $record, $length); |
880 | 880 | $data = pack('v', $cv); |
881 | 881 | |
882 | - $this->append($header.$data); |
|
882 | + $this->append($header . $data); |
|
883 | 883 | } |
884 | 884 | |
885 | 885 | /** |
@@ -908,7 +908,7 @@ discard block |
||
908 | 908 | |
909 | 909 | $header = pack('vv', $record, $length); |
910 | 910 | $data = pack('vvvvvvvvv', $xWn, $yWn, $dxWn, $dyWn, $grbit, $itabCur, $itabFirst, $ctabsel, $wTabRatio); |
911 | - $this->append($header.$data); |
|
911 | + $this->append($header . $data); |
|
912 | 912 | } |
913 | 913 | |
914 | 914 | /** |
@@ -948,7 +948,7 @@ discard block |
||
948 | 948 | |
949 | 949 | $length = strlen($data); |
950 | 950 | $header = pack('vv', $record, $length); |
951 | - $this->append($header.$data); |
|
951 | + $this->append($header . $data); |
|
952 | 952 | } |
953 | 953 | |
954 | 954 | /** |
@@ -962,7 +962,7 @@ discard block |
||
962 | 962 | $header = pack('vv', $record, $length); |
963 | 963 | $data = pack('vv', $this->spreadsheet->getSheetCount(), 0x0401); |
964 | 964 | |
965 | - return $this->writeData($header.$data); |
|
965 | + return $this->writeData($header . $data); |
|
966 | 966 | } |
967 | 967 | |
968 | 968 | /** |
@@ -982,7 +982,7 @@ discard block |
||
982 | 982 | $data .= $this->parser->references[$i]; |
983 | 983 | } |
984 | 984 | |
985 | - return $this->writeData($header.$data); |
|
985 | + return $this->writeData($header . $data); |
|
986 | 986 | } |
987 | 987 | |
988 | 988 | /** |
@@ -999,7 +999,7 @@ discard block |
||
999 | 999 | |
1000 | 1000 | $header = pack('vv', $record, $length); |
1001 | 1001 | $data = pack('vCC', $ixfe, $BuiltIn, $iLevel); |
1002 | - $this->append($header.$data); |
|
1002 | + $this->append($header . $data); |
|
1003 | 1003 | } |
1004 | 1004 | |
1005 | 1005 | /** |
@@ -1016,8 +1016,8 @@ discard block |
||
1016 | 1016 | $length = 2 + strlen($numberFormatString); // Number of bytes to follow |
1017 | 1017 | |
1018 | 1018 | $header = pack('vv', $record, $length); |
1019 | - $data = pack('v', $ifmt).$numberFormatString; |
|
1020 | - $this->append($header.$data); |
|
1019 | + $data = pack('v', $ifmt) . $numberFormatString; |
|
1020 | + $this->append($header . $data); |
|
1021 | 1021 | } |
1022 | 1022 | |
1023 | 1023 | /** |
@@ -1034,7 +1034,7 @@ discard block |
||
1034 | 1034 | |
1035 | 1035 | $header = pack('vv', $record, $length); |
1036 | 1036 | $data = pack('v', $f1904); |
1037 | - $this->append($header.$data); |
|
1037 | + $this->append($header . $data); |
|
1038 | 1038 | } |
1039 | 1039 | |
1040 | 1040 | /** |
@@ -1056,7 +1056,7 @@ discard block |
||
1056 | 1056 | |
1057 | 1057 | $header = pack('vv', $record, $length); |
1058 | 1058 | $data = pack('v', $cxals); |
1059 | - $this->append($header.$data); |
|
1059 | + $this->append($header . $data); |
|
1060 | 1060 | } |
1061 | 1061 | |
1062 | 1062 | /** |
@@ -1078,7 +1078,7 @@ discard block |
||
1078 | 1078 | |
1079 | 1079 | $header = pack('vv', $record, $length); |
1080 | 1080 | $data = pack('CC', $cch, $rgch); |
1081 | - $this->append($header.$data.$sheetname); |
|
1081 | + $this->append($header . $data . $sheetname); |
|
1082 | 1082 | } |
1083 | 1083 | |
1084 | 1084 | /** |
@@ -1140,7 +1140,7 @@ discard block |
||
1140 | 1140 | $data .= pack('v', $rowmax); |
1141 | 1141 | $data .= pack('C', $colmin); |
1142 | 1142 | $data .= pack('C', $colmax); |
1143 | - $this->append($header.$data); |
|
1143 | + $this->append($header . $data); |
|
1144 | 1144 | } |
1145 | 1145 | |
1146 | 1146 | /** |
@@ -1223,7 +1223,7 @@ discard block |
||
1223 | 1223 | $data .= pack('C', 0xff); |
1224 | 1224 | // End of data |
1225 | 1225 | $data .= pack('C', 0x10); |
1226 | - $this->append($header.$data); |
|
1226 | + $this->append($header . $data); |
|
1227 | 1227 | } |
1228 | 1228 | |
1229 | 1229 | /** |
@@ -1240,7 +1240,7 @@ discard block |
||
1240 | 1240 | /* using the same country code always for simplicity */ |
1241 | 1241 | $data = pack('vv', $this->countryCode, $this->countryCode); |
1242 | 1242 | |
1243 | - return $this->writeData($header.$data); |
|
1243 | + return $this->writeData($header . $data); |
|
1244 | 1244 | } |
1245 | 1245 | |
1246 | 1246 | /** |
@@ -1258,7 +1258,7 @@ discard block |
||
1258 | 1258 | // by inspection of real Excel files, MS Office Excel 2007 writes this |
1259 | 1259 | $data = pack('VV', 0x000001C1, 0x00001E667); |
1260 | 1260 | |
1261 | - return $this->writeData($header.$data); |
|
1261 | + return $this->writeData($header . $data); |
|
1262 | 1262 | } |
1263 | 1263 | |
1264 | 1264 | /** |
@@ -1281,7 +1281,7 @@ discard block |
||
1281 | 1281 | } |
1282 | 1282 | |
1283 | 1283 | $header = pack('vvv', $record, $length, $ccv); |
1284 | - $this->append($header.$data); |
|
1284 | + $this->append($header . $data); |
|
1285 | 1285 | } |
1286 | 1286 | |
1287 | 1287 | /** |
@@ -1401,7 +1401,7 @@ discard block |
||
1401 | 1401 | $record = ($i == 0) ? 0x00FC : 0x003C; |
1402 | 1402 | |
1403 | 1403 | $header = pack('vv', $record, strlen($recordData)); |
1404 | - $data = $header.$recordData; |
|
1404 | + $data = $header . $recordData; |
|
1405 | 1405 | |
1406 | 1406 | $chunk .= $this->writeData($data); |
1407 | 1407 | } |
@@ -1423,7 +1423,7 @@ discard block |
||
1423 | 1423 | $length = strlen($data); |
1424 | 1424 | $header = pack('vv', $record, $length); |
1425 | 1425 | |
1426 | - return $this->writeData($header.$data); |
|
1426 | + return $this->writeData($header . $data); |
|
1427 | 1427 | } else { |
1428 | 1428 | return ''; |
1429 | 1429 | } |