| @@ -513,8 +513,9 @@ | ||
| 513 | 513 | $worksheet->disconnectCells(); |
| 514 | 514 | unset($worksheet); |
| 515 | 515 | } |
| 516 | 516 | $this->workSheetCollection = []; |
| 517 | + $this->activeSheetIndex = -1; | |
| 517 | 518 | } |
| 518 | 519 | |
| 519 | 520 | /** |
| 520 | 521 | * Return the calculation engine for this worksheet. |
| @@ -530,9 +531,9 @@ | ||
| 530 | 531 | * @internal |
| 531 | 532 | */ |
| 532 | 533 | public function getCalculationEngineOrNull(): ?Calculation |
| 533 | 534 | { |
| 534 | - if (!isset($this->calculationEngine)) { //* @phpstan-ignore-line | |
| 535 | + if (!isset($this->calculationEngine)) { //* @phpstan-ignore isset.initializedProperty (may be null at destruct time) | |
| 535 | 536 | return null; |
| 536 | 537 | } |
| 537 | 538 | |
| 538 | 539 | return $this->calculationEngine; |
| @@ -1159,9 +1160,9 @@ | ||
| 1159 | 1160 | * @see \PhpOffice\PhpSpreadsheetBenchmarks\SpreadsheetCopyBenchmarkTest |
| 1160 | 1161 | */ |
| 1161 | 1162 | public function copy(): self |
| 1162 | 1163 | { |
| 1163 | - return unserialize(serialize($this)); //* @phpstan-ignore-line | |
| 1164 | + return unserialize(serialize($this)); //* @phpstan-ignore return.type (phpstan is wrong) | |
| 1164 | 1165 | } |
| 1165 | 1166 | |
| 1166 | 1167 | /** |
| 1167 | 1168 | * Implement PHP __clone to create a deep clone, not just a shallow copy. |