More PSR-2 work, and eliminate duplicate code in Row/Column dimensions by extension of an abstract Dimension class containing common code/properties

This commit is contained in:
MarkBaker 2015-05-17 10:22:51 +01:00
parent 334747867d
commit f0fdc9430b
9 changed files with 2243 additions and 1993 deletions

File diff suppressed because it is too large Load Diff

View File

@ -39,91 +39,91 @@ class PHPExcel_Chart
*
* @var PHPExcel_Worksheet
*/
private $_worksheet = null;
private $worksheet;
/**
* Chart Title
*
* @var PHPExcel_Chart_Title
*/
private $_title = null;
private $title;
/**
* Chart Legend
*
* @var PHPExcel_Chart_Legend
*/
private $_legend = null;
private $legend;
/**
* X-Axis Label
*
* @var PHPExcel_Chart_Title
*/
private $_xAxisLabel = null;
private $xAxisLabel;
/**
* Y-Axis Label
*
* @var PHPExcel_Chart_Title
*/
private $_yAxisLabel = null;
private $yAxisLabel;
/**
* Chart Plot Area
*
* @var PHPExcel_Chart_PlotArea
*/
private $_plotArea = null;
private $plotArea;
/**
* Plot Visible Only
*
* @var boolean
*/
private $_plotVisibleOnly = true;
private $plotVisibleOnly = true;
/**
* Display Blanks as
*
* @var string
*/
private $_displayBlanksAs = '0';
private $displayBlanksAs = '0';
/**
* Chart Asix Y as
*
* @var PHPExcel_Chart_Axis
*/
private $_yAxis = null;
private $yAxis;
/**
* Chart Asix X as
*
* @var PHPExcel_Chart_Axis
*/
private $_xAxis = null;
private $xAxis;
/**
* Chart Major Gridlines as
*
* @var PHPExcel_Chart_GridLines
*/
private $_majorGridlines = null;
private $majorGridlines;
/**
* Chart Minor Gridlines as
*
* @var PHPExcel_Chart_GridLines
*/
private $_minorGridlines = null;
private $minorGridlines;
/**
* Top-Left Cell Position
*
* @var string
*/
private $_topLeftCellRef = 'A1';
private $topLeftCellRef = 'A1';
/**
@ -131,7 +131,7 @@ class PHPExcel_Chart
*
* @var integer
*/
private $_topLeftXOffset = 0;
private $topLeftXOffset = 0;
/**
@ -139,7 +139,7 @@ class PHPExcel_Chart
*
* @var integer
*/
private $_topLeftYOffset = 0;
private $topLeftYOffset = 0;
/**
@ -147,7 +147,7 @@ class PHPExcel_Chart
*
* @var string
*/
private $_bottomRightCellRef = 'A1';
private $bottomRightCellRef = 'A1';
/**
@ -155,7 +155,7 @@ class PHPExcel_Chart
*
* @var integer
*/
private $_bottomRightXOffset = 10;
private $bottomRightXOffset = 10;
/**
@ -163,7 +163,7 @@ class PHPExcel_Chart
*
* @var integer
*/
private $_bottomRightYOffset = 10;
private $bottomRightYOffset = 10;
/**
@ -172,17 +172,17 @@ class PHPExcel_Chart
public function __construct($name, PHPExcel_Chart_Title $title = null, PHPExcel_Chart_Legend $legend = null, PHPExcel_Chart_PlotArea $plotArea = null, $plotVisibleOnly = true, $displayBlanksAs = '0', PHPExcel_Chart_Title $xAxisLabel = null, PHPExcel_Chart_Title $yAxisLabel = null, PHPExcel_Chart_Axis $xAxis = null, PHPExcel_Chart_Axis $yAxis = null, PHPExcel_Chart_GridLines $majorGridlines = null, PHPExcel_Chart_GridLines $minorGridlines = null)
{
$this->_name = $name;
$this->_title = $title;
$this->_legend = $legend;
$this->_xAxisLabel = $xAxisLabel;
$this->_yAxisLabel = $yAxisLabel;
$this->_plotArea = $plotArea;
$this->_plotVisibleOnly = $plotVisibleOnly;
$this->_displayBlanksAs = $displayBlanksAs;
$this->_xAxis = $xAxis;
$this->_yAxis = $yAxis;
$this->_majorGridlines = $majorGridlines;
$this->_minorGridlines = $minorGridlines;
$this->title = $title;
$this->legend = $legend;
$this->xAxisLabel = $xAxisLabel;
$this->yAxisLabel = $yAxisLabel;
$this->plotArea = $plotArea;
$this->plotVisibleOnly = $plotVisibleOnly;
$this->displayBlanksAs = $displayBlanksAs;
$this->xAxis = $xAxis;
$this->yAxis = $yAxis;
$this->majorGridlines = $majorGridlines;
$this->minorGridlines = $minorGridlines;
}
/**
@ -202,7 +202,7 @@ class PHPExcel_Chart
*/
public function getWorksheet()
{
return $this->_worksheet;
return $this->worksheet;
}
/**
@ -214,7 +214,7 @@ class PHPExcel_Chart
*/
public function setWorksheet(PHPExcel_Worksheet $pValue = null)
{
$this->_worksheet = $pValue;
$this->worksheet = $pValue;
return $this;
}
@ -226,7 +226,7 @@ class PHPExcel_Chart
*/
public function getTitle()
{
return $this->_title;
return $this->title;
}
/**
@ -237,7 +237,7 @@ class PHPExcel_Chart
*/
public function setTitle(PHPExcel_Chart_Title $title)
{
$this->_title = $title;
$this->title = $title;
return $this;
}
@ -249,7 +249,7 @@ class PHPExcel_Chart
*/
public function getLegend()
{
return $this->_legend;
return $this->legend;
}
/**
@ -260,7 +260,7 @@ class PHPExcel_Chart
*/
public function setLegend(PHPExcel_Chart_Legend $legend)
{
$this->_legend = $legend;
$this->legend = $legend;
return $this;
}
@ -272,7 +272,7 @@ class PHPExcel_Chart
*/
public function getXAxisLabel()
{
return $this->_xAxisLabel;
return $this->xAxisLabel;
}
/**
@ -283,7 +283,7 @@ class PHPExcel_Chart
*/
public function setXAxisLabel(PHPExcel_Chart_Title $label)
{
$this->_xAxisLabel = $label;
$this->xAxisLabel = $label;
return $this;
}
@ -295,7 +295,7 @@ class PHPExcel_Chart
*/
public function getYAxisLabel()
{
return $this->_yAxisLabel;
return $this->yAxisLabel;
}
/**
@ -306,7 +306,7 @@ class PHPExcel_Chart
*/
public function setYAxisLabel(PHPExcel_Chart_Title $label)
{
$this->_yAxisLabel = $label;
$this->yAxisLabel = $label;
return $this;
}
@ -318,7 +318,7 @@ class PHPExcel_Chart
*/
public function getPlotArea()
{
return $this->_plotArea;
return $this->plotArea;
}
/**
@ -328,7 +328,7 @@ class PHPExcel_Chart
*/
public function getPlotVisibleOnly()
{
return $this->_plotVisibleOnly;
return $this->plotVisibleOnly;
}
/**
@ -339,7 +339,7 @@ class PHPExcel_Chart
*/
public function setPlotVisibleOnly($plotVisibleOnly = true)
{
$this->_plotVisibleOnly = $plotVisibleOnly;
$this->plotVisibleOnly = $plotVisibleOnly;
return $this;
}
@ -351,7 +351,7 @@ class PHPExcel_Chart
*/
public function getDisplayBlanksAs()
{
return $this->_displayBlanksAs;
return $this->displayBlanksAs;
}
/**
@ -362,7 +362,7 @@ class PHPExcel_Chart
*/
public function setDisplayBlanksAs($displayBlanksAs = '0')
{
$this->_displayBlanksAs = $displayBlanksAs;
$this->displayBlanksAs = $displayBlanksAs;
}
@ -373,8 +373,8 @@ class PHPExcel_Chart
*/
public function getChartAxisY()
{
if ($this->_yAxis !== null) {
return $this->_yAxis;
if ($this->yAxis !== null) {
return $this->yAxis;
}
return new PHPExcel_Chart_Axis();
@ -387,8 +387,8 @@ class PHPExcel_Chart
*/
public function getChartAxisX()
{
if ($this->_xAxis !== null) {
return $this->_xAxis;
if ($this->xAxis !== null) {
return $this->xAxis;
}
return new PHPExcel_Chart_Axis();
@ -401,8 +401,8 @@ class PHPExcel_Chart
*/
public function getMajorGridlines()
{
if ($this->_majorGridlines !== null) {
return $this->_majorGridlines;
if ($this->majorGridlines !== null) {
return $this->majorGridlines;
}
return new PHPExcel_Chart_GridLines();
@ -415,8 +415,8 @@ class PHPExcel_Chart
*/
public function getMinorGridlines()
{
if ($this->_minorGridlines !== null) {
return $this->_minorGridlines;
if ($this->minorGridlines !== null) {
return $this->minorGridlines;
}
return new PHPExcel_Chart_GridLines();
@ -433,7 +433,7 @@ class PHPExcel_Chart
*/
public function setTopLeftPosition($cell, $xOffset = null, $yOffset = null)
{
$this->_topLeftCellRef = $cell;
$this->topLeftCellRef = $cell;
if (!is_null($xOffset)) {
$this->setTopLeftXOffset($xOffset);
}
@ -452,9 +452,9 @@ class PHPExcel_Chart
public function getTopLeftPosition()
{
return array(
'cell' => $this->_topLeftCellRef,
'xOffset' => $this->_topLeftXOffset,
'yOffset' => $this->_topLeftYOffset
'cell' => $this->topLeftCellRef,
'xOffset' => $this->topLeftXOffset,
'yOffset' => $this->topLeftYOffset
);
}
@ -465,7 +465,7 @@ class PHPExcel_Chart
*/
public function getTopLeftCell()
{
return $this->_topLeftCellRef;
return $this->topLeftCellRef;
}
/**
@ -476,7 +476,7 @@ class PHPExcel_Chart
*/
public function setTopLeftCell($cell)
{
$this->_topLeftCellRef = $cell;
$this->topLeftCellRef = $cell;
return $this;
}
@ -508,33 +508,33 @@ class PHPExcel_Chart
public function getTopLeftOffset()
{
return array(
'X' => $this->_topLeftXOffset,
'Y' => $this->_topLeftYOffset
'X' => $this->topLeftXOffset,
'Y' => $this->topLeftYOffset
);
}
public function setTopLeftXOffset($xOffset)
{
$this->_topLeftXOffset = $xOffset;
$this->topLeftXOffset = $xOffset;
return $this;
}
public function getTopLeftXOffset()
{
return $this->_topLeftXOffset;
return $this->topLeftXOffset;
}
public function setTopLeftYOffset($yOffset)
{
$this->_topLeftYOffset = $yOffset;
$this->topLeftYOffset = $yOffset;
return $this;
}
public function getTopLeftYOffset()
{
return $this->_topLeftYOffset;
return $this->topLeftYOffset;
}
/**
@ -547,7 +547,7 @@ class PHPExcel_Chart
*/
public function setBottomRightPosition($cell, $xOffset = null, $yOffset = null)
{
$this->_bottomRightCellRef = $cell;
$this->bottomRightCellRef = $cell;
if (!is_null($xOffset)) {
$this->setBottomRightXOffset($xOffset);
}
@ -566,15 +566,15 @@ class PHPExcel_Chart
public function getBottomRightPosition()
{
return array(
'cell' => $this->_bottomRightCellRef,
'xOffset' => $this->_bottomRightXOffset,
'yOffset' => $this->_bottomRightYOffset
'cell' => $this->bottomRightCellRef,
'xOffset' => $this->bottomRightXOffset,
'yOffset' => $this->bottomRightYOffset
);
}
public function setBottomRightCell($cell)
{
$this->_bottomRightCellRef = $cell;
$this->bottomRightCellRef = $cell;
return $this;
}
@ -586,7 +586,7 @@ class PHPExcel_Chart
*/
public function getBottomRightCell()
{
return $this->_bottomRightCellRef;
return $this->bottomRightCellRef;
}
/**
@ -616,40 +616,40 @@ class PHPExcel_Chart
public function getBottomRightOffset()
{
return array(
'X' => $this->_bottomRightXOffset,
'Y' => $this->_bottomRightYOffset
'X' => $this->bottomRightXOffset,
'Y' => $this->bottomRightYOffset
);
}
public function setBottomRightXOffset($xOffset)
{
$this->_bottomRightXOffset = $xOffset;
$this->bottomRightXOffset = $xOffset;
return $this;
}
public function getBottomRightXOffset()
{
return $this->_bottomRightXOffset;
return $this->bottomRightXOffset;
}
public function setBottomRightYOffset($yOffset)
{
$this->_bottomRightYOffset = $yOffset;
$this->bottomRightYOffset = $yOffset;
return $this;
}
public function getBottomRightYOffset()
{
return $this->_bottomRightYOffset;
return $this->bottomRightYOffset;
}
public function refresh()
{
if ($this->_worksheet !== null) {
$this->_plotArea->refresh($this->_worksheet);
if ($this->worksheet !== null) {
$this->plotArea->refresh($this->worksheet);
}
}

View File

@ -32,63 +32,63 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*
* @var string
*/
private $_author;
private $author;
/**
* Rich text comment
*
* @var PHPExcel_RichText
*/
private $_text;
private $text;
/**
* Comment width (CSS style, i.e. XXpx or YYpt)
*
* @var string
*/
private $_width = '96pt';
private $width = '96pt';
/**
* Left margin (CSS style, i.e. XXpx or YYpt)
*
* @var string
*/
private $_marginLeft = '59.25pt';
private $marginLeft = '59.25pt';
/**
* Top margin (CSS style, i.e. XXpx or YYpt)
*
* @var string
*/
private $_marginTop = '1.5pt';
private $marginTop = '1.5pt';
/**
* Visible
*
* @var boolean
*/
private $_visible = false;
private $visible = false;
/**
* Comment height (CSS style, i.e. XXpx or YYpt)
*
* @var string
*/
private $_height = '55.5pt';
private $height = '55.5pt';
/**
* Comment fill color
*
* @var PHPExcel_Style_Color
*/
private $_fillColor;
private $fillColor;
/**
* Alignment
*
* @var string
*/
private $_alignment;
private $alignment;
/**
* Create a new PHPExcel_Comment
@ -98,10 +98,10 @@ class PHPExcel_Comment implements PHPExcel_IComparable
public function __construct()
{
// Initialise variables
$this->_author = 'Author';
$this->_text = new PHPExcel_RichText();
$this->_fillColor = new PHPExcel_Style_Color('FFFFFFE1');
$this->_alignment = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL;
$this->author = 'Author';
$this->text = new PHPExcel_RichText();
$this->fillColor = new PHPExcel_Style_Color('FFFFFFE1');
$this->alignment = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL;
}
/**
@ -111,7 +111,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/
public function getAuthor()
{
return $this->_author;
return $this->author;
}
/**
@ -122,7 +122,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/
public function setAuthor($pValue = '')
{
$this->_author = $pValue;
$this->author = $pValue;
return $this;
}
@ -133,7 +133,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/
public function getText()
{
return $this->_text;
return $this->text;
}
/**
@ -144,7 +144,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/
public function setText(PHPExcel_RichText $pValue)
{
$this->_text = $pValue;
$this->text = $pValue;
return $this;
}
@ -155,7 +155,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/
public function getWidth()
{
return $this->_width;
return $this->width;
}
/**
@ -166,7 +166,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/
public function setWidth($value = '96pt')
{
$this->_width = $value;
$this->width = $value;
return $this;
}
@ -177,7 +177,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/
public function getHeight()
{
return $this->_height;
return $this->height;
}
/**
@ -188,7 +188,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/
public function setHeight($value = '55.5pt')
{
$this->_height = $value;
$this->height = $value;
return $this;
}
@ -199,7 +199,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/
public function getMarginLeft()
{
return $this->_marginLeft;
return $this->marginLeft;
}
/**
@ -210,7 +210,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/
public function setMarginLeft($value = '59.25pt')
{
$this->_marginLeft = $value;
$this->marginLeft = $value;
return $this;
}
@ -221,7 +221,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/
public function getMarginTop()
{
return $this->_marginTop;
return $this->marginTop;
}
/**
@ -232,7 +232,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/
public function setMarginTop($value = '1.5pt')
{
$this->_marginTop = $value;
$this->marginTop = $value;
return $this;
}
@ -243,7 +243,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/
public function getVisible()
{
return $this->_visible;
return $this->visible;
}
/**
@ -254,7 +254,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/
public function setVisible($value = false)
{
$this->_visible = $value;
$this->visible = $value;
return $this;
}
@ -265,7 +265,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/
public function getFillColor()
{
return $this->_fillColor;
return $this->fillColor;
}
/**
@ -276,7 +276,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/
public function setAlignment($pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL)
{
$this->_alignment = $pValue;
$this->alignment = $pValue;
return $this;
}
@ -287,7 +287,7 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/
public function getAlignment()
{
return $this->_alignment;
return $this->alignment;
}
/**
@ -298,16 +298,16 @@ class PHPExcel_Comment implements PHPExcel_IComparable
public function getHashCode()
{
return md5(
$this->_author
. $this->_text->getHashCode()
. $this->_width
. $this->_height
. $this->_marginLeft
. $this->_marginTop
. ($this->_visible ? 1 : 0)
. $this->_fillColor->getHashCode()
. $this->_alignment
. __CLASS__
$this->author .
$this->text->getHashCode() .
$this->width .
$this->height .
$this->marginLeft .
$this->marginTop .
($this->visible ? 1 : 0) .
$this->fillColor->getHashCode() .
$this->alignment .
__CLASS__
);
}
@ -333,6 +333,6 @@ class PHPExcel_Comment implements PHPExcel_IComparable
*/
public function __toString()
{
return $this->_text->getPlainText();
return $this->text->getPlainText();
}
}

View File

@ -40,84 +40,84 @@ class PHPExcel_DocumentProperties
*
* @var string
*/
private $_creator = 'Unknown Creator';
private $creator = 'Unknown Creator';
/**
* LastModifiedBy
*
* @var string
*/
private $_lastModifiedBy;
private $lastModifiedBy;
/**
* Created
*
* @var datetime
*/
private $_created;
private $created;
/**
* Modified
*
* @var datetime
*/
private $_modified;
private $modified;
/**
* Title
*
* @var string
*/
private $_title = 'Untitled Spreadsheet';
private $title = 'Untitled Spreadsheet';
/**
* Description
*
* @var string
*/
private $_description = '';
private $description = '';
/**
* Subject
*
* @var string
*/
private $_subject = '';
private $subject = '';
/**
* Keywords
*
* @var string
*/
private $_keywords = '';
private $keywords = '';
/**
* Category
*
* @var string
*/
private $_category = '';
private $category = '';
/**
* Manager
*
* @var string
*/
private $_manager = '';
private $manager = '';
/**
* Company
*
* @var string
*/
private $_company = 'Microsoft Corporation';
private $company = 'Microsoft Corporation';
/**
* Custom Properties
*
* @var string
*/
private $_customProperties = array();
private $customProperties = array();
/**
@ -126,9 +126,9 @@ class PHPExcel_DocumentProperties
public function __construct()
{
// Initialise values
$this->_lastModifiedBy = $this->_creator;
$this->_created = time();
$this->_modified = time();
$this->lastModifiedBy = $this->creator;
$this->created = time();
$this->modified = time();
}
/**
@ -138,7 +138,7 @@ class PHPExcel_DocumentProperties
*/
public function getCreator()
{
return $this->_creator;
return $this->creator;
}
/**
@ -149,7 +149,7 @@ class PHPExcel_DocumentProperties
*/
public function setCreator($pValue = '')
{
$this->_creator = $pValue;
$this->creator = $pValue;
return $this;
}
@ -160,7 +160,7 @@ class PHPExcel_DocumentProperties
*/
public function getLastModifiedBy()
{
return $this->_lastModifiedBy;
return $this->lastModifiedBy;
}
/**
@ -171,7 +171,7 @@ class PHPExcel_DocumentProperties
*/
public function setLastModifiedBy($pValue = '')
{
$this->_lastModifiedBy = $pValue;
$this->lastModifiedBy = $pValue;
return $this;
}
@ -182,7 +182,7 @@ class PHPExcel_DocumentProperties
*/
public function getCreated()
{
return $this->_created;
return $this->created;
}
/**
@ -203,7 +203,7 @@ class PHPExcel_DocumentProperties
}
}
$this->_created = $pValue;
$this->created = $pValue;
return $this;
}
@ -214,7 +214,7 @@ class PHPExcel_DocumentProperties
*/
public function getModified()
{
return $this->_modified;
return $this->modified;
}
/**
@ -235,7 +235,7 @@ class PHPExcel_DocumentProperties
}
}
$this->_modified = $pValue;
$this->modified = $pValue;
return $this;
}
@ -246,7 +246,7 @@ class PHPExcel_DocumentProperties
*/
public function getTitle()
{
return $this->_title;
return $this->title;
}
/**
@ -257,7 +257,7 @@ class PHPExcel_DocumentProperties
*/
public function setTitle($pValue = '')
{
$this->_title = $pValue;
$this->title = $pValue;
return $this;
}
@ -268,7 +268,7 @@ class PHPExcel_DocumentProperties
*/
public function getDescription()
{
return $this->_description;
return $this->description;
}
/**
@ -279,7 +279,7 @@ class PHPExcel_DocumentProperties
*/
public function setDescription($pValue = '')
{
$this->_description = $pValue;
$this->description = $pValue;
return $this;
}
@ -290,7 +290,7 @@ class PHPExcel_DocumentProperties
*/
public function getSubject()
{
return $this->_subject;
return $this->subject;
}
/**
@ -301,7 +301,7 @@ class PHPExcel_DocumentProperties
*/
public function setSubject($pValue = '')
{
$this->_subject = $pValue;
$this->subject = $pValue;
return $this;
}
@ -312,7 +312,7 @@ class PHPExcel_DocumentProperties
*/
public function getKeywords()
{
return $this->_keywords;
return $this->keywords;
}
/**
@ -323,7 +323,7 @@ class PHPExcel_DocumentProperties
*/
public function setKeywords($pValue = '')
{
$this->_keywords = $pValue;
$this->keywords = $pValue;
return $this;
}
@ -334,7 +334,7 @@ class PHPExcel_DocumentProperties
*/
public function getCategory()
{
return $this->_category;
return $this->category;
}
/**
@ -345,7 +345,7 @@ class PHPExcel_DocumentProperties
*/
public function setCategory($pValue = '')
{
$this->_category = $pValue;
$this->category = $pValue;
return $this;
}
@ -356,7 +356,7 @@ class PHPExcel_DocumentProperties
*/
public function getCompany()
{
return $this->_company;
return $this->company;
}
/**
@ -367,7 +367,7 @@ class PHPExcel_DocumentProperties
*/
public function setCompany($pValue = '')
{
$this->_company = $pValue;
$this->company = $pValue;
return $this;
}
@ -378,7 +378,7 @@ class PHPExcel_DocumentProperties
*/
public function getManager()
{
return $this->_manager;
return $this->manager;
}
/**
@ -389,7 +389,7 @@ class PHPExcel_DocumentProperties
*/
public function setManager($pValue = '')
{
$this->_manager = $pValue;
$this->manager = $pValue;
return $this;
}
@ -400,7 +400,7 @@ class PHPExcel_DocumentProperties
*/
public function getCustomProperties()
{
return array_keys($this->_customProperties);
return array_keys($this->customProperties);
}
/**
@ -411,7 +411,7 @@ class PHPExcel_DocumentProperties
*/
public function isCustomPropertySet($propertyName)
{
return isset($this->_customProperties[$propertyName]);
return isset($this->customProperties[$propertyName]);
}
/**
@ -422,8 +422,8 @@ class PHPExcel_DocumentProperties
*/
public function getCustomPropertyValue($propertyName)
{
if (isset($this->_customProperties[$propertyName])) {
return $this->_customProperties[$propertyName]['value'];
if (isset($this->customProperties[$propertyName])) {
return $this->customProperties[$propertyName]['value'];
}
}
@ -436,8 +436,8 @@ class PHPExcel_DocumentProperties
*/
public function getCustomPropertyType($propertyName)
{
if (isset($this->_customProperties[$propertyName])) {
return $this->_customProperties[$propertyName]['type'];
if (isset($this->customProperties[$propertyName])) {
return $this->customProperties[$propertyName]['type'];
}
}
@ -475,7 +475,7 @@ class PHPExcel_DocumentProperties
}
}
$this->_customProperties[$propertyName] = array(
$this->customProperties[$propertyName] = array(
'value' => $propertyValue,
'type' => $propertyType
);

View File

@ -32,14 +32,14 @@ class PHPExcel_HashTable
*
* @var array
*/
public $_items = array();
protected $items = array();
/**
* HashTable key map
*
* @var array
*/
public $_keyMap = array();
protected $keyMap = array();
/**
* Create a new PHPExcel_HashTable
@ -84,9 +84,9 @@ class PHPExcel_HashTable
public function add(PHPExcel_IComparable $pSource = null)
{
$hash = $pSource->getHashCode();
if (!isset($this->_items[$hash])) {
$this->_items[$hash] = $pSource;
$this->_keyMap[count($this->_items) - 1] = $hash;
if (!isset($this->items[$hash])) {
$this->items[$hash] = $pSource;
$this->keyMap[count($this->items) - 1] = $hash;
}
}
@ -99,20 +99,20 @@ class PHPExcel_HashTable
public function remove(PHPExcel_IComparable $pSource = null)
{
$hash = $pSource->getHashCode();
if (isset($this->_items[$hash])) {
unset($this->_items[$hash]);
if (isset($this->items[$hash])) {
unset($this->items[$hash]);
$deleteKey = -1;
foreach ($this->_keyMap as $key => $value) {
foreach ($this->keyMap as $key => $value) {
if ($deleteKey >= 0) {
$this->_keyMap[$key - 1] = $value;
$this->keyMap[$key - 1] = $value;
}
if ($value == $hash) {
$deleteKey = $key;
}
}
unset($this->_keyMap[count($this->_keyMap) - 1]);
unset($this->keyMap[count($this->keyMap) - 1]);
}
}
@ -122,8 +122,8 @@ class PHPExcel_HashTable
*/
public function clear()
{
$this->_items = array();
$this->_keyMap = array();
$this->items = array();
$this->keyMap = array();
}
/**
@ -133,7 +133,7 @@ class PHPExcel_HashTable
*/
public function count()
{
return count($this->_items);
return count($this->items);
}
/**
@ -144,7 +144,7 @@ class PHPExcel_HashTable
*/
public function getIndexForHashCode($pHashCode = '')
{
return array_search($pHashCode, $this->_keyMap);
return array_search($pHashCode, $this->keyMap);
}
/**
@ -156,8 +156,8 @@ class PHPExcel_HashTable
*/
public function getByIndex($pIndex = 0)
{
if (isset($this->_keyMap[$pIndex])) {
return $this->getByHashCode($this->_keyMap[$pIndex]);
if (isset($this->keyMap[$pIndex])) {
return $this->getByHashCode($this->keyMap[$pIndex]);
}
return null;
@ -172,8 +172,8 @@ class PHPExcel_HashTable
*/
public function getByHashCode($pHashCode = '')
{
if (isset($this->_items[$pHashCode])) {
return $this->_items[$pHashCode];
if (isset($this->items[$pHashCode])) {
return $this->items[$pHashCode];
}
return null;
@ -186,7 +186,7 @@ class PHPExcel_HashTable
*/
public function toArray()
{
return $this->_items;
return $this->items;
}
/**

View File

@ -25,14 +25,14 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Worksheet_ColumnDimension
class PHPExcel_Worksheet_ColumnDimension extends PHPExcel_Worksheet_Dimension
{
/**
* Column index
*
* @var int
*/
private $_columnIndex;
private $columnIndex;
/**
* Column width
@ -41,42 +41,14 @@ class PHPExcel_Worksheet_ColumnDimension
*
* @var double
*/
private $_width = -1;
private $width = -1;
/**
* Auto size?
*
* @var bool
*/
private $_autoSize = false;
/**
* Visible?
*
* @var bool
*/
private $_visible = true;
/**
* Outline level
*
* @var int
*/
private $_outlineLevel = 0;
/**
* Collapsed
*
* @var bool
*/
private $_collapsed = false;
/**
* Index to cellXf
*
* @var int
*/
private $_xfIndex;
private $autoSize = false;
/**
* Create a new PHPExcel_Worksheet_ColumnDimension
@ -86,10 +58,10 @@ class PHPExcel_Worksheet_ColumnDimension
public function __construct($pIndex = 'A')
{
// Initialise values
$this->_columnIndex = $pIndex;
$this->columnIndex = $pIndex;
// set default index to cellXf
$this->_xfIndex = 0;
// set dimension as unformatted by default
parent::__construct(0);
}
/**
@ -99,7 +71,7 @@ class PHPExcel_Worksheet_ColumnDimension
*/
public function getColumnIndex()
{
return $this->_columnIndex;
return $this->columnIndex;
}
/**
@ -110,7 +82,7 @@ class PHPExcel_Worksheet_ColumnDimension
*/
public function setColumnIndex($pValue)
{
$this->_columnIndex = $pValue;
$this->columnIndex = $pValue;
return $this;
}
@ -121,7 +93,7 @@ class PHPExcel_Worksheet_ColumnDimension
*/
public function getWidth()
{
return $this->_width;
return $this->width;
}
/**
@ -132,7 +104,7 @@ class PHPExcel_Worksheet_ColumnDimension
*/
public function setWidth($pValue = -1)
{
$this->_width = $pValue;
$this->width = $pValue;
return $this;
}
@ -143,7 +115,7 @@ class PHPExcel_Worksheet_ColumnDimension
*/
public function getAutoSize()
{
return $this->_autoSize;
return $this->autoSize;
}
/**
@ -154,117 +126,7 @@ class PHPExcel_Worksheet_ColumnDimension
*/
public function setAutoSize($pValue = false)
{
$this->_autoSize = $pValue;
$this->autoSize = $pValue;
return $this;
}
/**
* Get Visible
*
* @return bool
*/
public function getVisible()
{
return $this->_visible;
}
/**
* Set Visible
*
* @param bool $pValue
* @return PHPExcel_Worksheet_ColumnDimension
*/
public function setVisible($pValue = true)
{
$this->_visible = $pValue;
return $this;
}
/**
* Get Outline Level
*
* @return int
*/
public function getOutlineLevel()
{
return $this->_outlineLevel;
}
/**
* Set Outline Level
*
* Value must be between 0 and 7
*
* @param int $pValue
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_ColumnDimension
*/
public function setOutlineLevel($pValue)
{
if ($pValue < 0 || $pValue > 7) {
throw new PHPExcel_Exception("Outline level must range between 0 and 7.");
}
$this->_outlineLevel = $pValue;
return $this;
}
/**
* Get Collapsed
*
* @return bool
*/
public function getCollapsed()
{
return $this->_collapsed;
}
/**
* Set Collapsed
*
* @param bool $pValue
* @return PHPExcel_Worksheet_ColumnDimension
*/
public function setCollapsed($pValue = true)
{
$this->_collapsed = $pValue;
return $this;
}
/**
* Get index to cellXf
*
* @return int
*/
public function getXfIndex()
{
return $this->_xfIndex;
}
/**
* Set index to cellXf
*
* @param int $pValue
* @return PHPExcel_Worksheet_ColumnDimension
*/
public function setXfIndex($pValue = 0)
{
$this->_xfIndex = $pValue;
return $this;
}
/**
* Implement PHP __clone to create a deep clone, not just a shallow copy.
*/
public function __clone()
{
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if (is_object($value)) {
$this->$key = clone $value;
} else {
$this->$key = $value;
}
}
}
}

View File

@ -0,0 +1,178 @@
<?php
/**
* PHPExcel_Worksheet_Dimension
*
* Copyright (c) 2006 - 2015 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
abstract class PHPExcel_Worksheet_Dimension
{
/**
* Visible?
*
* @var bool
*/
private $visible = true;
/**
* Outline level
*
* @var int
*/
private $outlineLevel = 0;
/**
* Collapsed
*
* @var bool
*/
private $collapsed = false;
/**
* Index to cellXf. Null value means row has no explicit cellXf format.
*
* @var int|null
*/
private $xfIndex;
/**
* Create a new PHPExcel_Worksheet_Dimension
*
* @param int $pIndex Numeric row index
*/
public function __construct($initialValue = null)
{
// set dimension as unformatted by default
$this->xfIndex = $initialValue;
}
/**
* Get Visible
*
* @return bool
*/
public function getVisible()
{
return $this->visible;
}
/**
* Set Visible
*
* @param bool $pValue
* @return PHPExcel_Worksheet_Dimension
*/
public function setVisible($pValue = true)
{
$this->visible = $pValue;
return $this;
}
/**
* Get Outline Level
*
* @return int
*/
public function getOutlineLevel()
{
return $this->outlineLevel;
}
/**
* Set Outline Level
*
* Value must be between 0 and 7
*
* @param int $pValue
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_Dimension
*/
public function setOutlineLevel($pValue)
{
if ($pValue < 0 || $pValue > 7) {
throw new PHPExcel_Exception("Outline level must range between 0 and 7.");
}
$this->outlineLevel = $pValue;
return $this;
}
/**
* Get Collapsed
*
* @return bool
*/
public function getCollapsed()
{
return $this->collapsed;
}
/**
* Set Collapsed
*
* @param bool $pValue
* @return PHPExcel_Worksheet_Dimension
*/
public function setCollapsed($pValue = true)
{
$this->collapsed = $pValue;
return $this;
}
/**
* Get index to cellXf
*
* @return int
*/
public function getXfIndex()
{
return $this->xfIndex;
}
/**
* Set index to cellXf
*
* @param int $pValue
* @return PHPExcel_Worksheet_Dimension
*/
public function setXfIndex($pValue = 0)
{
$this->xfIndex = $pValue;
return $this;
}
/**
* Implement PHP __clone to create a deep clone, not just a shallow copy.
*/
public function __clone()
{
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if (is_object($value)) {
$this->$key = clone $value;
} else {
$this->$key = $value;
}
}
}
}

View File

@ -25,14 +25,14 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Worksheet_RowDimension
class PHPExcel_Worksheet_RowDimension extends PHPExcel_Worksheet_Dimension
{
/**
* Row index
*
* @var int
*/
private $_rowIndex;
private $rowIndex;
/**
* Row height (in pt)
@ -41,42 +41,14 @@ class PHPExcel_Worksheet_RowDimension
*
* @var double
*/
private $_rowHeight = -1;
private $height = -1;
/**
* ZeroHeight for Row?
*
* @var bool
*/
private $_zeroHeight = false;
/**
* Visible?
*
* @var bool
*/
private $_visible = true;
/**
* Outline level
*
* @var int
*/
private $_outlineLevel = 0;
/**
* Collapsed
*
* @var bool
*/
private $_collapsed = false;
/**
* Index to cellXf. Null value means row has no explicit cellXf format.
*
* @var int|null
*/
private $_xfIndex;
private $zeroHeight = false;
/**
* Create a new PHPExcel_Worksheet_RowDimension
@ -86,10 +58,10 @@ class PHPExcel_Worksheet_RowDimension
public function __construct($pIndex = 0)
{
// Initialise values
$this->_rowIndex = $pIndex;
$this->rowIndex = $pIndex;
// set row dimension as unformatted by default
$this->_xfIndex = null;
// set dimension as unformatted by default
parent::__construct(null);
}
/**
@ -99,7 +71,7 @@ class PHPExcel_Worksheet_RowDimension
*/
public function getRowIndex()
{
return $this->_rowIndex;
return $this->rowIndex;
}
/**
@ -110,7 +82,7 @@ class PHPExcel_Worksheet_RowDimension
*/
public function setRowIndex($pValue)
{
$this->_rowIndex = $pValue;
$this->rowIndex = $pValue;
return $this;
}
@ -121,7 +93,7 @@ class PHPExcel_Worksheet_RowDimension
*/
public function getRowHeight()
{
return $this->_rowHeight;
return $this->height;
}
/**
@ -132,7 +104,7 @@ class PHPExcel_Worksheet_RowDimension
*/
public function setRowHeight($pValue = -1)
{
$this->_rowHeight = $pValue;
$this->height = $pValue;
return $this;
}
@ -143,7 +115,7 @@ class PHPExcel_Worksheet_RowDimension
*/
public function getZeroHeight()
{
return $this->_zeroHeight;
return $this->zeroHeight;
}
/**
@ -154,117 +126,7 @@ class PHPExcel_Worksheet_RowDimension
*/
public function setZeroHeight($pValue = false)
{
$this->_zeroHeight = $pValue;
$this->zeroHeight = $pValue;
return $this;
}
/**
* Get Visible
*
* @return bool
*/
public function getVisible()
{
return $this->_visible;
}
/**
* Set Visible
*
* @param bool $pValue
* @return PHPExcel_Worksheet_RowDimension
*/
public function setVisible($pValue = true)
{
$this->_visible = $pValue;
return $this;
}
/**
* Get Outline Level
*
* @return int
*/
public function getOutlineLevel()
{
return $this->_outlineLevel;
}
/**
* Set Outline Level
*
* Value must be between 0 and 7
*
* @param int $pValue
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_RowDimension
*/
public function setOutlineLevel($pValue)
{
if ($pValue < 0 || $pValue > 7) {
throw new PHPExcel_Exception("Outline level must range between 0 and 7.");
}
$this->_outlineLevel = $pValue;
return $this;
}
/**
* Get Collapsed
*
* @return bool
*/
public function getCollapsed()
{
return $this->_collapsed;
}
/**
* Set Collapsed
*
* @param bool $pValue
* @return PHPExcel_Worksheet_RowDimension
*/
public function setCollapsed($pValue = true)
{
$this->_collapsed = $pValue;
return $this;
}
/**
* Get index to cellXf
*
* @return int
*/
public function getXfIndex()
{
return $this->_xfIndex;
}
/**
* Set index to cellXf
*
* @param int $pValue
* @return PHPExcel_Worksheet_RowDimension
*/
public function setXfIndex($pValue = 0)
{
$this->_xfIndex = $pValue;
return $this;
}
/**
* Implement PHP __clone to create a deep clone, not just a shallow copy.
*/
public function __clone()
{
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
if (is_object($value)) {
$this->$key = clone $value;
} else {
$this->$key = $value;
}
}
}
}

View File

@ -1,6 +1,7 @@
<?php
/**
* PHPExcel
* PHPExcel_Worksheet_SheetView
*
* Copyright (c) 2006 - 2015 PHPExcel
*
@ -24,15 +25,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
/**
* PHPExcel_Worksheet_SheetView
*
* @category PHPExcel
* @package PHPExcel_Worksheet
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class PHPExcel_Worksheet_SheetView
{
@ -54,7 +46,7 @@ class PHPExcel_Worksheet_SheetView
*
* @var int
*/
private $_zoomScale = 100;
private $zoomScale = 100;
/**
* ZoomScaleNormal
@ -63,7 +55,7 @@ class PHPExcel_Worksheet_SheetView
*
* @var int
*/
private $_zoomScaleNormal = 100;
private $zoomScaleNormal = 100;
/**
* View
@ -72,7 +64,7 @@ class PHPExcel_Worksheet_SheetView
*
* @var string
*/
private $_sheetviewType = self::SHEETVIEW_NORMAL;
private $sheetviewType = self::SHEETVIEW_NORMAL;
/**
* Create a new PHPExcel_Worksheet_SheetView
@ -88,7 +80,7 @@ class PHPExcel_Worksheet_SheetView
*/
public function getZoomScale()
{
return $this->_zoomScale;
return $this->zoomScale;
}
/**
@ -105,7 +97,7 @@ class PHPExcel_Worksheet_SheetView
// Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
// but it is apparently still able to handle any scale >= 1
if (($pValue >= 1) || is_null($pValue)) {
$this->_zoomScale = $pValue;
$this->zoomScale = $pValue;
} else {
throw new PHPExcel_Exception("Scale must be greater than or equal to 1.");
}
@ -119,7 +111,7 @@ class PHPExcel_Worksheet_SheetView
*/
public function getZoomScaleNormal()
{
return $this->_zoomScaleNormal;
return $this->zoomScaleNormal;
}
/**
@ -134,7 +126,7 @@ class PHPExcel_Worksheet_SheetView
public function setZoomScaleNormal($pValue = 100)
{
if (($pValue >= 1) || is_null($pValue)) {
$this->_zoomScaleNormal = $pValue;
$this->zoomScaleNormal = $pValue;
} else {
throw new PHPExcel_Exception("Scale must be greater than or equal to 1.");
}
@ -148,7 +140,7 @@ class PHPExcel_Worksheet_SheetView
*/
public function getView()
{
return $this->_sheetviewType;
return $this->sheetviewType;
}
/**
@ -170,7 +162,7 @@ class PHPExcel_Worksheet_SheetView
$pValue = self::SHEETVIEW_NORMAL;
}
if (in_array($pValue, self::$_sheetViewTypes)) {
$this->_sheetviewType = $pValue;
$this->sheetviewType = $pValue;
} else {
throw new PHPExcel_Exception("Invalid sheetview layout type.");
}