@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | Settings::getLibXmlLoaderOptions() |
117 | 117 | ); |
118 | 118 | } catch (\Exception $e) { |
119 | - throw new Exception('Cannot load invalid XML file: ' . $pFilename, 0, $e); |
|
119 | + throw new Exception('Cannot load invalid XML file: '.$pFilename, 0, $e); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | return $xml; |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | { |
136 | 136 | File::assertFile($pFilename); |
137 | 137 | if (!$this->canRead($pFilename)) { |
138 | - throw new Exception($pFilename . ' is an Invalid Spreadsheet file.'); |
|
138 | + throw new Exception($pFilename.' is an Invalid Spreadsheet file.'); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | $worksheetNames = []; |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | { |
309 | 309 | File::assertFile($pFilename); |
310 | 310 | if (!$this->canRead($pFilename)) { |
311 | - throw new Exception($pFilename . ' is an Invalid Spreadsheet file.'); |
|
311 | + throw new Exception($pFilename.' is an Invalid Spreadsheet file.'); |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | $xml = $this->trySimpleXMLLoadString($pFilename); |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | if (isset($cell_ss['Index'])) { |
460 | 460 | $columnID = Coordinate::stringFromColumnIndex((int) $cell_ss['Index']); |
461 | 461 | } |
462 | - $cellRange = $columnID . $rowID; |
|
462 | + $cellRange = $columnID.$rowID; |
|
463 | 463 | |
464 | 464 | if ($this->getReadFilter() !== null) { |
465 | 465 | if (!$this->getReadFilter()->readCell($columnID, $rowID, $worksheetName)) { |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | if (isset($cell_ss['MergeDown'])) { |
484 | 484 | $rowTo = $rowTo + $cell_ss['MergeDown']; |
485 | 485 | } |
486 | - $cellRange .= ':' . $columnTo . $rowTo; |
|
486 | + $cellRange .= ':'.$columnTo.$rowTo; |
|
487 | 487 | $spreadsheet->getActiveSheet()->mergeCells($cellRange); |
488 | 488 | } |
489 | 489 | |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | if ($columnReference[0] == '[') { |
586 | 586 | $columnReference = $columnNumber + trim($columnReference, '[]'); |
587 | 587 | } |
588 | - $A1CellReference = Coordinate::stringFromColumnIndex($columnReference) . $rowReference; |
|
588 | + $A1CellReference = Coordinate::stringFromColumnIndex($columnReference).$rowReference; |
|
589 | 589 | $value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0])); |
590 | 590 | } |
591 | 591 | } |
@@ -596,9 +596,9 @@ discard block |
||
596 | 596 | $cellDataFormula = implode('"', $temp); |
597 | 597 | } |
598 | 598 | |
599 | - $spreadsheet->getActiveSheet()->getCell($columnID . $rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue), $type); |
|
599 | + $spreadsheet->getActiveSheet()->getCell($columnID.$rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue), $type); |
|
600 | 600 | if ($hasCalculatedValue) { |
601 | - $spreadsheet->getActiveSheet()->getCell($columnID . $rowID)->setCalculatedValue($cellValue); |
|
601 | + $spreadsheet->getActiveSheet()->getCell($columnID.$rowID)->setCalculatedValue($cellValue); |
|
602 | 602 | } |
603 | 603 | $cellIsSet = $rowHasData = true; |
604 | 604 | } |
@@ -611,14 +611,14 @@ discard block |
||
611 | 611 | } |
612 | 612 | $node = $cell->Comment->Data->asXML(); |
613 | 613 | $annotation = strip_tags($node); |
614 | - $spreadsheet->getActiveSheet()->getComment($columnID . $rowID)->setAuthor(self::convertStringEncoding($author, $this->charSet))->setText($this->parseRichText($annotation)); |
|
614 | + $spreadsheet->getActiveSheet()->getComment($columnID.$rowID)->setAuthor(self::convertStringEncoding($author, $this->charSet))->setText($this->parseRichText($annotation)); |
|
615 | 615 | } |
616 | 616 | |
617 | 617 | if (($cellIsSet) && (isset($cell_ss['StyleID']))) { |
618 | 618 | $style = (string) $cell_ss['StyleID']; |
619 | 619 | if ((isset($this->styles[$style])) && (!empty($this->styles[$style]))) { |
620 | - if (!$spreadsheet->getActiveSheet()->cellExists($columnID . $rowID)) { |
|
621 | - $spreadsheet->getActiveSheet()->getCell($columnID . $rowID)->setValue(null); |
|
620 | + if (!$spreadsheet->getActiveSheet()->cellExists($columnID.$rowID)) { |
|
621 | + $spreadsheet->getActiveSheet()->getCell($columnID.$rowID)->setValue(null); |
|
622 | 622 | } |
623 | 623 | $spreadsheet->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->styles[$style]); |
624 | 624 | } |
@@ -121,7 +121,7 @@ |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | $this->worksheet->freezePane( |
124 | - Coordinate::stringFromColumnIndex($xSplit + 1) . ($ySplit + 1), |
|
124 | + Coordinate::stringFromColumnIndex($xSplit + 1).($ySplit + 1), |
|
125 | 125 | $topLeftCell |
126 | 126 | ); |
127 | 127 | } |
@@ -141,7 +141,7 @@ |
||
141 | 141 | foreach ($xmlSheet->colBreaks->brk as $brk) { |
142 | 142 | if ($brk['man']) { |
143 | 143 | $worksheet->setBreak( |
144 | - Coordinate::stringFromColumnIndex(((int) $brk['id']) + 1) . '1', |
|
144 | + Coordinate::stringFromColumnIndex(((int) $brk['id']) + 1).'1', |
|
145 | 145 | Worksheet::BREAK_COLUMN |
146 | 146 | ); |
147 | 147 | } |
@@ -42,11 +42,11 @@ |
||
42 | 42 | if (isset($linkRel['id'])) { |
43 | 43 | $hyperlinkUrl = $this->hyperlinks[(string) $linkRel['id']]; |
44 | 44 | if (isset($hyperlink['location'])) { |
45 | - $hyperlinkUrl .= '#' . (string) $hyperlink['location']; |
|
45 | + $hyperlinkUrl .= '#'.(string) $hyperlink['location']; |
|
46 | 46 | } |
47 | 47 | $cell->getHyperlink()->setUrl($hyperlinkUrl); |
48 | 48 | } elseif (isset($hyperlink['location'])) { |
49 | - $cell->getHyperlink()->setUrl('sheet://' . (string) $hyperlink['location']); |
|
49 | + $cell->getHyperlink()->setUrl('sheet://'.(string) $hyperlink['location']); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | // Tooltip |
@@ -231,7 +231,7 @@ |
||
231 | 231 | $returnColour = Color::changeBrightness($returnColour, $tintAdjust); |
232 | 232 | } |
233 | 233 | |
234 | - return 'FF' . $returnColour; |
|
234 | + return 'FF'.$returnColour; |
|
235 | 235 | } |
236 | 236 | } |
237 | 237 |
@@ -154,7 +154,7 @@ |
||
154 | 154 | // Open file |
155 | 155 | $this->fileHandle = fopen($pFilename, 'r'); |
156 | 156 | if ($this->fileHandle === false) { |
157 | - throw new Exception('Could not open file ' . $pFilename . ' for reading.'); |
|
157 | + throw new Exception('Could not open file '.$pFilename.' for reading.'); |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | //~ http://schemas.openxmlformats.org/package/2006/relationships" |
167 | 167 | $relsWorkbook = simplexml_load_string( |
168 | 168 | $this->securityScanner->scan( |
169 | - $this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel['Target']) . '.rels') |
|
169 | + $this->getFromZipArchive($zip, "$dir/_rels/".basename($rel['Target']).'.rels') |
|
170 | 170 | ), |
171 | 171 | 'SimpleXMLElement', |
172 | 172 | Settings::getLibXmlLoaderOptions() |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $xml = new XMLReader(); |
206 | 206 | $xml->xml( |
207 | 207 | $this->securityScanner->scanFile( |
208 | - 'zip://' . File::realpath($pFilename) . '#' . "$dir/$fileWorksheet" |
|
208 | + 'zip://'.File::realpath($pFilename).'#'."$dir/$fileWorksheet" |
|
209 | 209 | ), |
210 | 210 | null, |
211 | 211 | Settings::getLibXmlLoaderOptions() |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | $dir = dirname($rel['Target']); |
422 | 422 | //~ http://schemas.openxmlformats.org/package/2006/relationships" |
423 | 423 | $relsWorkbook = simplexml_load_string( |
424 | - $this->securityScanner->scan($this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel['Target']) . '.rels')), |
|
424 | + $this->securityScanner->scan($this->getFromZipArchive($zip, "$dir/_rels/".basename($rel['Target']).'.rels')), |
|
425 | 425 | 'SimpleXMLElement', |
426 | 426 | Settings::getLibXmlLoaderOptions() |
427 | 427 | ); |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | foreach ($row->c as $c) { |
656 | 656 | $r = (string) $c['r']; |
657 | 657 | if ($r == '') { |
658 | - $r = Coordinate::stringFromColumnIndex($rowIndex) . $cIndex; |
|
658 | + $r = Coordinate::stringFromColumnIndex($rowIndex).$cIndex; |
|
659 | 659 | } |
660 | 660 | $cellDataType = (string) $c['t']; |
661 | 661 | $value = null; |
@@ -765,7 +765,7 @@ discard block |
||
765 | 765 | $aKeys = ['sheet', 'objects', 'scenarios', 'formatCells', 'formatColumns', 'formatRows', 'insertColumns', 'insertRows', 'insertHyperlinks', 'deleteColumns', 'deleteRows', 'selectLockedCells', 'sort', 'autoFilter', 'pivotTables', 'selectUnlockedCells']; |
766 | 766 | if (!$this->readDataOnly && $xmlSheet && $xmlSheet->sheetProtection) { |
767 | 767 | foreach ($aKeys as $key) { |
768 | - $method = 'set' . ucfirst($key); |
|
768 | + $method = 'set'.ucfirst($key); |
|
769 | 769 | $docSheet->getProtection()->$method(self::boolean((string) $xmlSheet->sheetProtection[$key])); |
770 | 770 | } |
771 | 771 | } |
@@ -814,7 +814,7 @@ discard block |
||
814 | 814 | if (!$this->readDataOnly) { |
815 | 815 | $hyperlinkReader = new Hyperlinks($docSheet); |
816 | 816 | // Locate hyperlink relations |
817 | - $relationsFileName = dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels'; |
|
817 | + $relationsFileName = dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels'; |
|
818 | 818 | if ($zip->locateName($relationsFileName)) { |
819 | 819 | //~ http://schemas.openxmlformats.org/package/2006/relationships" |
820 | 820 | $relsWorksheet = simplexml_load_string( |
@@ -838,11 +838,11 @@ discard block |
||
838 | 838 | $vmlComments = []; |
839 | 839 | if (!$this->readDataOnly) { |
840 | 840 | // Locate comment relations |
841 | - if ($zip->locateName(dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')) { |
|
841 | + if ($zip->locateName(dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels')) { |
|
842 | 842 | //~ http://schemas.openxmlformats.org/package/2006/relationships" |
843 | 843 | $relsWorksheet = simplexml_load_string( |
844 | 844 | $this->securityScanner->scan( |
845 | - $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels') |
|
845 | + $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels') |
|
846 | 846 | ), |
847 | 847 | 'SimpleXMLElement', |
848 | 848 | Settings::getLibXmlLoaderOptions() |
@@ -860,7 +860,7 @@ discard block |
||
860 | 860 | // Loop through comments |
861 | 861 | foreach ($comments as $relName => $relPath) { |
862 | 862 | // Load comments file |
863 | - $relPath = File::realpath(dirname("$dir/$fileWorksheet") . '/' . $relPath); |
|
863 | + $relPath = File::realpath(dirname("$dir/$fileWorksheet").'/'.$relPath); |
|
864 | 864 | $commentsFile = simplexml_load_string( |
865 | 865 | $this->securityScanner->scan($this->getFromZipArchive($zip, $relPath)), |
866 | 866 | 'SimpleXMLElement', |
@@ -890,7 +890,7 @@ discard block |
||
890 | 890 | // Loop through VML comments |
891 | 891 | foreach ($vmlComments as $relName => $relPath) { |
892 | 892 | // Load VML comments file |
893 | - $relPath = File::realpath(dirname("$dir/$fileWorksheet") . '/' . $relPath); |
|
893 | + $relPath = File::realpath(dirname("$dir/$fileWorksheet").'/'.$relPath); |
|
894 | 894 | |
895 | 895 | try { |
896 | 896 | $vmlCommentsFile = simplexml_load_string( |
@@ -979,11 +979,11 @@ discard block |
||
979 | 979 | |
980 | 980 | // Header/footer images |
981 | 981 | if ($xmlSheet && $xmlSheet->legacyDrawingHF && !$this->readDataOnly) { |
982 | - if ($zip->locateName(dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')) { |
|
982 | + if ($zip->locateName(dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels')) { |
|
983 | 983 | //~ http://schemas.openxmlformats.org/package/2006/relationships" |
984 | 984 | $relsWorksheet = simplexml_load_string( |
985 | 985 | $this->securityScanner->scan( |
986 | - $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels') |
|
986 | + $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels') |
|
987 | 987 | ), |
988 | 988 | 'SimpleXMLElement', |
989 | 989 | Settings::getLibXmlLoaderOptions() |
@@ -1001,7 +1001,7 @@ discard block |
||
1001 | 1001 | //~ http://schemas.openxmlformats.org/package/2006/relationships" |
1002 | 1002 | $relsVML = simplexml_load_string( |
1003 | 1003 | $this->securityScanner->scan( |
1004 | - $this->getFromZipArchive($zip, dirname($vmlRelationship) . '/_rels/' . basename($vmlRelationship) . '.rels') |
|
1004 | + $this->getFromZipArchive($zip, dirname($vmlRelationship).'/_rels/'.basename($vmlRelationship).'.rels') |
|
1005 | 1005 | ), |
1006 | 1006 | 'SimpleXMLElement', |
1007 | 1007 | Settings::getLibXmlLoaderOptions() |
@@ -1042,7 +1042,7 @@ discard block |
||
1042 | 1042 | $hfImages[(string) $shape['id']]->setName((string) $imageData['title']); |
1043 | 1043 | } |
1044 | 1044 | |
1045 | - $hfImages[(string) $shape['id']]->setPath('zip://' . File::realpath($pFilename) . '#' . $drawings[(string) $imageData['relid']], false); |
|
1045 | + $hfImages[(string) $shape['id']]->setPath('zip://'.File::realpath($pFilename).'#'.$drawings[(string) $imageData['relid']], false); |
|
1046 | 1046 | $hfImages[(string) $shape['id']]->setResizeProportional(false); |
1047 | 1047 | $hfImages[(string) $shape['id']]->setWidth($style['width']); |
1048 | 1048 | $hfImages[(string) $shape['id']]->setHeight($style['height']); |
@@ -1060,11 +1060,11 @@ discard block |
||
1060 | 1060 | } |
1061 | 1061 | |
1062 | 1062 | // TODO: Autoshapes from twoCellAnchors! |
1063 | - if ($zip->locateName(dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')) { |
|
1063 | + if ($zip->locateName(dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels')) { |
|
1064 | 1064 | //~ http://schemas.openxmlformats.org/package/2006/relationships" |
1065 | 1065 | $relsWorksheet = simplexml_load_string( |
1066 | 1066 | $this->securityScanner->scan( |
1067 | - $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels') |
|
1067 | + $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels') |
|
1068 | 1068 | ), |
1069 | 1069 | 'SimpleXMLElement', |
1070 | 1070 | Settings::getLibXmlLoaderOptions() |
@@ -1083,7 +1083,7 @@ discard block |
||
1083 | 1083 | //~ http://schemas.openxmlformats.org/package/2006/relationships" |
1084 | 1084 | $relsDrawing = simplexml_load_string( |
1085 | 1085 | $this->securityScanner->scan( |
1086 | - $this->getFromZipArchive($zip, dirname($fileDrawing) . '/_rels/' . basename($fileDrawing) . '.rels') |
|
1086 | + $this->getFromZipArchive($zip, dirname($fileDrawing).'/_rels/'.basename($fileDrawing).'.rels') |
|
1087 | 1087 | ), |
1088 | 1088 | 'SimpleXMLElement', |
1089 | 1089 | Settings::getLibXmlLoaderOptions() |
@@ -1130,14 +1130,14 @@ discard block |
||
1130 | 1130 | $objDrawing->setName((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), 'name')); |
1131 | 1131 | $objDrawing->setDescription((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), 'descr')); |
1132 | 1132 | $objDrawing->setPath( |
1133 | - 'zip://' . File::realpath($pFilename) . '#' . |
|
1133 | + 'zip://'.File::realpath($pFilename).'#'. |
|
1134 | 1134 | $images[(string) self::getArrayItem( |
1135 | 1135 | $blip->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'), |
1136 | 1136 | 'embed' |
1137 | 1137 | )], |
1138 | 1138 | false |
1139 | 1139 | ); |
1140 | - $objDrawing->setCoordinates(Coordinate::stringFromColumnIndex(((string) $oneCellAnchor->from->col) + 1) . ($oneCellAnchor->from->row + 1)); |
|
1140 | + $objDrawing->setCoordinates(Coordinate::stringFromColumnIndex(((string) $oneCellAnchor->from->col) + 1).($oneCellAnchor->from->row + 1)); |
|
1141 | 1141 | $objDrawing->setOffsetX(Drawing::EMUToPixels($oneCellAnchor->from->colOff)); |
1142 | 1142 | $objDrawing->setOffsetY(Drawing::EMUToPixels($oneCellAnchor->from->rowOff)); |
1143 | 1143 | $objDrawing->setResizeProportional(false); |
@@ -1163,7 +1163,7 @@ discard block |
||
1163 | 1163 | $objDrawing->setWorksheet($docSheet); |
1164 | 1164 | } else { |
1165 | 1165 | // ? Can charts be positioned with a oneCellAnchor ? |
1166 | - $coordinates = Coordinate::stringFromColumnIndex(((string) $oneCellAnchor->from->col) + 1) . ($oneCellAnchor->from->row + 1); |
|
1166 | + $coordinates = Coordinate::stringFromColumnIndex(((string) $oneCellAnchor->from->col) + 1).($oneCellAnchor->from->row + 1); |
|
1167 | 1167 | $offsetX = Drawing::EMUToPixels($oneCellAnchor->from->colOff); |
1168 | 1168 | $offsetY = Drawing::EMUToPixels($oneCellAnchor->from->rowOff); |
1169 | 1169 | $width = Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), 'cx')); |
@@ -1182,14 +1182,14 @@ discard block |
||
1182 | 1182 | $objDrawing->setName((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), 'name')); |
1183 | 1183 | $objDrawing->setDescription((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), 'descr')); |
1184 | 1184 | $objDrawing->setPath( |
1185 | - 'zip://' . File::realpath($pFilename) . '#' . |
|
1185 | + 'zip://'.File::realpath($pFilename).'#'. |
|
1186 | 1186 | $images[(string) self::getArrayItem( |
1187 | 1187 | $blip->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'), |
1188 | 1188 | 'embed' |
1189 | 1189 | )], |
1190 | 1190 | false |
1191 | 1191 | ); |
1192 | - $objDrawing->setCoordinates(Coordinate::stringFromColumnIndex(((string) $twoCellAnchor->from->col) + 1) . ($twoCellAnchor->from->row + 1)); |
|
1192 | + $objDrawing->setCoordinates(Coordinate::stringFromColumnIndex(((string) $twoCellAnchor->from->col) + 1).($twoCellAnchor->from->row + 1)); |
|
1193 | 1193 | $objDrawing->setOffsetX(Drawing::EMUToPixels($twoCellAnchor->from->colOff)); |
1194 | 1194 | $objDrawing->setOffsetY(Drawing::EMUToPixels($twoCellAnchor->from->rowOff)); |
1195 | 1195 | $objDrawing->setResizeProportional(false); |
@@ -1215,10 +1215,10 @@ discard block |
||
1215 | 1215 | |
1216 | 1216 | $objDrawing->setWorksheet($docSheet); |
1217 | 1217 | } elseif (($this->includeCharts) && ($twoCellAnchor->graphicFrame)) { |
1218 | - $fromCoordinate = Coordinate::stringFromColumnIndex(((string) $twoCellAnchor->from->col) + 1) . ($twoCellAnchor->from->row + 1); |
|
1218 | + $fromCoordinate = Coordinate::stringFromColumnIndex(((string) $twoCellAnchor->from->col) + 1).($twoCellAnchor->from->row + 1); |
|
1219 | 1219 | $fromOffsetX = Drawing::EMUToPixels($twoCellAnchor->from->colOff); |
1220 | 1220 | $fromOffsetY = Drawing::EMUToPixels($twoCellAnchor->from->rowOff); |
1221 | - $toCoordinate = Coordinate::stringFromColumnIndex(((string) $twoCellAnchor->to->col) + 1) . ($twoCellAnchor->to->row + 1); |
|
1221 | + $toCoordinate = Coordinate::stringFromColumnIndex(((string) $twoCellAnchor->to->col) + 1).($twoCellAnchor->to->row + 1); |
|
1222 | 1222 | $toOffsetX = Drawing::EMUToPixels($twoCellAnchor->to->colOff); |
1223 | 1223 | $toOffsetY = Drawing::EMUToPixels($twoCellAnchor->to->rowOff); |
1224 | 1224 | $graphic = $twoCellAnchor->graphicFrame->children('http://schemas.openxmlformats.org/drawingml/2006/main')->graphic; |
@@ -1226,7 +1226,7 @@ discard block |
||
1226 | 1226 | $chartRef = $graphic->graphicData->children('http://schemas.openxmlformats.org/drawingml/2006/chart')->chart; |
1227 | 1227 | $thisChart = (string) $chartRef->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'); |
1228 | 1228 | |
1229 | - $chartDetails[$docSheet->getTitle() . '!' . $thisChart] = [ |
|
1229 | + $chartDetails[$docSheet->getTitle().'!'.$thisChart] = [ |
|
1230 | 1230 | 'fromCoordinate' => $fromCoordinate, |
1231 | 1231 | 'fromOffsetX' => $fromOffsetX, |
1232 | 1232 | 'fromOffsetY' => $fromOffsetY, |
@@ -1280,7 +1280,7 @@ discard block |
||
1280 | 1280 | // Extract range |
1281 | 1281 | $extractedRange = (string) $definedName; |
1282 | 1282 | if (($spos = strpos($extractedRange, '!')) !== false) { |
1283 | - $extractedRange = substr($extractedRange, 0, $spos) . str_replace('$', '', substr($extractedRange, $spos)); |
|
1283 | + $extractedRange = substr($extractedRange, 0, $spos).str_replace('$', '', substr($extractedRange, $spos)); |
|
1284 | 1284 | } else { |
1285 | 1285 | $extractedRange = str_replace('$', '', $extractedRange); |
1286 | 1286 | } |
@@ -1331,7 +1331,7 @@ discard block |
||
1331 | 1331 | foreach ($rangeSets as $rangeSet) { |
1332 | 1332 | [$sheetName, $rangeSet] = Worksheet::extractSheetTitle($rangeSet, true); |
1333 | 1333 | if (strpos($rangeSet, ':') === false) { |
1334 | - $rangeSet = $rangeSet . ':' . $rangeSet; |
|
1334 | + $rangeSet = $rangeSet.':'.$rangeSet; |
|
1335 | 1335 | } |
1336 | 1336 | $newRangeSets[] = str_replace('$', '', $rangeSet); |
1337 | 1337 | } |
@@ -1355,7 +1355,7 @@ discard block |
||
1355 | 1355 | // Extract range |
1356 | 1356 | $extractedRange = (string) $definedName; |
1357 | 1357 | if (($spos = strpos($extractedRange, '!')) !== false) { |
1358 | - $extractedRange = substr($extractedRange, 0, $spos) . str_replace('$', '', substr($extractedRange, $spos)); |
|
1358 | + $extractedRange = substr($extractedRange, 0, $spos).str_replace('$', '', substr($extractedRange, $spos)); |
|
1359 | 1359 | } else { |
1360 | 1360 | $extractedRange = str_replace('$', '', $extractedRange); |
1361 | 1361 | } |
@@ -1510,7 +1510,7 @@ discard block |
||
1510 | 1510 | $objChart = Chart::readChart($chartElements, basename($chartEntryRef, '.xml')); |
1511 | 1511 | |
1512 | 1512 | if (isset($charts[$chartEntryRef])) { |
1513 | - $chartPositionRef = $charts[$chartEntryRef]['sheet'] . '!' . $charts[$chartEntryRef]['id']; |
|
1513 | + $chartPositionRef = $charts[$chartEntryRef]['sheet'].'!'.$charts[$chartEntryRef]['id']; |
|
1514 | 1514 | if (isset($chartDetails[$chartPositionRef])) { |
1515 | 1515 | $excel->getSheetByName($charts[$chartEntryRef]['sheet'])->addChart($objChart); |
1516 | 1516 | $objChart->setWorksheet($excel->getSheetByName($charts[$chartEntryRef]['sheet'])); |
@@ -1552,7 +1552,7 @@ discard block |
||
1552 | 1552 | $returnColour = Color::changeBrightness($returnColour, $tintAdjust); |
1553 | 1553 | } |
1554 | 1554 | |
1555 | - return 'FF' . $returnColour; |
|
1555 | + return 'FF'.$returnColour; |
|
1556 | 1556 | } |
1557 | 1557 | } |
1558 | 1558 | |
@@ -1781,7 +1781,7 @@ discard block |
||
1781 | 1781 | $customUIImagesNames = []; |
1782 | 1782 | $customUIImagesBinaries = []; |
1783 | 1783 | // something like customUI/_rels/customUI.xml.rels |
1784 | - $pathRels = $baseDir . '/_rels/' . $nameCustomUI . '.rels'; |
|
1784 | + $pathRels = $baseDir.'/_rels/'.$nameCustomUI.'.rels'; |
|
1785 | 1785 | $dataRels = $this->getFromZipArchive($zip, $pathRels); |
1786 | 1786 | if ($dataRels) { |
1787 | 1787 | // exists and not empty if the ribbon have some pictures (other than internal MSO) |
@@ -1796,7 +1796,7 @@ discard block |
||
1796 | 1796 | if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image') { |
1797 | 1797 | // an image ? |
1798 | 1798 | $customUIImagesNames[(string) $ele['Id']] = (string) $ele['Target']; |
1799 | - $customUIImagesBinaries[(string) $ele['Target']] = $this->getFromZipArchive($zip, $baseDir . '/' . (string) $ele['Target']); |
|
1799 | + $customUIImagesBinaries[(string) $ele['Target']] = $this->getFromZipArchive($zip, $baseDir.'/'.(string) $ele['Target']); |
|
1800 | 1800 | } |
1801 | 1801 | } |
1802 | 1802 | } |
@@ -1821,7 +1821,7 @@ discard block |
||
1821 | 1821 | |
1822 | 1822 | private static function dirAdd($base, $add) |
1823 | 1823 | { |
1824 | - return preg_replace('~[^/]+/\.\./~', '', dirname($base) . "/$add"); |
|
1824 | + return preg_replace('~[^/]+/\.\./~', '', dirname($base)."/$add"); |
|
1825 | 1825 | } |
1826 | 1826 | |
1827 | 1827 | private static function toCSSArray($style) |
@@ -1922,14 +1922,14 @@ discard block |
||
1922 | 1922 | |
1923 | 1923 | private function readFormControlProperties(Spreadsheet $excel, ZipArchive $zip, $dir, $fileWorksheet, $docSheet, array &$unparsedLoadedData) |
1924 | 1924 | { |
1925 | - if (!$zip->locateName(dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')) { |
|
1925 | + if (!$zip->locateName(dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels')) { |
|
1926 | 1926 | return; |
1927 | 1927 | } |
1928 | 1928 | |
1929 | 1929 | //~ http://schemas.openxmlformats.org/package/2006/relationships" |
1930 | 1930 | $relsWorksheet = simplexml_load_string( |
1931 | 1931 | $this->securityScanner->scan( |
1932 | - $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels') |
|
1932 | + $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels') |
|
1933 | 1933 | ), |
1934 | 1934 | 'SimpleXMLElement', |
1935 | 1935 | Settings::getLibXmlLoaderOptions() |
@@ -1954,14 +1954,14 @@ discard block |
||
1954 | 1954 | |
1955 | 1955 | private function readPrinterSettings(Spreadsheet $excel, ZipArchive $zip, $dir, $fileWorksheet, $docSheet, array &$unparsedLoadedData) |
1956 | 1956 | { |
1957 | - if (!$zip->locateName(dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')) { |
|
1957 | + if (!$zip->locateName(dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels')) { |
|
1958 | 1958 | return; |
1959 | 1959 | } |
1960 | 1960 | |
1961 | 1961 | //~ http://schemas.openxmlformats.org/package/2006/relationships" |
1962 | 1962 | $relsWorksheet = simplexml_load_string( |
1963 | 1963 | $this->securityScanner->scan( |
1964 | - $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels') |
|
1964 | + $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet").'/_rels/'.basename($fileWorksheet).'.rels') |
|
1965 | 1965 | ), |
1966 | 1966 | 'SimpleXMLElement', |
1967 | 1967 | Settings::getLibXmlLoaderOptions() |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | |
207 | 207 | $meanSquareDeviations[$delimiter] = array_reduce( |
208 | 208 | $series, |
209 | - function ($sum, $value) use ($median) { |
|
209 | + function($sum, $value) use ($median) { |
|
210 | 210 | return $sum + pow($value - $median, 2); |
211 | 211 | } |
212 | 212 | ) / count($series); |
@@ -251,16 +251,16 @@ discard block |
||
251 | 251 | } |
252 | 252 | |
253 | 253 | // Add the new line to the line passed in |
254 | - $line = $line . $newLine; |
|
254 | + $line = $line.$newLine; |
|
255 | 255 | |
256 | 256 | // Drop everything that is enclosed to avoid counting false positives in enclosures |
257 | - $enclosure = '(?<!' . preg_quote($this->escapeCharacter, '/') . ')' |
|
257 | + $enclosure = '(?<!'.preg_quote($this->escapeCharacter, '/').')' |
|
258 | 258 | . preg_quote($this->enclosure, '/'); |
259 | - $line = preg_replace('/(' . $enclosure . '.*' . $enclosure . ')/Us', '', $line); |
|
259 | + $line = preg_replace('/('.$enclosure.'.*'.$enclosure.')/Us', '', $line); |
|
260 | 260 | |
261 | 261 | // See if we have any enclosures left in the line |
262 | 262 | // if we still have an enclosure then we need to read the next line as well |
263 | - if (preg_match('/(' . $enclosure . ')/', $line) > 0) { |
|
263 | + if (preg_match('/('.$enclosure.')/', $line) > 0) { |
|
264 | 264 | $line = $this->getNextLine($line); |
265 | 265 | } |
266 | 266 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | { |
281 | 281 | // Open file |
282 | 282 | if (!$this->canRead($pFilename)) { |
283 | - throw new Exception($pFilename . ' is an Invalid Spreadsheet file.'); |
|
283 | + throw new Exception($pFilename.' is an Invalid Spreadsheet file.'); |
|
284 | 284 | } |
285 | 285 | $this->openFile($pFilename); |
286 | 286 | $fileHandle = $this->fileHandle; |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | |
348 | 348 | // Open file |
349 | 349 | if (!$this->canRead($pFilename)) { |
350 | - throw new Exception($pFilename . ' is an Invalid Spreadsheet file.'); |
|
350 | + throw new Exception($pFilename.' is an Invalid Spreadsheet file.'); |
|
351 | 351 | } |
352 | 352 | $this->openFile($pFilename); |
353 | 353 | $fileHandle = $this->fileHandle; |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | } |
381 | 381 | |
382 | 382 | // Set cell value |
383 | - $sheet->getCell($columnLetter . $currentRow)->setValue($rowDatum); |
|
383 | + $sheet->getCell($columnLetter.$currentRow)->setValue($rowDatum); |
|
384 | 384 | } |
385 | 385 | ++$columnLetter; |
386 | 386 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $data = fread($fh, 2); |
65 | 65 | fclose($fh); |
66 | 66 | |
67 | - return $data == chr(0x1F) . chr(0x8B); |
|
67 | + return $data == chr(0x1F).chr(0x8B); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | File::assertFile($pFilename); |
80 | 80 | |
81 | 81 | $xml = new XMLReader(); |
82 | - $xml->xml($this->securityScanner->scanFile('compress.zlib://' . realpath($pFilename)), null, Settings::getLibXmlLoaderOptions()); |
|
82 | + $xml->xml($this->securityScanner->scanFile('compress.zlib://'.realpath($pFilename)), null, Settings::getLibXmlLoaderOptions()); |
|
83 | 83 | $xml->setParserProperty(2, true); |
84 | 84 | |
85 | 85 | $worksheetNames = []; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | File::assertFile($pFilename); |
109 | 109 | |
110 | 110 | $xml = new XMLReader(); |
111 | - $xml->xml($this->securityScanner->scanFile('compress.zlib://' . realpath($pFilename)), null, Settings::getLibXmlLoaderOptions()); |
|
111 | + $xml->xml($this->securityScanner->scanFile('compress.zlib://'.realpath($pFilename)), null, Settings::getLibXmlLoaderOptions()); |
|
112 | 112 | $xml->setParserProperty(2, true); |
113 | 113 | |
114 | 114 | $worksheetInfo = []; |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | case '80': // Array |
458 | 458 | } |
459 | 459 | } |
460 | - $spreadsheet->getActiveSheet()->getCell($column . $row)->setValueExplicit($cell, $type); |
|
460 | + $spreadsheet->getActiveSheet()->getCell($column.$row)->setValueExplicit($cell, $type); |
|
461 | 461 | } |
462 | 462 | |
463 | 463 | if ((!$this->readDataOnly) && (isset($sheet->Objects))) { |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | $endColumn = Coordinate::stringFromColumnIndex($endColumn + 1); |
481 | 481 | $endRow = ($styleAttributes['endRow'] > $maxRow) ? $maxRow : $styleAttributes['endRow']; |
482 | 482 | $endRow += 1; |
483 | - $cellRange = $startColumn . $startRow . ':' . $endColumn . $endRow; |
|
483 | + $cellRange = $startColumn.$startRow.':'.$endColumn.$endRow; |
|
484 | 484 | |
485 | 485 | $styleAttributes = $styleRegion->Style->attributes(); |
486 | 486 | |
@@ -884,6 +884,6 @@ discard block |
||
884 | 884 | $gnmG = substr(str_pad($gnmG, 4, '0', STR_PAD_RIGHT), 0, 2); |
885 | 885 | $gnmB = substr(str_pad($gnmB, 4, '0', STR_PAD_RIGHT), 0, 2); |
886 | 886 | |
887 | - return $gnmR . $gnmG . $gnmB; |
|
887 | + return $gnmR.$gnmG.$gnmB; |
|
888 | 888 | } |
889 | 889 | } |