@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | $aMediaContentTypes = array(); |
133 | 133 | $mediaCount = $this->getParentWriter()->getDrawingHashTable()->count(); |
134 | 134 | for ($i = 0; $i < $mediaCount; ++$i) { |
135 | - $extension = ''; |
|
136 | - $mimeType = ''; |
|
135 | + $extension = ''; |
|
136 | + $mimeType = ''; |
|
137 | 137 | |
138 | 138 | if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof \PHPExcel\Worksheet\Drawing) { |
139 | 139 | $extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getExtension()); |
@@ -155,9 +155,9 @@ discard block |
||
155 | 155 | if ($pPHPExcel->hasRibbonBinObjects()) { |
156 | 156 | // Some additional objects in the ribbon ? |
157 | 157 | // we need to write "Extension" but not already write for media content |
158 | - $tabRibbonTypes=array_diff($pPHPExcel->getRibbonBinObjects('types'), array_keys($aMediaContentTypes)); |
|
158 | + $tabRibbonTypes = array_diff($pPHPExcel->getRibbonBinObjects('types'), array_keys($aMediaContentTypes)); |
|
159 | 159 | foreach ($tabRibbonTypes as $aRibbonType) { |
160 | - $mimeType='image/.'.$aRibbonType;//we wrote $mimeType like customUI Editor |
|
160 | + $mimeType = 'image/.' . $aRibbonType; //we wrote $mimeType like customUI Editor |
|
161 | 161 | $this->writeDefaultContentType($objWriter, $aRibbonType, $mimeType); |
162 | 162 | } |
163 | 163 | } |
@@ -860,7 +860,7 @@ |
||
860 | 860 | private function writeColourScheme($objWriter) |
861 | 861 | { |
862 | 862 | foreach (self::$colourScheme as $colourName => $colourValue) { |
863 | - $objWriter->startElement('a:'.$colourName); |
|
863 | + $objWriter->startElement('a:' . $colourName); |
|
864 | 864 | |
865 | 865 | $objWriter->startElement('a:srgbClr'); |
866 | 866 | $objWriter->writeAttribute('val', $colourValue); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $objWriter->startElement('sheetPr'); |
152 | 152 | //$objWriter->writeAttribute('codeName', $pSheet->getTitle()); |
153 | 153 | if ($pSheet->getParent()->hasMacros()) {//if the workbook have macros, we need to have codeName for the sheet |
154 | - if ($pSheet->hasCodeName()==false) { |
|
154 | + if ($pSheet->hasCodeName() == false) { |
|
155 | 155 | $pSheet->setCodeName($pSheet->getTitle()); |
156 | 156 | } |
157 | 157 | $objWriter->writeAttribute('codeName', $pSheet->getCodeName()); |
@@ -333,8 +333,8 @@ discard block |
||
333 | 333 | } |
334 | 334 | |
335 | 335 | // Set Zero Height row |
336 | - if ((string)$pSheet->getDefaultRowDimension()->getZeroHeight() == '1' || |
|
337 | - strtolower((string)$pSheet->getDefaultRowDimension()->getZeroHeight()) == 'true') { |
|
336 | + if ((string) $pSheet->getDefaultRowDimension()->getZeroHeight() == '1' || |
|
337 | + strtolower((string) $pSheet->getDefaultRowDimension()->getZeroHeight()) == 'true') { |
|
338 | 338 | $objWriter->writeAttribute('zeroHeight', '1'); |
339 | 339 | } |
340 | 340 | |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | $outlineLevelRow = $dimension->getOutlineLevel(); |
351 | 351 | } |
352 | 352 | } |
353 | - $objWriter->writeAttribute('outlineLevelRow', (int)$outlineLevelRow); |
|
353 | + $objWriter->writeAttribute('outlineLevelRow', (int) $outlineLevelRow); |
|
354 | 354 | |
355 | 355 | // Outline level - column |
356 | 356 | $outlineLevelCol = 0; |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | $outlineLevelCol = $dimension->getOutlineLevel(); |
360 | 360 | } |
361 | 361 | } |
362 | - $objWriter->writeAttribute('outlineLevelCol', (int)$outlineLevelCol); |
|
362 | + $objWriter->writeAttribute('outlineLevelCol', (int) $outlineLevelCol); |
|
363 | 363 | |
364 | 364 | $objWriter->endElement(); |
365 | 365 | } |
@@ -569,10 +569,10 @@ discard block |
||
569 | 569 | $objWriter->writeAttribute('operator', $dv->getOperator()); |
570 | 570 | } |
571 | 571 | |
572 | - $objWriter->writeAttribute('allowBlank', ($dv->getAllowBlank() ? '1' : '0')); |
|
573 | - $objWriter->writeAttribute('showDropDown', (!$dv->getShowDropDown() ? '1' : '0')); |
|
574 | - $objWriter->writeAttribute('showInputMessage', ($dv->getShowInputMessage() ? '1' : '0')); |
|
575 | - $objWriter->writeAttribute('showErrorMessage', ($dv->getShowErrorMessage() ? '1' : '0')); |
|
572 | + $objWriter->writeAttribute('allowBlank', ($dv->getAllowBlank() ? '1' : '0')); |
|
573 | + $objWriter->writeAttribute('showDropDown', (!$dv->getShowDropDown() ? '1' : '0')); |
|
574 | + $objWriter->writeAttribute('showInputMessage', ($dv->getShowInputMessage() ? '1' : '0')); |
|
575 | + $objWriter->writeAttribute('showErrorMessage', ($dv->getShowErrorMessage() ? '1' : '0')); |
|
576 | 576 | |
577 | 577 | if ($dv->getErrorTitle() !== '') { |
578 | 578 | $objWriter->writeAttribute('errorTitle', $dv->getErrorTitle()); |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | // printOptions |
711 | 711 | $objWriter->startElement('printOptions'); |
712 | 712 | |
713 | - $objWriter->writeAttribute('gridLines', ($pSheet->getPrintGridlines() ? 'true': 'false')); |
|
713 | + $objWriter->writeAttribute('gridLines', ($pSheet->getPrintGridlines() ? 'true' : 'false')); |
|
714 | 714 | $objWriter->writeAttribute('gridLinesSet', 'true'); |
715 | 715 | |
716 | 716 | if ($pSheet->getPageSetup()->getHorizontalCentered()) { |
@@ -803,7 +803,7 @@ discard block |
||
803 | 803 | // Top 10 Filter Rule |
804 | 804 | $objWriter->writeAttribute('val', $rule->getValue()); |
805 | 805 | $objWriter->writeAttribute('percent', (($rule->getOperator() === \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT) ? '1' : '0')); |
806 | - $objWriter->writeAttribute('top', (($rule->getGrouping() === \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) ? '1': '0')); |
|
806 | + $objWriter->writeAttribute('top', (($rule->getGrouping() === \PHPExcel\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) ? '1' : '0')); |
|
807 | 807 | } else { |
808 | 808 | // Filter, DateGroupItem or CustomFilter |
809 | 809 | $objWriter->startElement($rule->getRuleType()); |
@@ -1082,8 +1082,7 @@ discard block |
||
1082 | 1082 | break; |
1083 | 1083 | case 'f': // Formula |
1084 | 1084 | $calculatedValue = ($this->getParentWriter()->getPreCalculateFormulas()) ? |
1085 | - $pCell->getCalculatedValue() : |
|
1086 | - $cellValue; |
|
1085 | + $pCell->getCalculatedValue() : $cellValue; |
|
1087 | 1086 | if (is_string($calculatedValue)) { |
1088 | 1087 | $objWriter->writeAttribute('t', 'str'); |
1089 | 1088 | } |
@@ -1095,7 +1094,7 @@ discard block |
||
1095 | 1094 | // Write data depending on its type |
1096 | 1095 | switch (strtolower($mappedType)) { |
1097 | 1096 | case 'inlinestr': // Inline string |
1098 | - if (! $cellValue instanceof \PHPExcel\RichText) { |
|
1097 | + if (!$cellValue instanceof \PHPExcel\RichText) { |
|
1099 | 1098 | $objWriter->writeElement('t', \PHPExcel\Shared\StringHelper::controlCharacterPHP2OOXML(htmlspecialchars($cellValue))); |
1100 | 1099 | } elseif ($cellValue instanceof \PHPExcel\RichText) { |
1101 | 1100 | $objWriter->startElement('is'); |
@@ -1105,7 +1104,7 @@ discard block |
||
1105 | 1104 | |
1106 | 1105 | break; |
1107 | 1106 | case 's': // String |
1108 | - if (! $cellValue instanceof \PHPExcel\RichText) { |
|
1107 | + if (!$cellValue instanceof \PHPExcel\RichText) { |
|
1109 | 1108 | if (isset($pFlippedStringTable[$cellValue])) { |
1110 | 1109 | $objWriter->writeElement('v', $pFlippedStringTable[$cellValue]); |
1111 | 1110 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | $fileHandle = parent::prepareForSave($pFilename); |
59 | 59 | |
60 | 60 | // Default PDF paper size |
61 | - $paperSize = 'LETTER'; // Letter (8.5 in. by 11 in.) |
|
61 | + $paperSize = 'LETTER'; // Letter (8.5 in. by 11 in.) |
|
62 | 62 | |
63 | 63 | // Check for paper size and page orientation |
64 | 64 | if (is_null($this->getSheetIndex())) { |
@@ -58,7 +58,7 @@ |
||
58 | 58 | * |
59 | 59 | * @var string |
60 | 60 | */ |
61 | - protected $_diskCachingDirectory = './'; |
|
61 | + protected $_diskCachingDirectory = './'; |
|
62 | 62 | |
63 | 63 | /** |
64 | 64 | * Write charts in workbook? |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | /** |
113 | 113 | * Set the Default timezone to use for dates |
114 | 114 | * |
115 | - * @param string|\DateTimeZone $timezone The timezone to set for all Excel datetimestamp to PHP DateTime Object conversions |
|
115 | + * @param string|\DateTimeZone $timeZone The timezone to set for all Excel datetimestamp to PHP DateTime Object conversions |
|
116 | 116 | * @return boolean Success or failure |
117 | 117 | * @throws \Exception |
118 | 118 | */ |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | /** |
142 | 142 | * Validate a timezone |
143 | 143 | * |
144 | - * @param string|\DateTimeZone $timezone The timezone to validate, either as a timezone string or object |
|
144 | + * @param string|\DateTimeZone $timeZone The timezone to validate, either as a timezone string or object |
|
145 | 145 | * @return \DateTimeZone The timezone as a timezone object |
146 | 146 | * @throws \Exception |
147 | 147 | */ |
@@ -158,8 +158,7 @@ discard block |
||
158 | 158 | /** |
159 | 159 | * Convert a MS serialized datetime value from Excel to a PHP Date/Time object |
160 | 160 | * |
161 | - * @param integer|float $dateValue Excel date/time value |
|
162 | - * @param \DateTimeZone|string|null $timezone The timezone to assume for the Excel timestamp, |
|
161 | + * @param \DateTimeZone|string|null $timeZone The timezone to assume for the Excel timestamp, |
|
163 | 162 | * if you don't want to treat it as a UTC value |
164 | 163 | * @return \DateTime PHP date/time object |
165 | 164 | * @throws \Exception |
@@ -189,8 +188,7 @@ discard block |
||
189 | 188 | /** |
190 | 189 | * Convert a MS serialized datetime value from Excel to a unix timestamp |
191 | 190 | * |
192 | - * @param integer|float $dateValue Excel date/time value |
|
193 | - * @return integer Unix timetamp for this date/time |
|
191 | + * @return string Unix timetamp for this date/time |
|
194 | 192 | * @throws \Exception |
195 | 193 | */ |
196 | 194 | public static function excelToTimestamp($excelTimestamp = 0, $timeZone = null) |
@@ -203,7 +201,7 @@ discard block |
||
203 | 201 | /** |
204 | 202 | * Convert a date from PHP to Excel |
205 | 203 | * |
206 | - * @param mixed $dateValue PHP serialized date/time or date object |
|
204 | + * @param integer $dateValue PHP serialized date/time or date object |
|
207 | 205 | * @param boolean $adjustToTimezone Flag indicating whether $dateValue should be treated as |
208 | 206 | * a UST timestamp, or adjusted to UST |
209 | 207 | * @param string $timezone The timezone for finding the adjustment from UST |
@@ -244,7 +242,7 @@ discard block |
||
244 | 242 | * @param integer $hours |
245 | 243 | * @param integer $minutes |
246 | 244 | * @param integer $seconds |
247 | - * @return integer Excel date/time value |
|
245 | + * @return double Excel date/time value |
|
248 | 246 | */ |
249 | 247 | public static function formattedPHPToExcel($year, $month, $day, $hours = 0, $minutes = 0, $seconds = 0) |
250 | 248 | { |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | class Date |
31 | 31 | { |
32 | 32 | /** constants */ |
33 | - const CALENDAR_WINDOWS_1900 = 1900; // Base date of 1st Jan 1900 = 1.0 |
|
34 | - const CALENDAR_MAC_1904 = 1904; // Base date of 2nd Jan 1904 = 1.0 |
|
33 | + const CALENDAR_WINDOWS_1900 = 1900; // Base date of 1st Jan 1900 = 1.0 |
|
34 | + const CALENDAR_MAC_1904 = 1904; // Base date of 2nd Jan 1904 = 1.0 |
|
35 | 35 | |
36 | 36 | /* |
37 | 37 | * Names of the months of the year, indexed by shortname |
@@ -216,8 +216,7 @@ discard block |
||
216 | 216 | date_default_timezone_set('UTC'); |
217 | 217 | |
218 | 218 | $timezoneAdjustment = ($adjustToTimezone) ? |
219 | - PHPExcel_Shared_TimeZone::getTimezoneAdjustment($timezone ? $timezone : $saveTimeZone, $dateValue) : |
|
220 | - 0; |
|
219 | + PHPExcel_Shared_TimeZone::getTimezoneAdjustment($timezone ? $timezone : $saveTimeZone, $dateValue) : 0; |
|
221 | 220 | |
222 | 221 | $retValue = false; |
223 | 222 | if ((is_object($dateValue)) && ($dateValue instanceof \DateTime)) { |
@@ -362,7 +361,7 @@ discard block |
||
362 | 361 | return false; |
363 | 362 | } |
364 | 363 | // Try checking for any of the date formatting characters that don't appear within square braces |
365 | - if (preg_match('/(^|\])[^\[]*['.self::$possibleDateFormatCharacters.']/i', $pFormatCode)) { |
|
364 | + if (preg_match('/(^|\])[^\[]*[' . self::$possibleDateFormatCharacters . ']/i', $pFormatCode)) { |
|
366 | 365 | // We might also have a format mask containing quoted strings... |
367 | 366 | // we don't want to test for any of our characters within the quoted blocks |
368 | 367 | if (strpos($pFormatCode, '"') !== false) { |
@@ -370,7 +369,7 @@ discard block |
||
370 | 369 | foreach (explode('"', $pFormatCode) as $subVal) { |
371 | 370 | // Only test in alternate array entries (the non-quoted blocks) |
372 | 371 | if (($segMatcher = !$segMatcher) && |
373 | - (preg_match('/(^|\])[^\[]*['.self::$possibleDateFormatCharacters.']/i', $subVal))) { |
|
372 | + (preg_match('/(^|\])[^\[]*[' . self::$possibleDateFormatCharacters . ']/i', $subVal))) { |
|
374 | 373 | return true; |
375 | 374 | } |
376 | 375 | } |
@@ -101,7 +101,7 @@ |
||
101 | 101 | /** |
102 | 102 | * Set Row Height |
103 | 103 | * |
104 | - * @param double $pValue |
|
104 | + * @param integer $pValue |
|
105 | 105 | * @return RowDimension |
106 | 106 | */ |
107 | 107 | public function setRowHeight($pValue = -1) |
@@ -32,7 +32,7 @@ |
||
32 | 32 | /** |
33 | 33 | * Write Thumbnails/thumbnail.png to PNG format |
34 | 34 | * |
35 | - * @param PHPExcel $pPHPExcel |
|
35 | + * @param \PHPExcel\Spreadsheet $pPHPExcel |
|
36 | 36 | * @return string XML Output |
37 | 37 | * @throws \PHPExcel\Writer\Exception |
38 | 38 | */ |
@@ -32,7 +32,7 @@ |
||
32 | 32 | /** |
33 | 33 | * Write Thumbnails/thumbnail.png to PNG format |
34 | 34 | * |
35 | - * @param PHPExcel $pPHPExcel |
|
35 | + * @param \PHPExcel\Spreadsheet $pPHPExcel |
|
36 | 36 | * @return string XML Output |
37 | 37 | * @throws \PHPExcel\Writer\Exception |
38 | 38 | */ |