Apply Scrutinizer patches for indentation
This commit is contained in:
parent
a85f1bdbed
commit
cb0930c016
|
@ -253,7 +253,8 @@ class CSV extends BaseReader implements IReader
|
|||
}
|
||||
$sheet = $spreadsheet->setActiveSheetIndex($this->sheetIndex);
|
||||
|
||||
$escapeEnclosures = ['\\' . $this->enclosure,
|
||||
$escapeEnclosures = [
|
||||
'\\' . $this->enclosure,
|
||||
$this->enclosure . $this->enclosure,
|
||||
];
|
||||
|
||||
|
|
|
@ -706,7 +706,8 @@ class AutoFilter
|
|||
$operator = ($dynamicRuleType === AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE)
|
||||
? AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHAN
|
||||
: AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN;
|
||||
$ruleValues[] = ['operator' => $operator,
|
||||
$ruleValues[] = [
|
||||
'operator' => $operator,
|
||||
'value' => $average,
|
||||
];
|
||||
$columnFilterTests[$columnID] = [
|
||||
|
|
|
@ -294,8 +294,7 @@ class Excel5 extends BaseWriter implements IWriter
|
|||
|
||||
// set the shape index (we combine 1-based sheet index and $countShapes to create unique shape index)
|
||||
$reducedSpId = $countShapes[$sheetIndex];
|
||||
$spId = $reducedSpId
|
||||
| ($sheet->getParent()->getIndex($sheet) + 1) << 10;
|
||||
$spId = $reducedSpId | ($sheet->getParent()->getIndex($sheet) + 1) << 10;
|
||||
$spContainer->setSpId($spId);
|
||||
|
||||
// keep track of last reducedSpId
|
||||
|
@ -352,8 +351,7 @@ class Excel5 extends BaseWriter implements IWriter
|
|||
|
||||
// set the shape index (we combine 1-based sheet index and $countShapes to create unique shape index)
|
||||
$reducedSpId = $countShapes[$sheetIndex];
|
||||
$spId = $reducedSpId
|
||||
| ($sheet->getParent()->getIndex($sheet) + 1) << 10;
|
||||
$spId = $reducedSpId | ($sheet->getParent()->getIndex($sheet) + 1) << 10;
|
||||
$spContainer->setSpId($spId);
|
||||
|
||||
// keep track of last reducedSpId
|
||||
|
@ -564,50 +562,64 @@ class Excel5 extends BaseWriter implements IWriter
|
|||
$dataSection_Content = '';
|
||||
|
||||
// GKPIDDSI_CODEPAGE: CodePage
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x01],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x01],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x02], // 2 byte signed integer
|
||||
'data' => ['data' => 1252], ];
|
||||
'data' => ['data' => 1252],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
|
||||
// GKPIDDSI_CATEGORY : Category
|
||||
if ($this->spreadsheet->getProperties()->getCategory()) {
|
||||
$dataProp = $this->spreadsheet->getProperties()->getCategory();
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x02],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x02],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x1E],
|
||||
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)], ];
|
||||
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
}
|
||||
// GKPIDDSI_VERSION :Version of the application that wrote the property storage
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x17],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x17],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x03],
|
||||
'data' => ['pack' => 'V', 'data' => 0x000C0000], ];
|
||||
'data' => ['pack' => 'V', 'data' => 0x000C0000],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
// GKPIDDSI_SCALE : FALSE
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x0B],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x0B],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x0B],
|
||||
'data' => ['data' => false], ];
|
||||
'data' => ['data' => false],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
// GKPIDDSI_LINKSDIRTY : True if any of the values for the linked properties have changed outside of the application
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x10],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x10],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x0B],
|
||||
'data' => ['data' => false], ];
|
||||
'data' => ['data' => false],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
// GKPIDDSI_SHAREDOC : FALSE
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x13],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x13],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x0B],
|
||||
'data' => ['data' => false], ];
|
||||
'data' => ['data' => false],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
// GKPIDDSI_HYPERLINKSCHANGED : True if any of the values for the _PID_LINKS (hyperlink text) have changed outside of the application
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x16],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x16],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x0B],
|
||||
'data' => ['data' => false], ];
|
||||
'data' => ['data' => false],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
|
||||
// GKPIDDSI_DOCSPARTS
|
||||
|
@ -623,10 +635,12 @@ class Excel5 extends BaseWriter implements IWriter
|
|||
// value
|
||||
$dataProp .= 'Worksheet' . chr(0);
|
||||
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x0D],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x0D],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x101E],
|
||||
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)], ];
|
||||
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
|
||||
// GKPIDDSI_HEADINGPAIR
|
||||
|
@ -657,10 +671,12 @@ class Excel5 extends BaseWriter implements IWriter
|
|||
$dataProp .= pack('v', 0x0000);
|
||||
$dataProp .= pack('v', 0x0000);
|
||||
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x0C],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x0C],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x100C],
|
||||
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)], ];
|
||||
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
|
||||
// 4 Section Length
|
||||
|
@ -760,89 +776,109 @@ class Excel5 extends BaseWriter implements IWriter
|
|||
$dataSection_Content = '';
|
||||
|
||||
// CodePage : CP-1252
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x01],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x01],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x02], // 2 byte signed integer
|
||||
'data' => ['data' => 1252], ];
|
||||
'data' => ['data' => 1252],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
|
||||
// Title
|
||||
if ($this->spreadsheet->getProperties()->getTitle()) {
|
||||
$dataProp = $this->spreadsheet->getProperties()->getTitle();
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x02],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x02],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
|
||||
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)], ];
|
||||
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
}
|
||||
// Subject
|
||||
if ($this->spreadsheet->getProperties()->getSubject()) {
|
||||
$dataProp = $this->spreadsheet->getProperties()->getSubject();
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x03],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x03],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
|
||||
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)], ];
|
||||
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
}
|
||||
// Author (Creator)
|
||||
if ($this->spreadsheet->getProperties()->getCreator()) {
|
||||
$dataProp = $this->spreadsheet->getProperties()->getCreator();
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x04],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x04],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
|
||||
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)], ];
|
||||
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
}
|
||||
// Keywords
|
||||
if ($this->spreadsheet->getProperties()->getKeywords()) {
|
||||
$dataProp = $this->spreadsheet->getProperties()->getKeywords();
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x05],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x05],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
|
||||
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)], ];
|
||||
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
}
|
||||
// Comments (Description)
|
||||
if ($this->spreadsheet->getProperties()->getDescription()) {
|
||||
$dataProp = $this->spreadsheet->getProperties()->getDescription();
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x06],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x06],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
|
||||
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)], ];
|
||||
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
}
|
||||
// Last Saved By (LastModifiedBy)
|
||||
if ($this->spreadsheet->getProperties()->getLastModifiedBy()) {
|
||||
$dataProp = $this->spreadsheet->getProperties()->getLastModifiedBy();
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x08],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x08],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x1E], // null-terminated string prepended by dword string length
|
||||
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)], ];
|
||||
'data' => ['data' => $dataProp, 'length' => strlen($dataProp)],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
}
|
||||
// Created Date/Time
|
||||
if ($this->spreadsheet->getProperties()->getCreated()) {
|
||||
$dataProp = $this->spreadsheet->getProperties()->getCreated();
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x0C],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x0C],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x40], // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
|
||||
'data' => ['data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp)], ];
|
||||
'data' => ['data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp)],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
}
|
||||
// Modified Date/Time
|
||||
if ($this->spreadsheet->getProperties()->getModified()) {
|
||||
$dataProp = $this->spreadsheet->getProperties()->getModified();
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x0D],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x0D],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x40], // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
|
||||
'data' => ['data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp)], ];
|
||||
'data' => ['data' => \PhpSpreadsheet\Shared\OLE::localDateToOLE($dataProp)],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
}
|
||||
// Security
|
||||
$dataSection[] = ['summary' => ['pack' => 'V', 'data' => 0x13],
|
||||
$dataSection[] = [
|
||||
'summary' => ['pack' => 'V', 'data' => 0x13],
|
||||
'offset' => ['pack' => 'V'],
|
||||
'type' => ['pack' => 'V', 'data' => 0x03], // 4 byte signed integer
|
||||
'data' => ['data' => 0x00], ];
|
||||
'data' => ['data' => 0x00],
|
||||
];
|
||||
++$dataSection_NumProps;
|
||||
|
||||
// 4 Section Length
|
||||
|
|
|
@ -1019,9 +1019,7 @@ class Worksheet extends BIFFwriter
|
|||
$data = pack('vvvv', $row1, $row2, $col1, $col2);
|
||||
|
||||
// Write the packed data
|
||||
$this->append($header . $data .
|
||||
$unknown1 . $options .
|
||||
$unknown2 . $url_len . $url);
|
||||
$this->append($header . $data . $unknown1 . $options . $unknown2 . $url_len . $url);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1068,9 +1066,7 @@ class Worksheet extends BIFFwriter
|
|||
$data = pack('vvvv', $row1, $row2, $col1, $col2);
|
||||
|
||||
// Write the packed data
|
||||
$this->append($header . $data .
|
||||
$unknown1 . $options .
|
||||
$url_len . $url);
|
||||
$this->append($header . $data . $unknown1 . $options . $url_len . $url);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue