@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | $rangeStart[1] : $rangeEnd[1] - $yMax + $y; |
328 | 328 | |
329 | 329 | // build range for region |
330 | - $range = $colStart.$rowStart.':'.$colEnd.$rowEnd; |
|
330 | + $range = $colStart . $rowStart . ':' . $colEnd . $rowEnd; |
|
331 | 331 | |
332 | 332 | // retrieve relevant style array for region |
333 | 333 | $regionStyles = $pStyles; |
@@ -630,14 +630,14 @@ discard block |
||
630 | 630 | } |
631 | 631 | |
632 | 632 | return md5( |
633 | - $this->fill->getHashCode(). |
|
634 | - $this->font->getHashCode(). |
|
635 | - $this->borders->getHashCode(). |
|
636 | - $this->alignment->getHashCode(). |
|
637 | - $this->numberFormat->getHashCode(). |
|
638 | - $hashConditionals. |
|
639 | - $this->protection->getHashCode(). |
|
640 | - ($this->quotePrefix ? 't' : 'f'). |
|
633 | + $this->fill->getHashCode() . |
|
634 | + $this->font->getHashCode() . |
|
635 | + $this->borders->getHashCode() . |
|
636 | + $this->alignment->getHashCode() . |
|
637 | + $this->numberFormat->getHashCode() . |
|
638 | + $hashConditionals . |
|
639 | + $this->protection->getHashCode() . |
|
640 | + ($this->quotePrefix ? 't' : 'f') . |
|
641 | 641 | __CLASS__ |
642 | 642 | ); |
643 | 643 | } |
@@ -61,10 +61,10 @@ |
||
61 | 61 | $includePath = str_replace('\\', '/', get_include_path()); |
62 | 62 | $rendererPath = str_replace('\\', '/', $pdfLibraryPath); |
63 | 63 | if (strpos($rendererPath, $includePath) === false) { |
64 | - set_include_path(get_include_path().PATH_SEPARATOR.$pdfLibraryPath); |
|
64 | + set_include_path(get_include_path() . PATH_SEPARATOR . $pdfLibraryPath); |
|
65 | 65 | } |
66 | 66 | |
67 | - $rendererName = '\\PhpOffice\\PhpSpreadsheet\\Writer\\PDF\\'.$pdfLibraryName; |
|
67 | + $rendererName = '\\PhpOffice\\PhpSpreadsheet\\Writer\\PDF\\' . $pdfLibraryName; |
|
68 | 68 | $this->renderer = new $rendererName($spreadsheet); |
69 | 69 | } |
70 | 70 |
@@ -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(); |