mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-16 13:06:31 +00:00
refactor: cleanup code twice calling
This commit is contained in:
committed by
GitHub
parent
44c3bd564b
commit
ea6ed77fdd
@@ -660,9 +660,11 @@ class Spreadsheet implements JsonSerializable
|
||||
*/
|
||||
public function getSheetByName(string $worksheetName): ?Worksheet
|
||||
{
|
||||
$worksheetCount = count($this->workSheetCollection);
|
||||
$worksheetCount = count($this->workSheetCollection);
|
||||
$trimWorksheetName = trim($worksheetName, "'");
|
||||
|
||||
for ($i = 0; $i < $worksheetCount; ++$i) {
|
||||
if (strcasecmp($this->workSheetCollection[$i]->getTitle(), trim($worksheetName, "'")) === 0) {
|
||||
if (strcasecmp($this->workSheetCollection[$i]->getTitle(), $trimWorksheetName) === 0) {
|
||||
return $this->workSheetCollection[$i];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user