@@ -205,7 +205,7 @@ |
||
| 205 | 205 | try { |
| 206 | 206 | $this->xmlProcessor->readUntilStopped(); |
| 207 | 207 | } catch (XMLProcessingException $exception) { |
| 208 | - throw new IOException("The {$this->sheetDataXMLFilePath} file cannot be read. [{$exception->getMessage()}]"); |
|
| 208 | + throw new IOException("the {$this->sheetDataXMLFilePath} file cannot be read. [{$exception->getMessage()}]"); |
|
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | $this->rowDataBuffer = $this->currentlyProcessedRowData; |
@@ -304,8 +304,7 @@ discard block |
||
| 304 | 304 | $currentRowIndex = $xmlReader->getAttribute(self::XML_ATTRIBUTE_ROW_INDEX); |
| 305 | 305 | |
| 306 | 306 | return ($currentRowIndex !== null) ? |
| 307 | - (int) $currentRowIndex : |
|
| 308 | - $this->lastRowIndexProcessed + 1; |
|
| 307 | + (int) $currentRowIndex : $this->lastRowIndexProcessed + 1; |
|
| 309 | 308 | } |
| 310 | 309 | |
| 311 | 310 | /** |
@@ -319,8 +318,7 @@ discard block |
||
| 319 | 318 | $currentCellIndex = $xmlReader->getAttribute(self::XML_ATTRIBUTE_CELL_INDEX); |
| 320 | 319 | |
| 321 | 320 | return ($currentCellIndex !== null) ? |
| 322 | - CellHelper::getColumnIndexFromCellIndex($currentCellIndex) : |
|
| 323 | - $this->lastColumnIndexProcessed + 1; |
|
| 321 | + CellHelper::getColumnIndexFromCellIndex($currentCellIndex) : $this->lastColumnIndexProcessed + 1; |
|
| 324 | 322 | } |
| 325 | 323 | |
| 326 | 324 | /** |
@@ -380,8 +378,7 @@ discard block |
||
| 380 | 378 | // but to avoid a breaking change, the return value for |
| 381 | 379 | // this function has been kept as the number of rows read. |
| 382 | 380 | return $this->shouldPreserveEmptyRows ? |
| 383 | - $this->nextRowIndexToBeProcessed : |
|
| 384 | - $this->numReadRows; |
|
| 381 | + $this->nextRowIndexToBeProcessed : $this->numReadRows; |
|
| 385 | 382 | } |
| 386 | 383 | |
| 387 | 384 | /** |
@@ -119,8 +119,8 @@ |
||
| 119 | 119 | // replace namespace separators with directory separators |
| 120 | 120 | // in the relative class name, append with .php |
| 121 | 121 | $file = $baseDir |
| 122 | - . str_replace('\\', '/', $relativeClass) |
|
| 123 | - . '.php'; |
|
| 122 | + . str_replace('\\', '/', $relativeClass) |
|
| 123 | + . '.php'; |
|
| 124 | 124 | |
| 125 | 125 | // if the mapped file exists, require it |
| 126 | 126 | if ($this->requireFile($file)) { |
@@ -21,33 +21,33 @@ |
||
| 21 | 21 | private static $excelDateFormatToPHPDateFormatMapping = [ |
| 22 | 22 | self::KEY_GENERAL => [ |
| 23 | 23 | // Time |
| 24 | - 'am/pm' => 'A', // Uppercase Ante meridiem and Post meridiem |
|
| 24 | + 'am/pm' => 'A', // Uppercase Ante meridiem and Post meridiem |
|
| 25 | 25 | ':mm' => ':i', // Minutes with leading zeros - if preceded by a ":" (otherwise month) |
| 26 | 26 | 'mm:' => 'i:', // Minutes with leading zeros - if followed by a ":" (otherwise month) |
| 27 | - 'ss' => 's', // Seconds, with leading zeros |
|
| 28 | - '.s' => '', // Ignore (fractional seconds format does not exist in PHP) |
|
| 27 | + 'ss' => 's', // Seconds, with leading zeros |
|
| 28 | + '.s' => '', // Ignore (fractional seconds format does not exist in PHP) |
|
| 29 | 29 | |
| 30 | 30 | // Date |
| 31 | - 'e' => 'Y', // Full numeric representation of a year, 4 digits |
|
| 32 | - 'yyyy' => 'Y', // Full numeric representation of a year, 4 digits |
|
| 33 | - 'yy' => 'y', // Two digit representation of a year |
|
| 34 | - 'mmmmm' => 'M', // Short textual representation of a month, three letters ("mmmmm" should only contain the 1st letter...) |
|
| 35 | - 'mmmm' => 'F', // Full textual representation of a month |
|
| 36 | - 'mmm' => 'M', // Short textual representation of a month, three letters |
|
| 37 | - 'mm' => 'm', // Numeric representation of a month, with leading zeros |
|
| 38 | - 'm' => 'n', // Numeric representation of a month, without leading zeros |
|
| 39 | - 'dddd' => 'l', // Full textual representation of the day of the week |
|
| 40 | - 'ddd' => 'D', // Textual representation of a day, three letters |
|
| 41 | - 'dd' => 'd', // Day of the month, 2 digits with leading zeros |
|
| 42 | - 'd' => 'j', // Day of the month without leading zeros |
|
| 31 | + 'e' => 'Y', // Full numeric representation of a year, 4 digits |
|
| 32 | + 'yyyy' => 'Y', // Full numeric representation of a year, 4 digits |
|
| 33 | + 'yy' => 'y', // Two digit representation of a year |
|
| 34 | + 'mmmmm' => 'M', // Short textual representation of a month, three letters ("mmmmm" should only contain the 1st letter...) |
|
| 35 | + 'mmmm' => 'F', // Full textual representation of a month |
|
| 36 | + 'mmm' => 'M', // Short textual representation of a month, three letters |
|
| 37 | + 'mm' => 'm', // Numeric representation of a month, with leading zeros |
|
| 38 | + 'm' => 'n', // Numeric representation of a month, without leading zeros |
|
| 39 | + 'dddd' => 'l', // Full textual representation of the day of the week |
|
| 40 | + 'ddd' => 'D', // Textual representation of a day, three letters |
|
| 41 | + 'dd' => 'd', // Day of the month, 2 digits with leading zeros |
|
| 42 | + 'd' => 'j', // Day of the month without leading zeros |
|
| 43 | 43 | ], |
| 44 | 44 | self::KEY_HOUR_12 => [ |
| 45 | - 'hh' => 'h', // 12-hour format of an hour without leading zeros |
|
| 46 | - 'h' => 'g', // 12-hour format of an hour without leading zeros |
|
| 45 | + 'hh' => 'h', // 12-hour format of an hour without leading zeros |
|
| 46 | + 'h' => 'g', // 12-hour format of an hour without leading zeros |
|
| 47 | 47 | ], |
| 48 | 48 | self::KEY_HOUR_24 => [ |
| 49 | - 'hh' => 'H', // 24-hour hours with leading zero |
|
| 50 | - 'h' => 'G', // 24-hour format of an hour without leading zeros |
|
| 49 | + 'hh' => 'H', // 24-hour hours with leading zero |
|
| 50 | + 'h' => 'G', // 24-hour format of an hour without leading zeros |
|
| 51 | 51 | ], |
| 52 | 52 | ]; |
| 53 | 53 | |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | 22 => 'm/d/yyyy h:mm', // @NOTE: ECMA spec is 'm/d/yy h:mm', |
| 48 | 48 | 45 => 'mm:ss', |
| 49 | 49 | 46 => '[h]:mm:ss', |
| 50 | - 47 => 'mm:ss.0', // @NOTE: ECMA spec is 'mmss.0', |
|
| 50 | + 47 => 'mm:ss.0', // @NOTE: ECMA spec is 'mmss.0', |
|
| 51 | 51 | ]; |
| 52 | 52 | |
| 53 | 53 | /** @var string Path of the XLSX file being read */ |
@@ -193,8 +193,7 @@ |
||
| 193 | 193 | $streamScheme = $this->getStreamWrapperScheme($filePath); |
| 194 | 194 | |
| 195 | 195 | return ($streamScheme !== null) ? |
| 196 | - in_array($streamScheme, $this->globalFunctionsHelper->stream_get_wrappers()) : |
|
| 197 | - true; |
|
| 196 | + in_array($streamScheme, $this->globalFunctionsHelper->stream_get_wrappers()) : true; |
|
| 198 | 197 | } |
| 199 | 198 | |
| 200 | 199 | /** |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | // |
| 33 | 33 | // @NOTE: Using ENT_NOQUOTES as only XML entities ('<', '>', '&') need to be encoded. |
| 34 | 34 | // Single and double quotes can be left as is. |
| 35 | - $escapedString = htmlspecialchars($string, ENT_NOQUOTES); |
|
| 35 | + $escapedString = htmlspecialchars($string, ENT_NOQUOTES); |
|
| 36 | 36 | |
| 37 | 37 | // control characters values are from 0 to 1F (hex values) in the ASCII table |
| 38 | 38 | // some characters should not be escaped though: "\t", "\r" and "\n". |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | <Relationship Id="rIdCore" Type="http://schemas.openxmlformats.org/officedocument/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/> |
| 148 | 148 | <Relationship Id="rIdApp" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/> |
| 149 | 149 | </Relationships> |
| 150 | -EOD; |
|
| 150 | +eod; |
|
| 151 | 151 | |
| 152 | 152 | $this->createFileWithContents($this->relsFolder, self::RELS_FILE_NAME, $relsFileContents); |
| 153 | 153 | |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | <Application>$appName</Application> |
| 186 | 186 | <TotalTime>0</TotalTime> |
| 187 | 187 | </Properties> |
| 188 | -EOD; |
|
| 188 | +eod; |
|
| 189 | 189 | |
| 190 | 190 | $this->createFileWithContents($this->docPropsFolder, self::APP_XML_FILE_NAME, $appXmlFileContents); |
| 191 | 191 | |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | <dcterms:modified xsi:type="dcterms:W3CDTF">$createdDate</dcterms:modified> |
| 209 | 209 | <cp:revision>0</cp:revision> |
| 210 | 210 | </cp:coreProperties> |
| 211 | -EOD; |
|
| 211 | +eod; |
|
| 212 | 212 | |
| 213 | 213 | $this->createFileWithContents($this->docPropsFolder, self::CORE_XML_FILE_NAME, $coreXmlFileContents); |
| 214 | 214 | |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | <Default ContentType="application/xml" Extension="xml"/> |
| 271 | 271 | <Default ContentType="application/vnd.openxmlformats-package.relationships+xml" Extension="rels"/> |
| 272 | 272 | <Override ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" PartName="/xl/workbook.xml"/> |
| 273 | -EOD; |
|
| 273 | +eod; |
|
| 274 | 274 | |
| 275 | 275 | /** @var Worksheet $worksheet */ |
| 276 | 276 | foreach ($worksheets as $worksheet) { |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | <Override ContentType="application/vnd.openxmlformats-package.core-properties+xml" PartName="/docProps/core.xml"/> |
| 284 | 284 | <Override ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" PartName="/docProps/app.xml"/> |
| 285 | 285 | </Types> |
| 286 | -EOD; |
|
| 286 | +eod; |
|
| 287 | 287 | |
| 288 | 288 | $this->createFileWithContents($this->rootFolder, self::CONTENT_TYPES_XML_FILE_NAME, $contentTypesXmlFileContents); |
| 289 | 289 | |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> |
| 303 | 303 | <workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"> |
| 304 | 304 | <sheets> |
| 305 | -EOD; |
|
| 305 | +eod; |
|
| 306 | 306 | |
| 307 | 307 | /** @var Worksheet $worksheet */ |
| 308 | 308 | foreach ($worksheets as $worksheet) { |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | $workbookXmlFileContents .= <<<'EOD' |
| 315 | 315 | </sheets> |
| 316 | 316 | </workbook> |
| 317 | -EOD; |
|
| 317 | +eod; |
|
| 318 | 318 | |
| 319 | 319 | $this->createFileWithContents($this->xlFolder, self::WORKBOOK_XML_FILE_NAME, $workbookXmlFileContents); |
| 320 | 320 | |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"> |
| 335 | 335 | <Relationship Id="rIdStyles" Target="styles.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"/> |
| 336 | 336 | <Relationship Id="rIdSharedStrings" Target="sharedStrings.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings"/> |
| 337 | -EOD; |
|
| 337 | +eod; |
|
| 338 | 338 | |
| 339 | 339 | /** @var Worksheet $worksheet */ |
| 340 | 340 | foreach ($worksheets as $worksheet) { |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | const SHEET_XML_FILE_HEADER = <<<'EOD' |
| 33 | 33 | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> |
| 34 | 34 | <worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"> |
| 35 | -EOD; |
|
| 35 | +eod; |
|
| 36 | 36 | |
| 37 | 37 | /** @var bool Whether inline or shared strings should be used */ |
| 38 | 38 | protected $shouldUseInlineStrings; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $content = <<<'EOD' |
| 47 | 47 | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> |
| 48 | 48 | <styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"> |
| 49 | -EOD; |
|
| 49 | +eod; |
|
| 50 | 50 | |
| 51 | 51 | $content .= $this->getFontsSectionContent(); |
| 52 | 52 | $content .= $this->getFillsSectionContent(); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | $content .= <<<'EOD' |
| 59 | 59 | </styleSheet> |
| 60 | -EOD; |
|
| 60 | +eod; |
|
| 61 | 61 | |
| 62 | 62 | return $content; |
| 63 | 63 | } |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | <cellStyleXfs count="1"> |
| 189 | 189 | <xf borderId="0" fillId="0" fontId="0" numFmtId="0"/> |
| 190 | 190 | </cellStyleXfs> |
| 191 | -EOD; |
|
| 191 | +eod; |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | /** |
@@ -240,6 +240,6 @@ discard block |
||
| 240 | 240 | <cellStyles count="1"> |
| 241 | 241 | <cellStyle builtinId="0" name="Normal" xfId="0"/> |
| 242 | 242 | </cellStyles> |
| 243 | -EOD; |
|
| 243 | +eod; |
|
| 244 | 244 | } |
| 245 | 245 | } |