depreciation updates

This commit is contained in:
Dennis Eichhorn 2022-09-30 00:34:40 +02:00
parent 8caf616b7d
commit 7555fe814f
6 changed files with 23 additions and 21 deletions

View File

@ -3858,8 +3858,10 @@ class Calculation
}
}
$tIndex = \is_float($token) ? (int) $token : $token;
// if the token is a binary operator, pop the top two values off the stack, do the operation, and push the result back on the stack
if (isset(self::$binaryOperators[$token])) {
if (isset(self::$binaryOperators[$tIndex])) {
// We must have two operands, error if we don't
if (($operand2Data = $stack->pop()) === null) {
return $this->raiseFormulaError('Internal error - Operand value missing from stack');

View File

@ -521,12 +521,12 @@ class OLE
$res = '';
for ($i = 0; $i < 4; ++$i) {
$hex = $low_part % 0x100;
$hex = (int) (((int) $low_part) % 0x100);
$res .= pack('c', $hex);
$low_part /= 0x100;
}
for ($i = 0; $i < 4; ++$i) {
$hex = $high_part % 0x100;
$hex = (int) (((int) $high_part) % 0x100);
$res .= pack('c', $hex);
$high_part /= 0x100;
}

View File

@ -42,7 +42,7 @@ class Iterator implements \Iterator
/**
* Rewind iterator.
*/
public function rewind()
public function rewind() : void
{
$this->position = 0;
}
@ -52,7 +52,7 @@ class Iterator implements \Iterator
*
* @return Worksheet
*/
public function current()
public function current() : mixed
{
return $this->subject->getSheet($this->position);
}
@ -62,7 +62,7 @@ class Iterator implements \Iterator
*
* @return int
*/
public function key()
public function key() : mixed
{
return $this->position;
}
@ -70,7 +70,7 @@ class Iterator implements \Iterator
/**
* Next value.
*/
public function next()
public function next() : void
{
++$this->position;
}
@ -80,7 +80,7 @@ class Iterator implements \Iterator
*
* @return bool
*/
public function valid()
public function valid() : bool
{
return $this->position < $this->subject->getSheetCount() && $this->position >= 0;
}

View File

@ -113,7 +113,7 @@ class RowCellIterator extends CellIterator
/**
* Rewind the iterator to the starting column.
*/
public function rewind()
public function rewind() : void
{
$this->currentColumnIndex = $this->startColumnIndex;
}
@ -123,7 +123,7 @@ class RowCellIterator extends CellIterator
*
* @return \PhpOffice\PhpSpreadsheet\Cell\Cell
*/
public function current()
public function current() : mixed
{
return $this->worksheet->getCellByColumnAndRow($this->currentColumnIndex, $this->rowIndex);
}
@ -133,7 +133,7 @@ class RowCellIterator extends CellIterator
*
* @return string
*/
public function key()
public function key() : mixed
{
return Coordinate::stringFromColumnIndex($this->currentColumnIndex);
}
@ -141,7 +141,7 @@ class RowCellIterator extends CellIterator
/**
* Set the iterator to its next value.
*/
public function next()
public function next() : void
{
do {
++$this->currentColumnIndex;
@ -153,7 +153,7 @@ class RowCellIterator extends CellIterator
*
* @throws PhpSpreadsheetException
*/
public function prev()
public function prev() : void
{
do {
--$this->currentColumnIndex;
@ -165,7 +165,7 @@ class RowCellIterator extends CellIterator
*
* @return bool
*/
public function valid()
public function valid() : bool
{
return $this->currentColumnIndex <= $this->endColumnIndex && $this->currentColumnIndex >= $this->startColumnIndex;
}

View File

@ -117,7 +117,7 @@ class RowIterator implements \Iterator
/**
* Rewind the iterator to the starting row.
*/
public function rewind()
public function rewind() : void
{
$this->position = $this->startRow;
}
@ -127,7 +127,7 @@ class RowIterator implements \Iterator
*
* @return Row
*/
public function current()
public function current() : mixed
{
return new Row($this->subject, $this->position);
}
@ -137,7 +137,7 @@ class RowIterator implements \Iterator
*
* @return int
*/
public function key()
public function key() : mixed
{
return $this->position;
}
@ -145,7 +145,7 @@ class RowIterator implements \Iterator
/**
* Set the iterator to its next value.
*/
public function next()
public function next() : void
{
++$this->position;
}
@ -153,7 +153,7 @@ class RowIterator implements \Iterator
/**
* Set the iterator to its previous value.
*/
public function prev()
public function prev() : void
{
--$this->position;
}
@ -163,7 +163,7 @@ class RowIterator implements \Iterator
*
* @return bool
*/
public function valid()
public function valid() : bool
{
return $this->position <= $this->endRow && $this->position >= $this->startRow;
}

View File

@ -42,7 +42,7 @@ class StringTable extends WriterPart
if (!is_object($cellValue) &&
($cellValue !== null) &&
$cellValue !== '' &&
!isset($aFlippedStringTable[$cellValue]) &&
!isset($aFlippedStringTable[\is_float($cellValue) ? (int) $cellValue : $cellValue]) &&
($cell->getDataType() == DataType::TYPE_STRING || $cell->getDataType() == DataType::TYPE_STRING2 || $cell->getDataType() == DataType::TYPE_NULL)) {
$aStringTable[] = $cellValue;
$aFlippedStringTable[$cellValue] = true;