A few more manual code style fixes for phpcs

This commit is contained in:
Adrien Crivelli 2016-12-23 00:08:55 +09:00
parent 8c66afe39a
commit af82e266c0
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
8 changed files with 58 additions and 62 deletions

View File

@ -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;
}
}

View File

@ -981,7 +981,6 @@ class Matrix
return $C;
}
throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(JAMAError(MatrixDimensionMismatch));
break;
case 'array':
$B = new self($args[0]);
if ($this->n == $B->m) {
@ -999,8 +998,6 @@ class Matrix
return $C;
}
throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(JAMAError(MatrixDimensionMismatch));
return $M;
break;
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);

View File

@ -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);

View File

@ -183,7 +183,6 @@ class ZipStreamWrapper
}
return false;
break;
case SEEK_CUR:
if ($offset >= 0) {
$this->position += $offset;
@ -192,7 +191,6 @@ class ZipStreamWrapper
}
return false;
break;
case SEEK_END:
if (strlen($this->data) + $offset >= 0) {
$this->position = strlen($this->data) + $offset;
@ -201,7 +199,6 @@ class ZipStreamWrapper
}
return false;
break;
default:
return false;
}

View File

@ -1006,6 +1006,7 @@ 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);

View File

@ -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];
}
// If not, create a new comment.
$newComment = new Comment();
$this->comments[$pCellCoordinate] = $newComment;

View File

@ -561,7 +561,9 @@ 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
}
// A float
if (BIFFwriter::getByteOrder()) { // if it's Big Endian
$num = strrev($num);
}