@@ -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 | } |
@@ -1178,7 +1178,7 @@ discard block |
||
1178 | 1178 | [$column, $row] = Coordinate::coordinateFromString($cell); |
1179 | 1179 | if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($column, $row, $this->phpSheet->getTitle())) { |
1180 | 1180 | $formula = $this->getFormulaFromStructure($this->sharedFormulas[$baseCell], $cell); |
1181 | - $this->phpSheet->getCell($cell)->setValueExplicit('=' . $formula, DataType::TYPE_FORMULA); |
|
1181 | + $this->phpSheet->getCell($cell)->setValueExplicit('='.$formula, DataType::TYPE_FORMULA); |
|
1182 | 1182 | } |
1183 | 1183 | } |
1184 | 1184 | } |
@@ -1217,7 +1217,7 @@ discard block |
||
1217 | 1217 | $sheetName = trim($explodes[0], "'"); |
1218 | 1218 | if (count($explodes) == 2) { |
1219 | 1219 | if (strpos($explodes[1], ':') === false) { |
1220 | - $explodes[1] = $explodes[1] . ':' . $explodes[1]; |
|
1220 | + $explodes[1] = $explodes[1].':'.$explodes[1]; |
|
1221 | 1221 | } |
1222 | 1222 | $extractedRanges[] = str_replace('$', '', $explodes[1]); // C7:J66 |
1223 | 1223 | } |
@@ -1709,7 +1709,7 @@ discard block |
||
1709 | 1709 | // Concatenate this extension with the currently set comment for the cell |
1710 | 1710 | $comment = $this->phpSheet->getComment($cellAddress); |
1711 | 1711 | $commentText = $comment->getText()->getPlainText(); |
1712 | - $comment->setText($this->parseRichText($commentText . $noteText)); |
|
1712 | + $comment->setText($this->parseRichText($commentText.$noteText)); |
|
1713 | 1713 | } else { |
1714 | 1714 | // Set comment for the cell |
1715 | 1715 | $this->phpSheet->getComment($cellAddress)->setText($this->parseRichText($noteText)); |
@@ -1950,7 +1950,7 @@ discard block |
||
1950 | 1950 | $salt = $key->RC4($salt_data); |
1951 | 1951 | $hashedsalt = $key->RC4($hashedsalt_data); |
1952 | 1952 | |
1953 | - $salt .= "\x80" . str_repeat("\0", 47); |
|
1953 | + $salt .= "\x80".str_repeat("\0", 47); |
|
1954 | 1954 | $salt[56] = "\x80"; |
1955 | 1955 | |
1956 | 1956 | $md5->reset(); |
@@ -2921,7 +2921,7 @@ discard block |
||
2921 | 2921 | |
2922 | 2922 | // offset: var; size: $flen; formula data |
2923 | 2923 | $offset = 14 + $string['size']; |
2924 | - $formulaStructure = pack('v', $flen) . substr($recordData, $offset); |
|
2924 | + $formulaStructure = pack('v', $flen).substr($recordData, $offset); |
|
2925 | 2925 | |
2926 | 2926 | try { |
2927 | 2927 | $formula = $this->getFormulaFromStructure($formulaStructure); |
@@ -3090,7 +3090,7 @@ discard block |
||
3090 | 3090 | $newstr = ''; |
3091 | 3091 | $jMax = strlen($retstr); |
3092 | 3092 | for ($j = 0; $j < $jMax; ++$j) { |
3093 | - $newstr .= $retstr[$j] . chr(0); |
|
3093 | + $newstr .= $retstr[$j].chr(0); |
|
3094 | 3094 | } |
3095 | 3095 | $retstr = $newstr; |
3096 | 3096 | $len = min($charsLeft * 2, $limitpos - $pos); |
@@ -3736,7 +3736,7 @@ discard block |
||
3736 | 3736 | $rknum = self::getInt4d($recordData, 6); |
3737 | 3737 | $numValue = self::getIEEE754($rknum); |
3738 | 3738 | |
3739 | - $cell = $this->phpSheet->getCell($columnString . ($row + 1)); |
|
3739 | + $cell = $this->phpSheet->getCell($columnString.($row + 1)); |
|
3740 | 3740 | if (!$this->readDataOnly) { |
3741 | 3741 | // add style information |
3742 | 3742 | $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]); |
@@ -3813,13 +3813,13 @@ discard block |
||
3813 | 3813 | } |
3814 | 3814 | } |
3815 | 3815 | if ($this->readEmptyCells || trim($richText->getPlainText()) !== '') { |
3816 | - $cell = $this->phpSheet->getCell($columnString . ($row + 1)); |
|
3816 | + $cell = $this->phpSheet->getCell($columnString.($row + 1)); |
|
3817 | 3817 | $cell->setValueExplicit($richText, DataType::TYPE_STRING); |
3818 | 3818 | $emptyCell = false; |
3819 | 3819 | } |
3820 | 3820 | } else { |
3821 | 3821 | if ($this->readEmptyCells || trim($this->sst[$index]['value']) !== '') { |
3822 | - $cell = $this->phpSheet->getCell($columnString . ($row + 1)); |
|
3822 | + $cell = $this->phpSheet->getCell($columnString.($row + 1)); |
|
3823 | 3823 | $cell->setValueExplicit($this->sst[$index]['value'], DataType::TYPE_STRING); |
3824 | 3824 | $emptyCell = false; |
3825 | 3825 | } |
@@ -3871,7 +3871,7 @@ discard block |
||
3871 | 3871 | |
3872 | 3872 | // offset: var; size: 4; RK value |
3873 | 3873 | $numValue = self::getIEEE754(self::getInt4d($recordData, $offset + 2)); |
3874 | - $cell = $this->phpSheet->getCell($columnString . ($row + 1)); |
|
3874 | + $cell = $this->phpSheet->getCell($columnString.($row + 1)); |
|
3875 | 3875 | if (!$this->readDataOnly) { |
3876 | 3876 | // add style |
3877 | 3877 | $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]); |
@@ -3915,7 +3915,7 @@ discard block |
||
3915 | 3915 | |
3916 | 3916 | $numValue = self::extractNumber(substr($recordData, 6, 8)); |
3917 | 3917 | |
3918 | - $cell = $this->phpSheet->getCell($columnString . ($row + 1)); |
|
3918 | + $cell = $this->phpSheet->getCell($columnString.($row + 1)); |
|
3919 | 3919 | if (!$this->readDataOnly) { |
3920 | 3920 | // add cell style |
3921 | 3921 | $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]); |
@@ -3971,14 +3971,14 @@ discard block |
||
3971 | 3971 | // get the base cell, grab tExp token |
3972 | 3972 | $baseRow = self::getUInt2d($formulaStructure, 3); |
3973 | 3973 | $baseCol = self::getUInt2d($formulaStructure, 5); |
3974 | - $this->baseCell = Coordinate::stringFromColumnIndex($baseCol + 1) . ($baseRow + 1); |
|
3974 | + $this->baseCell = Coordinate::stringFromColumnIndex($baseCol + 1).($baseRow + 1); |
|
3975 | 3975 | } |
3976 | 3976 | |
3977 | 3977 | // Read cell? |
3978 | 3978 | if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { |
3979 | 3979 | if ($isPartOfSharedFormula) { |
3980 | 3980 | // formula is added to this cell after the sheet has been read |
3981 | - $this->sharedFormulaParts[$columnString . ($row + 1)] = $this->baseCell; |
|
3981 | + $this->sharedFormulaParts[$columnString.($row + 1)] = $this->baseCell; |
|
3982 | 3982 | } |
3983 | 3983 | |
3984 | 3984 | // offset: 16: size: 4; not used |
@@ -4023,7 +4023,7 @@ discard block |
||
4023 | 4023 | $value = self::extractNumber(substr($recordData, 6, 8)); |
4024 | 4024 | } |
4025 | 4025 | |
4026 | - $cell = $this->phpSheet->getCell($columnString . ($row + 1)); |
|
4026 | + $cell = $this->phpSheet->getCell($columnString.($row + 1)); |
|
4027 | 4027 | if (!$this->readDataOnly) { |
4028 | 4028 | // add cell style |
4029 | 4029 | $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]); |
@@ -4038,7 +4038,7 @@ discard block |
||
4038 | 4038 | throw new Exception('Not BIFF8. Can only read BIFF8 formulas'); |
4039 | 4039 | } |
4040 | 4040 | $formula = $this->getFormulaFromStructure($formulaStructure); // get formula in human language |
4041 | - $cell->setValueExplicit('=' . $formula, DataType::TYPE_FORMULA); |
|
4041 | + $cell->setValueExplicit('='.$formula, DataType::TYPE_FORMULA); |
|
4042 | 4042 | } catch (PhpSpreadsheetException $e) { |
4043 | 4043 | $cell->setValueExplicit($value, $dataType); |
4044 | 4044 | } |
@@ -4144,7 +4144,7 @@ discard block |
||
4144 | 4144 | // offset: 7; size: 1; 0=boolean; 1=error |
4145 | 4145 | $isError = ord($recordData[7]); |
4146 | 4146 | |
4147 | - $cell = $this->phpSheet->getCell($columnString . ($row + 1)); |
|
4147 | + $cell = $this->phpSheet->getCell($columnString.($row + 1)); |
|
4148 | 4148 | switch ($isError) { |
4149 | 4149 | case 0: // boolean |
4150 | 4150 | $value = (bool) $boolErr; |
@@ -4200,7 +4200,7 @@ discard block |
||
4200 | 4200 | // Read cell? |
4201 | 4201 | if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) { |
4202 | 4202 | $xfIndex = self::getUInt2d($recordData, 4 + 2 * $i); |
4203 | - $this->phpSheet->getCell($columnString . ($row + 1))->setXfIndex($this->mapCellXfIndex[$xfIndex]); |
|
4203 | + $this->phpSheet->getCell($columnString.($row + 1))->setXfIndex($this->mapCellXfIndex[$xfIndex]); |
|
4204 | 4204 | } |
4205 | 4205 | } |
4206 | 4206 | } |
@@ -4248,7 +4248,7 @@ discard block |
||
4248 | 4248 | $value = $string['value']; |
4249 | 4249 | } |
4250 | 4250 | if ($this->readEmptyCells || trim($value) !== '') { |
4251 | - $cell = $this->phpSheet->getCell($columnString . ($row + 1)); |
|
4251 | + $cell = $this->phpSheet->getCell($columnString.($row + 1)); |
|
4252 | 4252 | $cell->setValueExplicit($value, DataType::TYPE_STRING); |
4253 | 4253 | |
4254 | 4254 | if (!$this->readDataOnly) { |
@@ -4284,7 +4284,7 @@ discard block |
||
4284 | 4284 | |
4285 | 4285 | // add style information |
4286 | 4286 | if (!$this->readDataOnly && $this->readEmptyCells) { |
4287 | - $this->phpSheet->getCell($columnString . ($row + 1))->setXfIndex($this->mapCellXfIndex[$xfIndex]); |
|
4287 | + $this->phpSheet->getCell($columnString.($row + 1))->setXfIndex($this->mapCellXfIndex[$xfIndex]); |
|
4288 | 4288 | } |
4289 | 4289 | } |
4290 | 4290 | } |
@@ -4498,8 +4498,8 @@ discard block |
||
4498 | 4498 | |
4499 | 4499 | if ($this->frozen) { |
4500 | 4500 | // frozen panes |
4501 | - $cell = Coordinate::stringFromColumnIndex($px + 1) . ($py + 1); |
|
4502 | - $topLeftCell = Coordinate::stringFromColumnIndex($colLeft + 1) . ($rwTop + 1); |
|
4501 | + $cell = Coordinate::stringFromColumnIndex($px + 1).($py + 1); |
|
4502 | + $topLeftCell = Coordinate::stringFromColumnIndex($colLeft + 1).($rwTop + 1); |
|
4503 | 4503 | $this->phpSheet->freezePane($cell, $topLeftCell); |
4504 | 4504 | } |
4505 | 4505 | // unfrozen panes; split windows; not supported by PhpSpreadsheet core |
@@ -4945,7 +4945,7 @@ discard block |
||
4945 | 4945 | |
4946 | 4946 | // offset: var; size: $sz1; formula data for first condition (without size field) |
4947 | 4947 | $formula1 = substr($recordData, $offset, $sz1); |
4948 | - $formula1 = pack('v', $sz1) . $formula1; // prepend the length |
|
4948 | + $formula1 = pack('v', $sz1).$formula1; // prepend the length |
|
4949 | 4949 | try { |
4950 | 4950 | $formula1 = $this->getFormulaFromStructure($formula1); |
4951 | 4951 | |
@@ -4967,7 +4967,7 @@ discard block |
||
4967 | 4967 | |
4968 | 4968 | // offset: var; size: $sz2; formula data for second condition (without size field) |
4969 | 4969 | $formula2 = substr($recordData, $offset, $sz2); |
4970 | - $formula2 = pack('v', $sz2) . $formula2; // prepend the length |
|
4970 | + $formula2 = pack('v', $sz2).$formula2; // prepend the length |
|
4971 | 4971 | try { |
4972 | 4972 | $formula2 = $this->getFormulaFromStructure($formula2); |
4973 | 4973 | } catch (PhpSpreadsheetException $e) { |
@@ -5447,7 +5447,7 @@ discard block |
||
5447 | 5447 | $ops[] = array_pop($formulaStrings); |
5448 | 5448 | } |
5449 | 5449 | $ops = array_reverse($ops); |
5450 | - $formulaStrings[] = "$space1$space0{$token['data']['function']}(" . implode(',', $ops) . ')'; |
|
5450 | + $formulaStrings[] = "$space1$space0{$token['data']['function']}(".implode(',', $ops).')'; |
|
5451 | 5451 | unset($space0, $space1); |
5452 | 5452 | } else { |
5453 | 5453 | // add-in function |
@@ -5457,7 +5457,7 @@ discard block |
||
5457 | 5457 | } |
5458 | 5458 | $ops = array_reverse($ops); |
5459 | 5459 | $function = array_pop($formulaStrings); |
5460 | - $formulaStrings[] = "$space1$space0$function(" . implode(',', $ops) . ')'; |
|
5460 | + $formulaStrings[] = "$space1$space0$function(".implode(',', $ops).')'; |
|
5461 | 5461 | unset($space0, $space1); |
5462 | 5462 | } |
5463 | 5463 | |
@@ -5470,7 +5470,7 @@ discard block |
||
5470 | 5470 | break; |
5471 | 5471 | case 'tArray': // array constant |
5472 | 5472 | $constantArray = self::readBIFF8ConstantArray($additionalData); |
5473 | - $formulaStrings[] = $space1 . $space0 . $constantArray['value']; |
|
5473 | + $formulaStrings[] = $space1.$space0.$constantArray['value']; |
|
5474 | 5474 | $additionalData = substr($additionalData, $constantArray['size']); // bite of chunk of additional data |
5475 | 5475 | unset($space0, $space1); |
5476 | 5476 | |
@@ -7089,7 +7089,7 @@ discard block |
||
7089 | 7089 | break; |
7090 | 7090 | // Unknown cases // don't know how to deal with |
7091 | 7091 | default: |
7092 | - throw new Exception('Unrecognized token ' . sprintf('%02X', $id) . ' in formula'); |
|
7092 | + throw new Exception('Unrecognized token '.sprintf('%02X', $id).' in formula'); |
|
7093 | 7093 | |
7094 | 7094 | break; |
7095 | 7095 | } |
@@ -7121,14 +7121,14 @@ discard block |
||
7121 | 7121 | |
7122 | 7122 | // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) |
7123 | 7123 | if (!(0x4000 & self::getUInt2d($cellAddressStructure, 2))) { |
7124 | - $column = '$' . $column; |
|
7124 | + $column = '$'.$column; |
|
7125 | 7125 | } |
7126 | 7126 | // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) |
7127 | 7127 | if (!(0x8000 & self::getUInt2d($cellAddressStructure, 2))) { |
7128 | - $row = '$' . $row; |
|
7128 | + $row = '$'.$row; |
|
7129 | 7129 | } |
7130 | 7130 | |
7131 | - return $column . $row; |
|
7131 | + return $column.$row; |
|
7132 | 7132 | } |
7133 | 7133 | |
7134 | 7134 | /** |
@@ -7157,7 +7157,7 @@ discard block |
||
7157 | 7157 | $colIndex = 0x00FF & self::getUInt2d($cellAddressStructure, 2); |
7158 | 7158 | |
7159 | 7159 | $column = Coordinate::stringFromColumnIndex($colIndex + 1); |
7160 | - $column = '$' . $column; |
|
7160 | + $column = '$'.$column; |
|
7161 | 7161 | } else { |
7162 | 7162 | // offset: 2; size: 2; index to column or column offset + relative flags |
7163 | 7163 | // bit: 7-0; mask 0x00FF; column index |
@@ -7170,13 +7170,13 @@ discard block |
||
7170 | 7170 | |
7171 | 7171 | // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) |
7172 | 7172 | if (!(0x8000 & self::getUInt2d($cellAddressStructure, 2))) { |
7173 | - $row = '$' . $row; |
|
7173 | + $row = '$'.$row; |
|
7174 | 7174 | } else { |
7175 | 7175 | $rowIndex = ($rowIndex <= 32767) ? $rowIndex : $rowIndex - 65536; |
7176 | 7176 | $row = $baseRow + $rowIndex; |
7177 | 7177 | } |
7178 | 7178 | |
7179 | - return $column . $row; |
|
7179 | + return $column.$row; |
|
7180 | 7180 | } |
7181 | 7181 | |
7182 | 7182 | /** |
@@ -7288,12 +7288,12 @@ discard block |
||
7288 | 7288 | |
7289 | 7289 | // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) |
7290 | 7290 | if (!(0x4000 & self::getUInt2d($subData, 4))) { |
7291 | - $fc = '$' . $fc; |
|
7291 | + $fc = '$'.$fc; |
|
7292 | 7292 | } |
7293 | 7293 | |
7294 | 7294 | // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) |
7295 | 7295 | if (!(0x8000 & self::getUInt2d($subData, 4))) { |
7296 | - $fr = '$' . $fr; |
|
7296 | + $fr = '$'.$fr; |
|
7297 | 7297 | } |
7298 | 7298 | |
7299 | 7299 | // offset: 6; size: 2; index to last column or column offset + relative flags |
@@ -7303,12 +7303,12 @@ discard block |
||
7303 | 7303 | |
7304 | 7304 | // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) |
7305 | 7305 | if (!(0x4000 & self::getUInt2d($subData, 6))) { |
7306 | - $lc = '$' . $lc; |
|
7306 | + $lc = '$'.$lc; |
|
7307 | 7307 | } |
7308 | 7308 | |
7309 | 7309 | // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) |
7310 | 7310 | if (!(0x8000 & self::getUInt2d($subData, 6))) { |
7311 | - $lr = '$' . $lr; |
|
7311 | + $lr = '$'.$lr; |
|
7312 | 7312 | } |
7313 | 7313 | |
7314 | 7314 | return "$fc$fr:$lc$lr"; |
@@ -7345,7 +7345,7 @@ discard block |
||
7345 | 7345 | // bit: 7-0; mask 0x00FF; column index |
7346 | 7346 | $fcIndex = 0x00FF & self::getUInt2d($subData, 4); |
7347 | 7347 | $fc = Coordinate::stringFromColumnIndex($fcIndex + 1); |
7348 | - $fc = '$' . $fc; |
|
7348 | + $fc = '$'.$fc; |
|
7349 | 7349 | } else { |
7350 | 7350 | // column offset |
7351 | 7351 | // offset: 4; size: 2; first column with relative/absolute flags |
@@ -7361,7 +7361,7 @@ discard block |
||
7361 | 7361 | if (!(0x8000 & self::getUInt2d($subData, 4))) { |
7362 | 7362 | // absolute row index |
7363 | 7363 | $fr = $frIndex + 1; |
7364 | - $fr = '$' . $fr; |
|
7364 | + $fr = '$'.$fr; |
|
7365 | 7365 | } else { |
7366 | 7366 | // row offset |
7367 | 7367 | $frIndex = ($frIndex <= 32767) ? $frIndex : $frIndex - 65536; |
@@ -7375,7 +7375,7 @@ discard block |
||
7375 | 7375 | // bit: 7-0; mask 0x00FF; column index |
7376 | 7376 | $lcIndex = 0x00FF & self::getUInt2d($subData, 6); |
7377 | 7377 | $lc = Coordinate::stringFromColumnIndex($lcIndex + 1); |
7378 | - $lc = '$' . $lc; |
|
7378 | + $lc = '$'.$lc; |
|
7379 | 7379 | } else { |
7380 | 7380 | // column offset |
7381 | 7381 | // offset: 4; size: 2; first column with relative/absolute flags |
@@ -7391,7 +7391,7 @@ discard block |
||
7391 | 7391 | if (!(0x8000 & self::getUInt2d($subData, 6))) { |
7392 | 7392 | // absolute row index |
7393 | 7393 | $lr = $lrIndex + 1; |
7394 | - $lr = '$' . $lr; |
|
7394 | + $lr = '$'.$lr; |
|
7395 | 7395 | } else { |
7396 | 7396 | // row offset |
7397 | 7397 | $lrIndex = ($lrIndex <= 32767) ? $lrIndex : $lrIndex - 65536; |
@@ -7548,7 +7548,7 @@ discard block |
||
7548 | 7548 | } |
7549 | 7549 | $matrixChunks[] = implode(',', $items); // looks like e.g. '1,"hello"' |
7550 | 7550 | } |
7551 | - $matrix = '{' . implode(';', $matrixChunks) . '}'; |
|
7551 | + $matrix = '{'.implode(';', $matrixChunks).'}'; |
|
7552 | 7552 | |
7553 | 7553 | return [ |
7554 | 7554 | 'value' => $matrix, |
@@ -7585,7 +7585,7 @@ discard block |
||
7585 | 7585 | case 0x02: // string value |
7586 | 7586 | // offset: 1; size: var; Unicode string, 16-bit string length |
7587 | 7587 | $string = self::readUnicodeStringLong(substr($valueData, 1)); |
7588 | - $value = '"' . $string['value'] . '"'; |
|
7588 | + $value = '"'.$string['value'].'"'; |
|
7589 | 7589 | $size = 1 + $string['size']; |
7590 | 7590 | |
7591 | 7591 | break; |
@@ -7776,7 +7776,7 @@ discard block |
||
7776 | 7776 | */ |
7777 | 7777 | private static function UTF8toExcelDoubleQuoted($value) |
7778 | 7778 | { |
7779 | - return '"' . str_replace('"', '""', $value) . '"'; |
|
7779 | + return '"'.str_replace('"', '""', $value).'"'; |
|
7780 | 7780 | } |
7781 | 7781 | |
7782 | 7782 | /** |
@@ -7869,7 +7869,7 @@ discard block |
||
7869 | 7869 | $uncompressedString = ''; |
7870 | 7870 | $strLen = strlen($string); |
7871 | 7871 | for ($i = 0; $i < $strLen; ++$i) { |
7872 | - $uncompressedString .= $string[$i] . "\0"; |
|
7872 | + $uncompressedString .= $string[$i]."\0"; |
|
7873 | 7873 | } |
7874 | 7874 | |
7875 | 7875 | return $uncompressedString; |
@@ -7910,7 +7910,7 @@ discard block |
||
7910 | 7910 | */ |
7911 | 7911 | public static function getInt2d($data, $pos) |
7912 | 7912 | { |
7913 | - return unpack('s', $data[$pos] . $data[$pos + 1])[1]; |
|
7913 | + return unpack('s', $data[$pos].$data[$pos + 1])[1]; |
|
7914 | 7914 | } |
7915 | 7915 | |
7916 | 7916 | /** |
@@ -125,7 +125,7 @@ |
||
125 | 125 | $xml = $this->toUtf8($xml); |
126 | 126 | |
127 | 127 | // Don't rely purely on libxml_disable_entity_loader() |
128 | - $pattern = '/\\0?' . implode('\\0?', str_split($this->pattern)) . '\\0?/'; |
|
128 | + $pattern = '/\\0?'.implode('\\0?', str_split($this->pattern)).'\\0?/'; |
|
129 | 129 | |
130 | 130 | if (preg_match($pattern, $xml)) { |
131 | 131 | throw new Reader\Exception('Detected use of ENTITY in XML, spreadsheet file load() aborted to prevent XXE/XEE attacks'); |