mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-11-03 17:58:04 +00:00
PSR-2 variable naming for caching classes, remove leading underscores
This commit is contained in:
@@ -34,15 +34,15 @@ class PHPExcel_CachedObjectStorage_MemorySerialized extends PHPExcel_CachedObjec
|
||||
* @return void
|
||||
* @throws PHPExcel_Exception
|
||||
*/
|
||||
protected function _storeData()
|
||||
protected function storeData()
|
||||
{
|
||||
if ($this->_currentCellIsDirty && !empty($this->_currentObjectID)) {
|
||||
$this->_currentObject->detach();
|
||||
if ($this->currentCellIsDirty && !empty($this->currentObjectID)) {
|
||||
$this->currentObject->detach();
|
||||
|
||||
$this->_cellCache[$this->_currentObjectID] = serialize($this->_currentObject);
|
||||
$this->_currentCellIsDirty = false;
|
||||
$this->cellCache[$this->currentObjectID] = serialize($this->currentObject);
|
||||
$this->currentCellIsDirty = false;
|
||||
}
|
||||
$this->_currentObjectID = $this->_currentObject = null;
|
||||
$this->currentObjectID = $this->currentObject = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,13 +55,13 @@ class PHPExcel_CachedObjectStorage_MemorySerialized extends PHPExcel_CachedObjec
|
||||
*/
|
||||
public function addCacheData($pCoord, PHPExcel_Cell $cell)
|
||||
{
|
||||
if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {
|
||||
$this->_storeData();
|
||||
if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
|
||||
$this->storeData();
|
||||
}
|
||||
|
||||
$this->_currentObjectID = $pCoord;
|
||||
$this->_currentObject = $cell;
|
||||
$this->_currentCellIsDirty = true;
|
||||
$this->currentObjectID = $pCoord;
|
||||
$this->currentObject = $cell;
|
||||
$this->currentCellIsDirty = true;
|
||||
|
||||
return $cell;
|
||||
}
|
||||
@@ -75,25 +75,25 @@ class PHPExcel_CachedObjectStorage_MemorySerialized extends PHPExcel_CachedObjec
|
||||
*/
|
||||
public function getCacheData($pCoord)
|
||||
{
|
||||
if ($pCoord === $this->_currentObjectID) {
|
||||
return $this->_currentObject;
|
||||
if ($pCoord === $this->currentObjectID) {
|
||||
return $this->currentObject;
|
||||
}
|
||||
$this->_storeData();
|
||||
$this->storeData();
|
||||
|
||||
// Check if the entry that has been requested actually exists
|
||||
if (!isset($this->_cellCache[$pCoord])) {
|
||||
if (!isset($this->cellCache[$pCoord])) {
|
||||
// Return null if requested entry doesn't exist in cache
|
||||
return null;
|
||||
}
|
||||
|
||||
// Set current entry to the requested entry
|
||||
$this->_currentObjectID = $pCoord;
|
||||
$this->_currentObject = unserialize($this->_cellCache[$pCoord]);
|
||||
$this->currentObjectID = $pCoord;
|
||||
$this->currentObject = unserialize($this->cellCache[$pCoord]);
|
||||
// Re-attach this as the cell's parent
|
||||
$this->_currentObject->attach($this);
|
||||
$this->currentObject->attach($this);
|
||||
|
||||
// Return requested entry
|
||||
return $this->_currentObject;
|
||||
return $this->currentObject;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,8 +103,8 @@ class PHPExcel_CachedObjectStorage_MemorySerialized extends PHPExcel_CachedObjec
|
||||
*/
|
||||
public function getCellList()
|
||||
{
|
||||
if ($this->_currentObjectID !== null) {
|
||||
$this->_storeData();
|
||||
if ($this->currentObjectID !== null) {
|
||||
$this->storeData();
|
||||
}
|
||||
|
||||
return parent::getCellList();
|
||||
@@ -117,13 +117,13 @@ class PHPExcel_CachedObjectStorage_MemorySerialized extends PHPExcel_CachedObjec
|
||||
*/
|
||||
public function unsetWorksheetCells()
|
||||
{
|
||||
if (!is_null($this->_currentObject)) {
|
||||
$this->_currentObject->detach();
|
||||
$this->_currentObject = $this->_currentObjectID = null;
|
||||
if (!is_null($this->currentObject)) {
|
||||
$this->currentObject->detach();
|
||||
$this->currentObject = $this->currentObjectID = null;
|
||||
}
|
||||
$this->_cellCache = array();
|
||||
$this->cellCache = array();
|
||||
|
||||
// detach ourself from the worksheet, so that it can then delete this object successfully
|
||||
$this->_parent = null;
|
||||
$this->parent = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user