A few more manual code style fixes for phpcs
This commit is contained in:
parent
8c66afe39a
commit
af82e266c0
|
@ -1945,12 +1945,12 @@ class Engineering
|
|||
}
|
||||
|
||||
return self::cleanComplex(
|
||||
self::COMPLEX(
|
||||
$parsedComplex['real'],
|
||||
0 - $parsedComplex['imaginary'],
|
||||
$parsedComplex['suffix']
|
||||
)
|
||||
);
|
||||
self::COMPLEX(
|
||||
$parsedComplex['real'],
|
||||
0 - $parsedComplex['imaginary'],
|
||||
$parsedComplex['suffix']
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1976,12 +1976,12 @@ class Engineering
|
|||
}
|
||||
|
||||
return self::IMCONJUGATE(
|
||||
self::COMPLEX(
|
||||
cos($parsedComplex['real']) * cosh($parsedComplex['imaginary']),
|
||||
sin($parsedComplex['real']) * sinh($parsedComplex['imaginary']),
|
||||
$parsedComplex['suffix']
|
||||
)
|
||||
);
|
||||
self::COMPLEX(
|
||||
cos($parsedComplex['real']) * cosh($parsedComplex['imaginary']),
|
||||
sin($parsedComplex['real']) * sinh($parsedComplex['imaginary']),
|
||||
$parsedComplex['suffix']
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2007,10 +2007,10 @@ class Engineering
|
|||
}
|
||||
|
||||
return self::COMPLEX(
|
||||
sin($parsedComplex['real']) * cosh($parsedComplex['imaginary']),
|
||||
cos($parsedComplex['real']) * sinh($parsedComplex['imaginary']),
|
||||
$parsedComplex['suffix']
|
||||
);
|
||||
sin($parsedComplex['real']) * cosh($parsedComplex['imaginary']),
|
||||
cos($parsedComplex['real']) * sinh($parsedComplex['imaginary']),
|
||||
$parsedComplex['suffix']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,12 +22,13 @@ class Color
|
|||
// palette color, color index 0x08 maps to pallete index 0
|
||||
return $palette[$color - 8];
|
||||
}
|
||||
// default color table
|
||||
if ($version == \PhpOffice\PhpSpreadsheet\Reader\Xls::XLS_BIFF8) {
|
||||
return Color\BIFF8::lookup($color);
|
||||
}
|
||||
// BIFF5
|
||||
return Color\BIFF5::lookup($color);
|
||||
return $color;
|
||||
|
||||
// default color table
|
||||
if ($version == \PhpOffice\PhpSpreadsheet\Reader\Xls::XLS_BIFF8) {
|
||||
return Color\BIFF8::lookup($color);
|
||||
}
|
||||
|
||||
// BIFF5
|
||||
return Color\BIFF5::lookup($color);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -980,8 +980,7 @@ class Matrix
|
|||
|
||||
return $C;
|
||||
}
|
||||
throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(JAMAError(MatrixDimensionMismatch));
|
||||
break;
|
||||
throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(JAMAError(MatrixDimensionMismatch));
|
||||
case 'array':
|
||||
$B = new self($args[0]);
|
||||
if ($this->n == $B->m) {
|
||||
|
@ -998,9 +997,7 @@ class Matrix
|
|||
|
||||
return $C;
|
||||
}
|
||||
throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(JAMAError(MatrixDimensionMismatch));
|
||||
return $M;
|
||||
break;
|
||||
throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(JAMAError(MatrixDimensionMismatch));
|
||||
case 'integer':
|
||||
$C = new self($this->A);
|
||||
for ($i = 0; $i < $C->m; ++$i) {
|
||||
|
@ -1010,7 +1007,6 @@ class Matrix
|
|||
}
|
||||
|
||||
return $C;
|
||||
break;
|
||||
case 'double':
|
||||
$C = new self($this->m, $this->n);
|
||||
for ($i = 0; $i < $C->m; ++$i) {
|
||||
|
@ -1020,7 +1016,6 @@ class Matrix
|
|||
}
|
||||
|
||||
return $C;
|
||||
break;
|
||||
case 'float':
|
||||
$C = new self($this->A);
|
||||
for ($i = 0; $i < $C->m; ++$i) {
|
||||
|
@ -1030,10 +1025,8 @@ class Matrix
|
|||
}
|
||||
|
||||
return $C;
|
||||
break;
|
||||
default:
|
||||
throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
|
||||
|
|
|
@ -286,7 +286,7 @@ class OLE
|
|||
public function _readPpsWks($blockId)
|
||||
{
|
||||
$fh = $this->getStream($blockId);
|
||||
for ($pos = 0; ; $pos += 128) {
|
||||
for ($pos = 0; true; $pos += 128) {
|
||||
fseek($fh, $pos, SEEK_SET);
|
||||
$nameUtf16 = fread($fh, 64);
|
||||
$nameLength = self::_readInt2($fh);
|
||||
|
|
|
@ -182,8 +182,7 @@ class ZipStreamWrapper
|
|||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
break;
|
||||
return false;
|
||||
case SEEK_CUR:
|
||||
if ($offset >= 0) {
|
||||
$this->position += $offset;
|
||||
|
@ -191,8 +190,7 @@ class ZipStreamWrapper
|
|||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
break;
|
||||
return false;
|
||||
case SEEK_END:
|
||||
if (strlen($this->data) + $offset >= 0) {
|
||||
$this->position = strlen($this->data) + $offset;
|
||||
|
@ -200,8 +198,7 @@ class ZipStreamWrapper
|
|||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
break;
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1006,23 +1006,24 @@ class Spreadsheet
|
|||
if ($pIndex > count($this->cellXfCollection) - 1) {
|
||||
throw new Exception('CellXf index is out of bounds.');
|
||||
}
|
||||
// first remove the cellXf
|
||||
array_splice($this->cellXfCollection, $pIndex, 1);
|
||||
|
||||
// then update cellXf indexes for cells
|
||||
foreach ($this->workSheetCollection as $worksheet) {
|
||||
foreach ($worksheet->getCellCollection(false) as $cellID) {
|
||||
$cell = $worksheet->getCell($cellID);
|
||||
$xfIndex = $cell->getXfIndex();
|
||||
if ($xfIndex > $pIndex) {
|
||||
// decrease xf index by 1
|
||||
$cell->setXfIndex($xfIndex - 1);
|
||||
} elseif ($xfIndex == $pIndex) {
|
||||
// set to default xf index 0
|
||||
$cell->setXfIndex(0);
|
||||
}
|
||||
// first remove the cellXf
|
||||
array_splice($this->cellXfCollection, $pIndex, 1);
|
||||
|
||||
// then update cellXf indexes for cells
|
||||
foreach ($this->workSheetCollection as $worksheet) {
|
||||
foreach ($worksheet->getCellCollection(false) as $cellID) {
|
||||
$cell = $worksheet->getCell($cellID);
|
||||
$xfIndex = $cell->getXfIndex();
|
||||
if ($xfIndex > $pIndex) {
|
||||
// decrease xf index by 1
|
||||
$cell->setXfIndex($xfIndex - 1);
|
||||
} elseif ($xfIndex == $pIndex) {
|
||||
// set to default xf index 0
|
||||
$cell->setXfIndex(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2349,11 +2349,13 @@ class Worksheet implements IComparable
|
|||
} elseif ($pCellCoordinate == '') {
|
||||
throw new Exception('Cell coordinate can not be zero-length string.');
|
||||
}
|
||||
// Check if we already have a comment for this cell.
|
||||
// If not, create a new comment.
|
||||
if (isset($this->comments[$pCellCoordinate])) {
|
||||
return $this->comments[$pCellCoordinate];
|
||||
}
|
||||
|
||||
// Check if we already have a comment for this cell.
|
||||
if (isset($this->comments[$pCellCoordinate])) {
|
||||
return $this->comments[$pCellCoordinate];
|
||||
}
|
||||
|
||||
// If not, create a new comment.
|
||||
$newComment = new Comment();
|
||||
$this->comments[$pCellCoordinate] = $newComment;
|
||||
|
||||
|
|
|
@ -561,10 +561,12 @@ class Parser
|
|||
// Integer in the range 0..2**16-1
|
||||
if ((preg_match("/^\d+$/", $num)) and ($num <= 65535)) {
|
||||
return pack('Cv', $this->ptg['ptgInt'], $num);
|
||||
} // A float
|
||||
if (BIFFwriter::getByteOrder()) { // if it's Big Endian
|
||||
$num = strrev($num);
|
||||
}
|
||||
}
|
||||
|
||||
// A float
|
||||
if (BIFFwriter::getByteOrder()) { // if it's Big Endian
|
||||
$num = strrev($num);
|
||||
}
|
||||
|
||||
return pack('Cd', $this->ptg['ptgNum'], $num);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue