@@ -204,15 +204,15 @@ |
||
204 | 204 | |
205 | 205 | // v:shape |
206 | 206 | $objWriter->startElement('v:shape'); |
207 | - $objWriter->writeAttribute('id', '_x0000_s'.$id); |
|
207 | + $objWriter->writeAttribute('id', '_x0000_s' . $id); |
|
208 | 208 | $objWriter->writeAttribute('type', '#_x0000_t202'); |
209 | - $objWriter->writeAttribute('style', 'position:absolute;margin-left:'.$pComment->getMarginLeft().';margin-top:'.$pComment->getMarginTop().';width:'.$pComment->getWidth().';height:'.$pComment->getHeight().';z-index:1;visibility:'.($pComment->getVisible() ? 'visible' : 'hidden')); |
|
210 | - $objWriter->writeAttribute('fillcolor', '#'.$pComment->getFillColor()->getRGB()); |
|
209 | + $objWriter->writeAttribute('style', 'position:absolute;margin-left:' . $pComment->getMarginLeft() . ';margin-top:' . $pComment->getMarginTop() . ';width:' . $pComment->getWidth() . ';height:' . $pComment->getHeight() . ';z-index:1;visibility:' . ($pComment->getVisible() ? 'visible' : 'hidden')); |
|
210 | + $objWriter->writeAttribute('fillcolor', '#' . $pComment->getFillColor()->getRGB()); |
|
211 | 211 | $objWriter->writeAttribute('o:insetmode', 'auto'); |
212 | 212 | |
213 | 213 | // v:fill |
214 | 214 | $objWriter->startElement('v:fill'); |
215 | - $objWriter->writeAttribute('color2', '#'.$pComment->getFillColor()->getRGB()); |
|
215 | + $objWriter->writeAttribute('color2', '#' . $pComment->getFillColor()->getRGB()); |
|
216 | 216 | $objWriter->endElement(); |
217 | 217 | |
218 | 218 | // v:shadow |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | // Worksheets |
100 | 100 | $sheetCount = $spreadsheet->getSheetCount(); |
101 | 101 | for ($i = 0; $i < $sheetCount; ++$i) { |
102 | - $this->writeOverrideContentType($objWriter, '/xl/worksheets/sheet'.($i + 1).'.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml'); |
|
102 | + $this->writeOverrideContentType($objWriter, '/xl/worksheets/sheet' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml'); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | // Shared strings |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | |
115 | 115 | // We need a drawing relationship for the worksheet if we have either drawings or charts |
116 | 116 | if (($drawingCount > 0) || ($chartCount > 0)) { |
117 | - $this->writeOverrideContentType($objWriter, '/xl/drawings/drawing'.($i + 1).'.xml', 'application/vnd.openxmlformats-officedocument.drawing+xml'); |
|
117 | + $this->writeOverrideContentType($objWriter, '/xl/drawings/drawing' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.drawing+xml'); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | // If we have charts, then we need a chart relationship for every individual chart |
121 | 121 | if ($chartCount > 0) { |
122 | 122 | for ($c = 0; $c < $chartCount; ++$c) { |
123 | - $this->writeOverrideContentType($objWriter, '/xl/charts/chart'.$chart++.'.xml', 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml'); |
|
123 | + $this->writeOverrideContentType($objWriter, '/xl/charts/chart' . $chart++ . '.xml', 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml'); |
|
124 | 124 | } |
125 | 125 | } |
126 | 126 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | // Comments |
129 | 129 | for ($i = 0; $i < $sheetCount; ++$i) { |
130 | 130 | if (count($spreadsheet->getSheet($i)->getComments()) > 0) { |
131 | - $this->writeOverrideContentType($objWriter, '/xl/comments'.($i + 1).'.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml'); |
|
131 | + $this->writeOverrideContentType($objWriter, '/xl/comments' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml'); |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | // we need to write "Extension" but not already write for media content |
162 | 162 | $tabRibbonTypes = array_diff($spreadsheet->getRibbonBinObjects('types'), array_keys($aMediaContentTypes)); |
163 | 163 | foreach ($tabRibbonTypes as $aRibbonType) { |
164 | - $mimeType = 'image/.'.$aRibbonType; //we wrote $mimeType like customUI Editor |
|
164 | + $mimeType = 'image/.' . $aRibbonType; //we wrote $mimeType like customUI Editor |
|
165 | 165 | $this->writeDefaultContentType($objWriter, $aRibbonType, $mimeType); |
166 | 166 | } |
167 | 167 | } |
@@ -153,31 +153,31 @@ discard block |
||
153 | 153 | $elements = $pRichText->getRichTextElements(); |
154 | 154 | foreach ($elements as $element) { |
155 | 155 | // r |
156 | - $objWriter->startElement($prefix.'r'); |
|
156 | + $objWriter->startElement($prefix . 'r'); |
|
157 | 157 | |
158 | 158 | // rPr |
159 | 159 | if ($element instanceof \PhpOffice\PhpSpreadsheet\RichText\Run) { |
160 | 160 | // rPr |
161 | - $objWriter->startElement($prefix.'rPr'); |
|
161 | + $objWriter->startElement($prefix . 'rPr'); |
|
162 | 162 | |
163 | 163 | // rFont |
164 | - $objWriter->startElement($prefix.'rFont'); |
|
164 | + $objWriter->startElement($prefix . 'rFont'); |
|
165 | 165 | $objWriter->writeAttribute('val', $element->getFont()->getName()); |
166 | 166 | $objWriter->endElement(); |
167 | 167 | |
168 | 168 | // Bold |
169 | - $objWriter->startElement($prefix.'b'); |
|
169 | + $objWriter->startElement($prefix . 'b'); |
|
170 | 170 | $objWriter->writeAttribute('val', ($element->getFont()->getBold() ? 'true' : 'false')); |
171 | 171 | $objWriter->endElement(); |
172 | 172 | |
173 | 173 | // Italic |
174 | - $objWriter->startElement($prefix.'i'); |
|
174 | + $objWriter->startElement($prefix . 'i'); |
|
175 | 175 | $objWriter->writeAttribute('val', ($element->getFont()->getItalic() ? 'true' : 'false')); |
176 | 176 | $objWriter->endElement(); |
177 | 177 | |
178 | 178 | // Superscript / subscript |
179 | 179 | if ($element->getFont()->getSuperScript() || $element->getFont()->getSubScript()) { |
180 | - $objWriter->startElement($prefix.'vertAlign'); |
|
180 | + $objWriter->startElement($prefix . 'vertAlign'); |
|
181 | 181 | if ($element->getFont()->getSuperScript()) { |
182 | 182 | $objWriter->writeAttribute('val', 'superscript'); |
183 | 183 | } elseif ($element->getFont()->getSubScript()) { |
@@ -187,22 +187,22 @@ discard block |
||
187 | 187 | } |
188 | 188 | |
189 | 189 | // Strikethrough |
190 | - $objWriter->startElement($prefix.'strike'); |
|
190 | + $objWriter->startElement($prefix . 'strike'); |
|
191 | 191 | $objWriter->writeAttribute('val', ($element->getFont()->getStrikethrough() ? 'true' : 'false')); |
192 | 192 | $objWriter->endElement(); |
193 | 193 | |
194 | 194 | // Color |
195 | - $objWriter->startElement($prefix.'color'); |
|
195 | + $objWriter->startElement($prefix . 'color'); |
|
196 | 196 | $objWriter->writeAttribute('rgb', $element->getFont()->getColor()->getARGB()); |
197 | 197 | $objWriter->endElement(); |
198 | 198 | |
199 | 199 | // Size |
200 | - $objWriter->startElement($prefix.'sz'); |
|
200 | + $objWriter->startElement($prefix . 'sz'); |
|
201 | 201 | $objWriter->writeAttribute('val', $element->getFont()->getSize()); |
202 | 202 | $objWriter->endElement(); |
203 | 203 | |
204 | 204 | // Underline |
205 | - $objWriter->startElement($prefix.'u'); |
|
205 | + $objWriter->startElement($prefix . 'u'); |
|
206 | 206 | $objWriter->writeAttribute('val', $element->getFont()->getUnderline()); |
207 | 207 | $objWriter->endElement(); |
208 | 208 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | } |
211 | 211 | |
212 | 212 | // t |
213 | - $objWriter->startElement($prefix.'t'); |
|
213 | + $objWriter->startElement($prefix . 't'); |
|
214 | 214 | $objWriter->writeAttribute('xml:space', 'preserve'); |
215 | 215 | $objWriter->writeRawData(\PhpOffice\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($element->getText())); |
216 | 216 | $objWriter->endElement(); |
@@ -244,10 +244,10 @@ discard block |
||
244 | 244 | $elements = $pRichText->getRichTextElements(); |
245 | 245 | foreach ($elements as $element) { |
246 | 246 | // r |
247 | - $objWriter->startElement($prefix.'r'); |
|
247 | + $objWriter->startElement($prefix . 'r'); |
|
248 | 248 | |
249 | 249 | // rPr |
250 | - $objWriter->startElement($prefix.'rPr'); |
|
250 | + $objWriter->startElement($prefix . 'rPr'); |
|
251 | 251 | |
252 | 252 | // Bold |
253 | 253 | $objWriter->writeAttribute('b', ($element->getFont()->getBold() ? 1 : 0)); |
@@ -268,14 +268,14 @@ discard block |
||
268 | 268 | $objWriter->writeAttribute('strike', ($element->getFont()->getStrikethrough() ? 'sngStrike' : 'noStrike')); |
269 | 269 | |
270 | 270 | // rFont |
271 | - $objWriter->startElement($prefix.'latin'); |
|
271 | + $objWriter->startElement($prefix . 'latin'); |
|
272 | 272 | $objWriter->writeAttribute('typeface', $element->getFont()->getName()); |
273 | 273 | $objWriter->endElement(); |
274 | 274 | |
275 | 275 | $objWriter->endElement(); |
276 | 276 | |
277 | 277 | // t |
278 | - $objWriter->startElement($prefix.'t'); |
|
278 | + $objWriter->startElement($prefix . 't'); |
|
279 | 279 | $objWriter->writeRawData(\PhpOffice\PhpSpreadsheet\Shared\StringHelper::controlCharacterPHP2OOXML($element->getText())); |
280 | 280 | $objWriter->endElement(); |
281 | 281 |
@@ -515,19 +515,19 @@ discard block |
||
515 | 515 | if ($conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT |
516 | 516 | && $conditional->getOperatorType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_CONTAINSTEXT |
517 | 517 | && !is_null($conditional->getText())) { |
518 | - $objWriter->writeElement('formula', 'NOT(ISERROR(SEARCH("'.$conditional->getText().'",'.$cellCoordinate.')))'); |
|
518 | + $objWriter->writeElement('formula', 'NOT(ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . ')))'); |
|
519 | 519 | } elseif ($conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT |
520 | 520 | && $conditional->getOperatorType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_BEGINSWITH |
521 | 521 | && !is_null($conditional->getText())) { |
522 | - $objWriter->writeElement('formula', 'LEFT('.$cellCoordinate.','.strlen($conditional->getText()).')="'.$conditional->getText().'"'); |
|
522 | + $objWriter->writeElement('formula', 'LEFT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"'); |
|
523 | 523 | } elseif ($conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT |
524 | 524 | && $conditional->getOperatorType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_ENDSWITH |
525 | 525 | && !is_null($conditional->getText())) { |
526 | - $objWriter->writeElement('formula', 'RIGHT('.$cellCoordinate.','.strlen($conditional->getText()).')="'.$conditional->getText().'"'); |
|
526 | + $objWriter->writeElement('formula', 'RIGHT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"'); |
|
527 | 527 | } elseif ($conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT |
528 | 528 | && $conditional->getOperatorType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_NOTCONTAINS |
529 | 529 | && !is_null($conditional->getText())) { |
530 | - $objWriter->writeElement('formula', 'ISERROR(SEARCH("'.$conditional->getText().'",'.$cellCoordinate.'))'); |
|
530 | + $objWriter->writeElement('formula', 'ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . '))'); |
|
531 | 531 | } elseif ($conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CELLIS |
532 | 532 | || $conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT |
533 | 533 | || $conditional->getConditionType() == \PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_EXPRESSION) { |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | |
638 | 638 | $objWriter->writeAttribute('ref', $coordinate); |
639 | 639 | if (!$hyperlink->isInternal()) { |
640 | - $objWriter->writeAttribute('r:id', 'rId_hyperlink_'.$relationId); |
|
640 | + $objWriter->writeAttribute('r:id', 'rId_hyperlink_' . $relationId); |
|
641 | 641 | ++$relationId; |
642 | 642 | } else { |
643 | 643 | $objWriter->writeAttribute('location', str_replace('sheet://', '', $hyperlink->getUrl())); |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | foreach ($pSheet->getProtectedCells() as $protectedCell => $passwordHash) { |
673 | 673 | // protectedRange |
674 | 674 | $objWriter->startElement('protectedRange'); |
675 | - $objWriter->writeAttribute('name', 'p'.md5($protectedCell)); |
|
675 | + $objWriter->writeAttribute('name', 'p' . md5($protectedCell)); |
|
676 | 676 | $objWriter->writeAttribute('sqref', $protectedCell); |
677 | 677 | if (!empty($passwordHash)) { |
678 | 678 | $objWriter->writeAttribute('password', $passwordHash); |
@@ -1015,7 +1015,7 @@ discard block |
||
1015 | 1015 | // Start a new row |
1016 | 1016 | $objWriter->startElement('row'); |
1017 | 1017 | $objWriter->writeAttribute('r', $currentRow); |
1018 | - $objWriter->writeAttribute('spans', '1:'.$colCount); |
|
1018 | + $objWriter->writeAttribute('spans', '1:' . $colCount); |
|
1019 | 1019 | |
1020 | 1020 | // Row dimensions |
1021 | 1021 | if ($rowDimension->getRowHeight() >= 0) { |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | return $worksheet; |
734 | 734 | } |
735 | 735 | |
736 | - throw new Exception('Workbook does not contain sheet:'.$pValue); |
|
736 | + throw new Exception('Workbook does not contain sheet:' . $pValue); |
|
737 | 737 | } |
738 | 738 | |
739 | 739 | /** |
@@ -812,7 +812,7 @@ discard block |
||
812 | 812 | $this->namedRanges[$namedRange->getName()] = $namedRange; |
813 | 813 | } else { |
814 | 814 | // local scope |
815 | - $this->namedRanges[$namedRange->getScope()->getTitle().'!'.$namedRange->getName()] = $namedRange; |
|
815 | + $this->namedRanges[$namedRange->getScope()->getTitle() . '!' . $namedRange->getName()] = $namedRange; |
|
816 | 816 | } |
817 | 817 | |
818 | 818 | return true; |
@@ -837,8 +837,8 @@ discard block |
||
837 | 837 | } |
838 | 838 | |
839 | 839 | // then look for local defined name (has priority over global defined name if both names exist) |
840 | - if (($pSheet !== null) && isset($this->namedRanges[$pSheet->getTitle().'!'.$namedRange])) { |
|
841 | - $returnValue = $this->namedRanges[$pSheet->getTitle().'!'.$namedRange]; |
|
840 | + if (($pSheet !== null) && isset($this->namedRanges[$pSheet->getTitle() . '!' . $namedRange])) { |
|
841 | + $returnValue = $this->namedRanges[$pSheet->getTitle() . '!' . $namedRange]; |
|
842 | 842 | } |
843 | 843 | } |
844 | 844 | |
@@ -860,8 +860,8 @@ discard block |
||
860 | 860 | unset($this->namedRanges[$namedRange]); |
861 | 861 | } |
862 | 862 | } else { |
863 | - if (isset($this->namedRanges[$pSheet->getTitle().'!'.$namedRange])) { |
|
864 | - unset($this->namedRanges[$pSheet->getTitle().'!'.$namedRange]); |
|
863 | + if (isset($this->namedRanges[$pSheet->getTitle() . '!' . $namedRange])) { |
|
864 | + unset($this->namedRanges[$pSheet->getTitle() . '!' . $namedRange]); |
|
865 | 865 | } |
866 | 866 | } |
867 | 867 |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | // Check for number in scientific format |
63 | - if (preg_match('/^'.\PhpOffice\PhpSpreadsheet\Calculation::CALCULATION_REGEXP_NUMBER.'$/', $value)) { |
|
63 | + if (preg_match('/^' . \PhpOffice\PhpSpreadsheet\Calculation::CALCULATION_REGEXP_NUMBER . '$/', $value)) { |
|
64 | 64 | $cell->setValueExplicit((float) $value, DataType::TYPE_NUMERIC); |
65 | 65 | |
66 | 66 | return true; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $currencyCode = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::getCurrencyCode(); |
110 | 110 | $decimalSeparator = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::getDecimalSeparator(); |
111 | 111 | $thousandsSeparator = \PhpOffice\PhpSpreadsheet\Shared\StringHelper::getThousandsSeparator(); |
112 | - if (preg_match('/^'.preg_quote($currencyCode).' *(\d{1,3}('.preg_quote($thousandsSeparator).'\d{3})*|(\d+))('.preg_quote($decimalSeparator).'\d{2})?$/', $value)) { |
|
112 | + if (preg_match('/^' . preg_quote($currencyCode) . ' *(\d{1,3}(' . preg_quote($thousandsSeparator) . '\d{3})*|(\d+))(' . preg_quote($decimalSeparator) . '\d{2})?$/', $value)) { |
|
113 | 113 | // Convert value to number |
114 | 114 | $value = (float) trim(str_replace([$currencyCode, $thousandsSeparator, $decimalSeparator], ['', '', '.'], $value)); |
115 | 115 | $cell->setValueExplicit($value, DataType::TYPE_NUMERIC); |
@@ -471,19 +471,19 @@ |
||
471 | 471 | public function getHashCode() |
472 | 472 | { |
473 | 473 | return md5( |
474 | - $this->formula1. |
|
475 | - $this->formula2. |
|
476 | - $this->type = self::TYPE_NONE. |
|
477 | - $this->errorStyle = self::STYLE_STOP. |
|
478 | - $this->operator. |
|
479 | - ($this->allowBlank ? 't' : 'f'). |
|
480 | - ($this->showDropDown ? 't' : 'f'). |
|
481 | - ($this->showInputMessage ? 't' : 'f'). |
|
482 | - ($this->showErrorMessage ? 't' : 'f'). |
|
483 | - $this->errorTitle. |
|
484 | - $this->error. |
|
485 | - $this->promptTitle. |
|
486 | - $this->prompt. |
|
474 | + $this->formula1 . |
|
475 | + $this->formula2 . |
|
476 | + $this->type = self::TYPE_NONE . |
|
477 | + $this->errorStyle = self::STYLE_STOP . |
|
478 | + $this->operator . |
|
479 | + ($this->allowBlank ? 't' : 'f') . |
|
480 | + ($this->showDropDown ? 't' : 'f') . |
|
481 | + ($this->showInputMessage ? 't' : 'f') . |
|
482 | + ($this->showErrorMessage ? 't' : 'f') . |
|
483 | + $this->errorTitle . |
|
484 | + $this->error . |
|
485 | + $this->promptTitle . |
|
486 | + $this->prompt . |
|
487 | 487 | __CLASS__ |
488 | 488 | ); |
489 | 489 | } |
@@ -121,8 +121,8 @@ |
||
121 | 121 | public function getHashCode() |
122 | 122 | { |
123 | 123 | return md5( |
124 | - $this->url. |
|
125 | - $this->tooltip. |
|
124 | + $this->url . |
|
125 | + $this->tooltip . |
|
126 | 126 | __CLASS__ |
127 | 127 | ); |
128 | 128 | } |
@@ -126,8 +126,8 @@ |
||
126 | 126 | $message, |
127 | 127 | PHP_EOL; |
128 | 128 | } |
129 | - $this->debugLog[] = $cellReference. |
|
130 | - ($this->cellStack->count() > 0 ? ' => ' : ''). |
|
129 | + $this->debugLog[] = $cellReference . |
|
130 | + ($this->cellStack->count() > 0 ? ' => ' : '') . |
|
131 | 131 | $message; |
132 | 132 | } |
133 | 133 | } |