Rename *Number to *Index
This commit is contained in:
1 parent
c6e943041e
commit
cfd3e0ffa3
12 files changed
+134
-108
No files matched your search
@@ -67,8 +67,8 @@ class Workbook
|
||||
*/
|
||||
public function addNewSheet()
|
||||
{
|
||||
$newSheetNumber = count($this->worksheets);
|
||||
$sheet = new Sheet($newSheetNumber);
|
||||
$newSheetIndex = count($this->worksheets);
|
||||
$sheet = new Sheet($newSheetIndex);
|
||||
|
||||
$worksheetFilesFolder = $this->fileSystemHelper->getXlWorksheetsFolder();
|
||||
$worksheet = new Worksheet($sheet, $worksheetFilesFolder, $this->sharedStringsHelper, $this->shouldUseInlineStrings);
|
||||
|
||||
@@ -96,8 +96,8 @@ EOD;
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
// sheet number is zero-based, while ID is 1-based
|
||||
return $this->externalSheet->getNumber() + 1;
|
||||
// sheet index is zero-based, while ID is 1-based
|
||||
return $this->externalSheet->getIndex() + 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,27 +12,27 @@ class Sheet
|
||||
{
|
||||
const DEFAULT_SHEET_NAME_PREFIX = 'Sheet';
|
||||
|
||||
/** @var int Number of the sheet, based on order of creation (zero-based) */
|
||||
protected $sheetNumber;
|
||||
/** @var int Index of the sheet, based on order of creation (zero-based) */
|
||||
protected $index;
|
||||
|
||||
/** @var string Name of the sheet */
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* @param $sheetNumber Number of the sheet, based on order of creation (zero-based)
|
||||
* @param int $sheetIndex Index of the sheet, based on order of creation (zero-based)
|
||||
*/
|
||||
function __construct($sheetNumber)
|
||||
function __construct($sheetIndex)
|
||||
{
|
||||
$this->sheetNumber = $sheetNumber;
|
||||
$this->name = self::DEFAULT_SHEET_NAME_PREFIX . ($sheetNumber + 1);
|
||||
$this->index = $sheetIndex;
|
||||
$this->name = self::DEFAULT_SHEET_NAME_PREFIX . ($sheetIndex + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int Number of the sheet, based on order of creation (zero-based)
|
||||
* @return int Index of the sheet, based on order of creation (zero-based)
|
||||
*/
|
||||
public function getNumber()
|
||||
public function getIndex()
|
||||
{
|
||||
return $this->sheetNumber;
|
||||
return $this->index;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user