Skip to content

Commit 3a6ebc0

Browse files
committed
Fixed coding standard with strict comparisons
1 parent 8889ecf commit 3a6ebc0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/PhpSpreadsheet/Worksheet/Table.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function setName(string $name)
9090
{
9191
$name = trim($name);
9292

93-
if (strlen($name) == 1 && in_array($name, ['C', 'c', 'R', 'r'])) {
93+
if (strlen($name) === 1 && in_array($name, ['C', 'c', 'R', 'r'])) {
9494
throw new PhpSpreadsheetException('The table name is invalid');
9595
}
9696
if (strlen($name) > 255) {
@@ -238,12 +238,12 @@ public function getWorksheet()
238238
*/
239239
public function setWorksheet(?Worksheet $worksheet = null)
240240
{
241-
if ($this->name != '' && $worksheet != null) {
241+
if ($this->name !== '' && $worksheet !== null) {
242242
$spreadsheet = $worksheet->getParent();
243243

244244
foreach ($spreadsheet->getWorksheetIterator() as $sheet) {
245245
foreach ($sheet->getTableCollection() as $table) {
246-
if ($table->getName() == $this->name) {
246+
if ($table->getName() === $this->name) {
247247
throw new PhpSpreadsheetException("Workbook already contains a table named '{$this->name}'");
248248
}
249249
}
@@ -446,7 +446,7 @@ public function __clone()
446446
} else {
447447
$this->{$key} = clone $value;
448448
}
449-
} elseif ((is_array($value)) && ($key == 'columns')) {
449+
} elseif ((is_array($value)) && ($key === 'columns')) {
450450
// The columns array of \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet\Table objects
451451
$this->{$key} = [];
452452
foreach ($value as $k => $v) {

0 commit comments

Comments
 (0)