PSR-2 : Fixes

This commit is contained in:
Progi1984 2015-05-13 13:36:53 +02:00
parent 7d086fdbee
commit 141a61a908
7 changed files with 246 additions and 154 deletions

View File

@ -79,7 +79,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
* *
* @var PHPExcel_Worksheet_AutoFilter * @var PHPExcel_Worksheet_AutoFilter
*/ */
private $_parent = NULL; private $_parent = null;
/** /**
@ -128,7 +128,7 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @param string $pColumn Column (e.g. A) * @param string $pColumn Column (e.g. A)
* @param PHPExcel_Worksheet_AutoFilter $pParent Autofilter for this column * @param PHPExcel_Worksheet_AutoFilter $pParent Autofilter for this column
*/ */
public function __construct($pColumn, PHPExcel_Worksheet_AutoFilter $pParent = NULL) public function __construct($pColumn, PHPExcel_Worksheet_AutoFilter $pParent = null)
{ {
$this->_columnIndex = $pColumn; $this->_columnIndex = $pColumn;
$this->_parent = $pParent; $this->_parent = $pParent;
@ -139,7 +139,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* *
* @return string * @return string
*/ */
public function getColumnIndex() { public function getColumnIndex()
{
return $this->_columnIndex; return $this->_columnIndex;
} }
@ -150,10 +151,11 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function setColumnIndex($pColumn) { public function setColumnIndex($pColumn)
{
// Uppercase coordinate // Uppercase coordinate
$pColumn = strtoupper($pColumn); $pColumn = strtoupper($pColumn);
if ($this->_parent !== NULL) { if ($this->_parent !== null) {
$this->_parent->testColumnInRange($pColumn); $this->_parent->testColumnInRange($pColumn);
} }
@ -167,7 +169,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* *
* @return PHPExcel_Worksheet_AutoFilter * @return PHPExcel_Worksheet_AutoFilter
*/ */
public function getParent() { public function getParent()
{
return $this->_parent; return $this->_parent;
} }
@ -177,7 +180,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @param PHPExcel_Worksheet_AutoFilter * @param PHPExcel_Worksheet_AutoFilter
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function setParent(PHPExcel_Worksheet_AutoFilter $pParent = NULL) { public function setParent(PHPExcel_Worksheet_AutoFilter $pParent = null)
{
$this->_parent = $pParent; $this->_parent = $pParent;
return $this; return $this;
@ -188,7 +192,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* *
* @return string * @return string
*/ */
public function getFilterType() { public function getFilterType()
{
return $this->_filterType; return $this->_filterType;
} }
@ -199,8 +204,9 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function setFilterType($pFilterType = self::AUTOFILTER_FILTERTYPE_FILTER) { public function setFilterType($pFilterType = self::AUTOFILTER_FILTERTYPE_FILTER)
if (!in_array($pFilterType,self::$_filterTypes)) { {
if (!in_array($pFilterType, self::$_filterTypes)) {
throw new PHPExcel_Exception('Invalid filter type for column AutoFilter.'); throw new PHPExcel_Exception('Invalid filter type for column AutoFilter.');
} }
@ -225,10 +231,11 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function setJoin($pJoin = self::AUTOFILTER_COLUMN_JOIN_OR) { public function setJoin($pJoin = self::AUTOFILTER_COLUMN_JOIN_OR)
{
// Lowercase And/Or // Lowercase And/Or
$pJoin = strtolower($pJoin); $pJoin = strtolower($pJoin);
if (!in_array($pJoin,self::$_ruleJoins)) { if (!in_array($pJoin, self::$_ruleJoins)) {
throw new PHPExcel_Exception('Invalid rule connection for column AutoFilter.'); throw new PHPExcel_Exception('Invalid rule connection for column AutoFilter.');
} }
@ -244,7 +251,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function setAttributes($pAttributes = array()) { public function setAttributes($pAttributes = array())
{
$this->_attributes = $pAttributes; $this->_attributes = $pAttributes;
return $this; return $this;
@ -258,7 +266,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function setAttribute($pName, $pValue) { public function setAttribute($pName, $pValue)
{
$this->_attributes[$pName] = $pValue; $this->_attributes[$pName] = $pValue;
return $this; return $this;
@ -269,7 +278,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* *
* @return string * @return string
*/ */
public function getAttributes() { public function getAttributes()
{
return $this->_attributes; return $this->_attributes;
} }
@ -279,10 +289,12 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @param string $pName Attribute Name * @param string $pName Attribute Name
* @return string * @return string
*/ */
public function getAttribute($pName) { public function getAttribute($pName)
if (isset($this->_attributes[$pName])) {
if (isset($this->_attributes[$pName])) {
return $this->_attributes[$pName]; return $this->_attributes[$pName];
return NULL; }
return null;
} }
/** /**
@ -291,7 +303,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return array of PHPExcel_Worksheet_AutoFilter_Column_Rule * @return array of PHPExcel_Worksheet_AutoFilter_Column_Rule
*/ */
public function getRules() { public function getRules()
{
return $this->_ruleset; return $this->_ruleset;
} }
@ -301,7 +314,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @param integer $pIndex Rule index in the ruleset array * @param integer $pIndex Rule index in the ruleset array
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
*/ */
public function getRule($pIndex) { public function getRule($pIndex)
{
if (!isset($this->_ruleset[$pIndex])) { if (!isset($this->_ruleset[$pIndex])) {
$this->_ruleset[$pIndex] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this); $this->_ruleset[$pIndex] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this);
} }
@ -313,7 +327,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* *
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
*/ */
public function createRule() { public function createRule()
{
$this->_ruleset[] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this); $this->_ruleset[] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this);
return end($this->_ruleset); return end($this->_ruleset);
@ -326,7 +341,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @param boolean $returnRule Flag indicating whether the rule object or the column object should be returned * @param boolean $returnRule Flag indicating whether the rule object or the column object should be returned
* @return PHPExcel_Worksheet_AutoFilter_Column|PHPExcel_Worksheet_AutoFilter_Column_Rule * @return PHPExcel_Worksheet_AutoFilter_Column|PHPExcel_Worksheet_AutoFilter_Column_Rule
*/ */
public function addRule(PHPExcel_Worksheet_AutoFilter_Column_Rule $pRule, $returnRule=TRUE) { public function addRule(PHPExcel_Worksheet_AutoFilter_Column_Rule $pRule, $returnRule = true)
{
$pRule->setParent($this); $pRule->setParent($this);
$this->_ruleset[] = $pRule; $this->_ruleset[] = $pRule;
@ -340,7 +356,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* @param integer $pIndex Rule index in the ruleset array * @param integer $pIndex Rule index in the ruleset array
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function deleteRule($pIndex) { public function deleteRule($pIndex)
{
if (isset($this->_ruleset[$pIndex])) { if (isset($this->_ruleset[$pIndex])) {
unset($this->_ruleset[$pIndex]); unset($this->_ruleset[$pIndex]);
// If we've just deleted down to a single rule, then reset And/Or joining to Or // If we've just deleted down to a single rule, then reset And/Or joining to Or
@ -357,7 +374,8 @@ class PHPExcel_Worksheet_AutoFilter_Column
* *
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function clearRules() { public function clearRules()
{
$this->_ruleset = array(); $this->_ruleset = array();
$this->setJoin(self::AUTOFILTER_COLUMN_JOIN_OR); $this->setJoin(self::AUTOFILTER_COLUMN_JOIN_OR);
@ -367,13 +385,14 @@ class PHPExcel_Worksheet_AutoFilter_Column
/** /**
* Implement PHP __clone to create a deep clone, not just a shallow copy. * Implement PHP __clone to create a deep clone, not just a shallow copy.
*/ */
public function __clone() { public function __clone()
{
$vars = get_object_vars($this); $vars = get_object_vars($this);
foreach ($vars as $key => $value) { foreach ($vars as $key => $value) {
if (is_object($value)) { if (is_object($value)) {
if ($key == '_parent') { if ($key == '_parent') {
// Detach from autofilter parent // Detach from autofilter parent
$this->$key = NULL; $this->$key = null;
} else { } else {
$this->$key = clone $value; $this->$key = clone $value;
} }

View File

@ -234,7 +234,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* *
* @var PHPExcel_Worksheet_AutoFilter_Column * @var PHPExcel_Worksheet_AutoFilter_Column
*/ */
private $_parent = NULL; private $_parent = null;
/** /**
@ -272,7 +272,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* *
* @param PHPExcel_Worksheet_AutoFilter_Column $pParent * @param PHPExcel_Worksheet_AutoFilter_Column $pParent
*/ */
public function __construct(PHPExcel_Worksheet_AutoFilter_Column $pParent = NULL) public function __construct(PHPExcel_Worksheet_AutoFilter_Column $pParent = null)
{ {
$this->_parent = $pParent; $this->_parent = $pParent;
} }
@ -282,7 +282,8 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* *
* @return string * @return string
*/ */
public function getRuleType() { public function getRuleType()
{
return $this->_ruleType; return $this->_ruleType;
} }
@ -293,8 +294,9 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function setRuleType($pRuleType = self::AUTOFILTER_RULETYPE_FILTER) { public function setRuleType($pRuleType = self::AUTOFILTER_RULETYPE_FILTER)
if (!in_array($pRuleType,self::$_ruleTypes)) { {
if (!in_array($pRuleType, self::$_ruleTypes)) {
throw new PHPExcel_Exception('Invalid rule type for column AutoFilter Rule.'); throw new PHPExcel_Exception('Invalid rule type for column AutoFilter Rule.');
} }
@ -308,7 +310,8 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* *
* @return string * @return string
*/ */
public function getValue() { public function getValue()
{
return $this->_value; return $this->_value;
} }
@ -319,17 +322,18 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
*/ */
public function setValue($pValue = '') { public function setValue($pValue = '')
{
if (is_array($pValue)) { if (is_array($pValue)) {
$grouping = -1; $grouping = -1;
foreach ($pValue as $key => $value) { foreach ($pValue as $key => $value) {
// Validate array entries // Validate array entries
if (!in_array($key,self::$_dateTimeGroups)) { if (!in_array($key, self::$_dateTimeGroups)) {
// Remove any invalid entries from the value array // Remove any invalid entries from the value array
unset($pValue[$key]); unset($pValue[$key]);
} else { } else {
// Work out what the dateTime grouping will be // Work out what the dateTime grouping will be
$grouping = max($grouping,array_search($key,self::$_dateTimeGroups)); $grouping = max($grouping, array_search($key,self::$_dateTimeGroups));
} }
} }
if (count($pValue) == 0) { if (count($pValue) == 0) {
@ -348,7 +352,8 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* *
* @return string * @return string
*/ */
public function getOperator() { public function getOperator()
{
return $this->_operator; return $this->_operator;
} }
@ -359,11 +364,13 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
*/ */
public function setOperator($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL) { public function setOperator($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL)
if (empty($pOperator)) {
if (empty($pOperator)) {
$pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL; $pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL;
if ((!in_array($pOperator,self::$_operators)) && }
(!in_array($pOperator,self::$_topTenValue))) { if ((!in_array($pOperator, self::$_operators)) &&
(!in_array($pOperator, self::$_topTenValue))) {
throw new PHPExcel_Exception('Invalid operator for column AutoFilter Rule.'); throw new PHPExcel_Exception('Invalid operator for column AutoFilter Rule.');
} }
$this->_operator = $pOperator; $this->_operator = $pOperator;
@ -376,7 +383,8 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* *
* @return string * @return string
*/ */
public function getGrouping() { public function getGrouping()
{
return $this->_grouping; return $this->_grouping;
} }
@ -387,14 +395,14 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
*/ */
public function setGrouping($pGrouping = NULL) { public function setGrouping($pGrouping = null)
if (($pGrouping !== NULL) && {
(!in_array($pGrouping,self::$_dateTimeGroups)) && if (($pGrouping !== null) &&
(!in_array($pGrouping,self::$_dynamicTypes)) && (!in_array($pGrouping, self::$_dateTimeGroups)) &&
(!in_array($pGrouping,self::$_topTenType))) { (!in_array($pGrouping, self::$_dynamicTypes)) &&
(!in_array($pGrouping, self::$_topTenType))) {
throw new PHPExcel_Exception('Invalid rule type for column AutoFilter Rule.'); throw new PHPExcel_Exception('Invalid rule type for column AutoFilter Rule.');
} }
$this->_grouping = $pGrouping; $this->_grouping = $pGrouping;
return $this; return $this;
@ -409,14 +417,16 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
*/ */
public function setRule($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL, $pValue = '', $pGrouping = NULL) { public function setRule($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL, $pValue = '', $pGrouping = null)
{
$this->setOperator($pOperator); $this->setOperator($pOperator);
$this->setValue($pValue); $this->setValue($pValue);
// Only set grouping if it's been passed in as a user-supplied argument, // Only set grouping if it's been passed in as a user-supplied argument,
// otherwise we're calculating it when we setValue() and don't want to overwrite that // otherwise we're calculating it when we setValue() and don't want to overwrite that
// If the user supplies an argumnet for grouping, then on their own head be it // If the user supplies an argumnet for grouping, then on their own head be it
if ($pGrouping !== NULL) if ($pGrouping !== null) {
$this->setGrouping($pGrouping); $this->setGrouping($pGrouping);
}
return $this; return $this;
} }
@ -426,7 +436,8 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* *
* @return PHPExcel_Worksheet_AutoFilter_Column * @return PHPExcel_Worksheet_AutoFilter_Column
*/ */
public function getParent() { public function getParent()
{
return $this->_parent; return $this->_parent;
} }
@ -436,7 +447,8 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
* @param PHPExcel_Worksheet_AutoFilter_Column * @param PHPExcel_Worksheet_AutoFilter_Column
* @return PHPExcel_Worksheet_AutoFilter_Column_Rule * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
*/ */
public function setParent(PHPExcel_Worksheet_AutoFilter_Column $pParent = NULL) { public function setParent(PHPExcel_Worksheet_AutoFilter_Column $pParent = null)
{
$this->_parent = $pParent; $this->_parent = $pParent;
return $this; return $this;
@ -445,13 +457,14 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
/** /**
* Implement PHP __clone to create a deep clone, not just a shallow copy. * Implement PHP __clone to create a deep clone, not just a shallow copy.
*/ */
public function __clone() { public function __clone()
{
$vars = get_object_vars($this); $vars = get_object_vars($this);
foreach ($vars as $key => $value) { foreach ($vars as $key => $value) {
if (is_object($value)) { if (is_object($value)) {
if ($key == '_parent') { if ($key == '_parent') {
// Detach from autofilter column parent // Detach from autofilter column parent
$this->$key = NULL; $this->$key = null;
} else { } else {
$this->$key = clone $value; $this->$key = clone $value;
} }
@ -460,5 +473,4 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
} }
} }
} }
} }

View File

@ -154,7 +154,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return int * @return int
*/ */
public function getImageIndex() { public function getImageIndex()
{
return $this->_imageIndex; return $this->_imageIndex;
} }
@ -163,7 +164,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return string * @return string
*/ */
public function getName() { public function getName()
{
return $this->_name; return $this->_name;
} }
@ -173,7 +175,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param string $pValue * @param string $pValue
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setName($pValue = '') { public function setName($pValue = '')
{
$this->_name = $pValue; $this->_name = $pValue;
return $this; return $this;
} }
@ -183,7 +186,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return string * @return string
*/ */
public function getDescription() { public function getDescription()
{
return $this->_description; return $this->_description;
} }
@ -193,7 +197,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param string $pValue * @param string $pValue
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setDescription($pValue = '') { public function setDescription($pValue = '')
{
$this->_description = $pValue; $this->_description = $pValue;
return $this; return $this;
} }
@ -203,7 +208,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return PHPExcel_Worksheet * @return PHPExcel_Worksheet
*/ */
public function getWorksheet() { public function getWorksheet()
{
return $this->_worksheet; return $this->_worksheet;
} }
@ -215,7 +221,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setWorksheet(PHPExcel_Worksheet $pValue = null, $pOverrideOld = false) { public function setWorksheet(PHPExcel_Worksheet $pValue = null, $pOverrideOld = false)
{
if (is_null($this->_worksheet)) { if (is_null($this->_worksheet)) {
// Add drawing to PHPExcel_Worksheet // Add drawing to PHPExcel_Worksheet
$this->_worksheet = $pValue; $this->_worksheet = $pValue;
@ -228,7 +235,7 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
while ($iterator->valid()) { while ($iterator->valid()) {
if ($iterator->current()->getHashCode() == $this->getHashCode()) { if ($iterator->current()->getHashCode() == $this->getHashCode()) {
$this->_worksheet->getDrawingCollection()->offsetUnset( $iterator->key() ); $this->_worksheet->getDrawingCollection()->offsetUnset($iterator->key());
$this->_worksheet = null; $this->_worksheet = null;
break; break;
} }
@ -248,7 +255,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return string * @return string
*/ */
public function getCoordinates() { public function getCoordinates()
{
return $this->_coordinates; return $this->_coordinates;
} }
@ -258,7 +266,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param string $pValue * @param string $pValue
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setCoordinates($pValue = 'A1') { public function setCoordinates($pValue = 'A1')
{
$this->_coordinates = $pValue; $this->_coordinates = $pValue;
return $this; return $this;
} }
@ -268,7 +277,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return int * @return int
*/ */
public function getOffsetX() { public function getOffsetX()
{
return $this->_offsetX; return $this->_offsetX;
} }
@ -278,7 +288,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param int $pValue * @param int $pValue
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setOffsetX($pValue = 0) { public function setOffsetX($pValue = 0)
{
$this->_offsetX = $pValue; $this->_offsetX = $pValue;
return $this; return $this;
} }
@ -288,7 +299,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return int * @return int
*/ */
public function getOffsetY() { public function getOffsetY()
{
return $this->_offsetY; return $this->_offsetY;
} }
@ -298,7 +310,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param int $pValue * @param int $pValue
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setOffsetY($pValue = 0) { public function setOffsetY($pValue = 0)
{
$this->_offsetY = $pValue; $this->_offsetY = $pValue;
return $this; return $this;
} }
@ -308,7 +321,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return int * @return int
*/ */
public function getWidth() { public function getWidth()
{
return $this->_width; return $this->_width;
} }
@ -318,7 +332,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param int $pValue * @param int $pValue
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setWidth($pValue = 0) { public function setWidth($pValue = 0)
{
// Resize proportional? // Resize proportional?
if ($this->_resizeProportional && $pValue != 0) { if ($this->_resizeProportional && $pValue != 0) {
$ratio = $this->_height / ($this->_width != 0 ? $this->_width : 1); $ratio = $this->_height / ($this->_width != 0 ? $this->_width : 1);
@ -336,7 +351,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return int * @return int
*/ */
public function getHeight() { public function getHeight()
{
return $this->_height; return $this->_height;
} }
@ -346,7 +362,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param int $pValue * @param int $pValue
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setHeight($pValue = 0) { public function setHeight($pValue = 0)
{
// Resize proportional? // Resize proportional?
if ($this->_resizeProportional && $pValue != 0) { if ($this->_resizeProportional && $pValue != 0) {
$ratio = $this->_width / ($this->_height != 0 ? $this->_height : 1); $ratio = $this->_width / ($this->_height != 0 ? $this->_height : 1);
@ -372,7 +389,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param int $height * @param int $height
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setWidthAndHeight($width = 0, $height = 0) { public function setWidthAndHeight($width = 0, $height = 0)
{
$xratio = $width / ($this->_width != 0 ? $this->_width : 1); $xratio = $width / ($this->_width != 0 ? $this->_width : 1);
$yratio = $height / ($this->_height != 0 ? $this->_height : 1); $yratio = $height / ($this->_height != 0 ? $this->_height : 1);
if ($this->_resizeProportional && !($width == 0 || $height == 0)) { if ($this->_resizeProportional && !($width == 0 || $height == 0)) {
@ -396,7 +414,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return boolean * @return boolean
*/ */
public function getResizeProportional() { public function getResizeProportional()
{
return $this->_resizeProportional; return $this->_resizeProportional;
} }
@ -406,7 +425,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setResizeProportional($pValue = true) { public function setResizeProportional($pValue = true)
{
$this->_resizeProportional = $pValue; $this->_resizeProportional = $pValue;
return $this; return $this;
} }
@ -416,7 +436,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return int * @return int
*/ */
public function getRotation() { public function getRotation()
{
return $this->_rotation; return $this->_rotation;
} }
@ -426,7 +447,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @param int $pValue * @param int $pValue
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setRotation($pValue = 0) { public function setRotation($pValue = 0)
{
$this->_rotation = $pValue; $this->_rotation = $pValue;
return $this; return $this;
} }
@ -436,7 +458,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return PHPExcel_Worksheet_Drawing_Shadow * @return PHPExcel_Worksheet_Drawing_Shadow
*/ */
public function getShadow() { public function getShadow()
{
return $this->_shadow; return $this->_shadow;
} }
@ -447,7 +470,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_BaseDrawing * @return PHPExcel_Worksheet_BaseDrawing
*/ */
public function setShadow(PHPExcel_Worksheet_Drawing_Shadow $pValue = null) { public function setShadow(PHPExcel_Worksheet_Drawing_Shadow $pValue = null)
{
$this->_shadow = $pValue; $this->_shadow = $pValue;
return $this; return $this;
} }
@ -457,26 +481,16 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
* *
* @return string Hash code * @return string Hash code
*/ */
public function getHashCode() { public function getHashCode()
return md5( {
$this->_name return md5($this->_name.$this->_description.$this->_worksheet->getHashCode().$this->_coordinates.$this->_offsetX.$this->_offsetY.$this->_width.$this->_height.$this->_rotation.$this->_shadow->getHashCode().__CLASS__);
. $this->_description
. $this->_worksheet->getHashCode()
. $this->_coordinates
. $this->_offsetX
. $this->_offsetY
. $this->_width
. $this->_height
. $this->_rotation
. $this->_shadow->getHashCode()
. __CLASS__
);
} }
/** /**
* Implement PHP __clone to create a deep clone, not just a shallow copy. * Implement PHP __clone to create a deep clone, not just a shallow copy.
*/ */
public function __clone() { public function __clone()
{
$vars = get_object_vars($this); $vars = get_object_vars($this);
foreach ($vars as $key => $value) { foreach ($vars as $key => $value) {
if (is_object($value)) { if (is_object($value)) {

View File

@ -92,11 +92,11 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
// Initialise values // Initialise values
$this->_path = ''; $this->_path = '';
$this->_name = ''; $this->_name = '';
$this->_offsetX = 0; $this->_offsetX = 0;
$this->_offsetY = 0; $this->_offsetY = 0;
$this->_width = 0; $this->_width = 0;
$this->_height = 0; $this->_height = 0;
$this->_resizeProportional = true; $this->_resizeProportional = true;
} }
/** /**
@ -104,7 +104,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return string * @return string
*/ */
public function getName() { public function getName()
{
return $this->_name; return $this->_name;
} }
@ -114,7 +115,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* @param string $pValue * @param string $pValue
* @return PHPExcel_Worksheet_HeaderFooterDrawing * @return PHPExcel_Worksheet_HeaderFooterDrawing
*/ */
public function setName($pValue = '') { public function setName($pValue = '')
{
$this->_name = $pValue; $this->_name = $pValue;
return $this; return $this;
} }
@ -124,7 +126,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return int * @return int
*/ */
public function getOffsetX() { public function getOffsetX()
{
return $this->_offsetX; return $this->_offsetX;
} }
@ -134,7 +137,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* @param int $pValue * @param int $pValue
* @return PHPExcel_Worksheet_HeaderFooterDrawing * @return PHPExcel_Worksheet_HeaderFooterDrawing
*/ */
public function setOffsetX($pValue = 0) { public function setOffsetX($pValue = 0)
{
$this->_offsetX = $pValue; $this->_offsetX = $pValue;
return $this; return $this;
} }
@ -144,7 +148,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return int * @return int
*/ */
public function getOffsetY() { public function getOffsetY()
{
return $this->_offsetY; return $this->_offsetY;
} }
@ -154,7 +159,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* @param int $pValue * @param int $pValue
* @return PHPExcel_Worksheet_HeaderFooterDrawing * @return PHPExcel_Worksheet_HeaderFooterDrawing
*/ */
public function setOffsetY($pValue = 0) { public function setOffsetY($pValue = 0)
{
$this->_offsetY = $pValue; $this->_offsetY = $pValue;
return $this; return $this;
} }
@ -164,7 +170,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return int * @return int
*/ */
public function getWidth() { public function getWidth()
{
return $this->_width; return $this->_width;
} }
@ -174,7 +181,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* @param int $pValue * @param int $pValue
* @return PHPExcel_Worksheet_HeaderFooterDrawing * @return PHPExcel_Worksheet_HeaderFooterDrawing
*/ */
public function setWidth($pValue = 0) { public function setWidth($pValue = 0)
{
// Resize proportional? // Resize proportional?
if ($this->_resizeProportional && $pValue != 0) { if ($this->_resizeProportional && $pValue != 0) {
$ratio = $this->_width / $this->_height; $ratio = $this->_width / $this->_height;
@ -192,7 +200,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return int * @return int
*/ */
public function getHeight() { public function getHeight()
{
return $this->_height; return $this->_height;
} }
@ -202,7 +211,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* @param int $pValue * @param int $pValue
* @return PHPExcel_Worksheet_HeaderFooterDrawing * @return PHPExcel_Worksheet_HeaderFooterDrawing
*/ */
public function setHeight($pValue = 0) { public function setHeight($pValue = 0)
{
// Resize proportional? // Resize proportional?
if ($this->_resizeProportional && $pValue != 0) { if ($this->_resizeProportional && $pValue != 0) {
$ratio = $this->_width / $this->_height; $ratio = $this->_width / $this->_height;
@ -228,7 +238,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* @param int $height * @param int $height
* @return PHPExcel_Worksheet_HeaderFooterDrawing * @return PHPExcel_Worksheet_HeaderFooterDrawing
*/ */
public function setWidthAndHeight($width = 0, $height = 0) { public function setWidthAndHeight($width = 0, $height = 0)
{
$xratio = $width / $this->_width; $xratio = $width / $this->_width;
$yratio = $height / $this->_height; $yratio = $height / $this->_height;
if ($this->_resizeProportional && !($width == 0 || $height == 0)) { if ($this->_resizeProportional && !($width == 0 || $height == 0)) {
@ -248,7 +259,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return boolean * @return boolean
*/ */
public function getResizeProportional() { public function getResizeProportional()
{
return $this->_resizeProportional; return $this->_resizeProportional;
} }
@ -258,7 +270,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* @param boolean $pValue * @param boolean $pValue
* @return PHPExcel_Worksheet_HeaderFooterDrawing * @return PHPExcel_Worksheet_HeaderFooterDrawing
*/ */
public function setResizeProportional($pValue = true) { public function setResizeProportional($pValue = true)
{
$this->_resizeProportional = $pValue; $this->_resizeProportional = $pValue;
return $this; return $this;
} }
@ -268,7 +281,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return string * @return string
*/ */
public function getFilename() { public function getFilename()
{
return basename($this->_path); return basename($this->_path);
} }
@ -277,7 +291,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return string * @return string
*/ */
public function getExtension() { public function getExtension()
{
$parts = explode(".", basename($this->_path)); $parts = explode(".", basename($this->_path));
return end($parts); return end($parts);
} }
@ -287,7 +302,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return string * @return string
*/ */
public function getPath() { public function getPath()
{
return $this->_path; return $this->_path;
} }
@ -299,7 +315,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_HeaderFooterDrawing * @return PHPExcel_Worksheet_HeaderFooterDrawing
*/ */
public function setPath($pValue = '', $pVerifyFile = true) { public function setPath($pValue = '', $pVerifyFile = true)
{
if ($pVerifyFile) { if ($pVerifyFile) {
if (file_exists($pValue)) { if (file_exists($pValue)) {
$this->_path = $pValue; $this->_path = $pValue;
@ -322,9 +339,10 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
* *
* @return string Hash code * @return string Hash code
*/ */
public function getHashCode() { public function getHashCode()
{
return md5( return md5(
$this->_path $this->_path
. $this->_name . $this->_name
. $this->_offsetX . $this->_offsetX
. $this->_offsetY . $this->_offsetY
@ -337,7 +355,8 @@ class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing
/** /**
* Implement PHP __clone to create a deep clone, not just a shallow copy. * Implement PHP __clone to create a deep clone, not just a shallow copy.
*/ */
public function __clone() { public function __clone()
{
$vars = get_object_vars($this); $vars = get_object_vars($this);
foreach ($vars as $key => $value) { foreach ($vars as $key => $value) {
if (is_object($value)) { if (is_object($value)) {

View File

@ -81,10 +81,10 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
public function __construct() public function __construct()
{ {
// Initialise values // Initialise values
$this->_imageResource = null; $this->_imageResource = null;
$this->_renderingFunction = self::RENDERING_DEFAULT; $this->_renderingFunction = self::RENDERING_DEFAULT;
$this->_mimeType = self::MIMETYPE_DEFAULT; $this->_mimeType = self::MIMETYPE_DEFAULT;
$this->_uniqueName = md5(rand(0, 9999). time() . rand(0, 9999)); $this->_uniqueName = md5(rand(0, 9999). time() . rand(0, 9999));
// Initialize parent // Initialize parent
parent::__construct(); parent::__construct();
@ -95,7 +95,8 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
* *
* @return resource * @return resource
*/ */
public function getImageResource() { public function getImageResource()
{
return $this->_imageResource; return $this->_imageResource;
} }
@ -105,7 +106,8 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
* @param $value resource * @param $value resource
* @return PHPExcel_Worksheet_MemoryDrawing * @return PHPExcel_Worksheet_MemoryDrawing
*/ */
public function setImageResource($value = null) { public function setImageResource($value = null)
{
$this->_imageResource = $value; $this->_imageResource = $value;
if (!is_null($this->_imageResource)) { if (!is_null($this->_imageResource)) {
@ -121,7 +123,8 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
* *
* @return string * @return string
*/ */
public function getRenderingFunction() { public function getRenderingFunction()
{
return $this->_renderingFunction; return $this->_renderingFunction;
} }
@ -131,7 +134,8 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
* @param string $value * @param string $value
* @return PHPExcel_Worksheet_MemoryDrawing * @return PHPExcel_Worksheet_MemoryDrawing
*/ */
public function setRenderingFunction($value = PHPExcel_Worksheet_MemoryDrawing::RENDERING_DEFAULT) { public function setRenderingFunction($value = PHPExcel_Worksheet_MemoryDrawing::RENDERING_DEFAULT)
{
$this->_renderingFunction = $value; $this->_renderingFunction = $value;
return $this; return $this;
} }
@ -141,7 +145,8 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
* *
* @return string * @return string
*/ */
public function getMimeType() { public function getMimeType()
{
return $this->_mimeType; return $this->_mimeType;
} }
@ -151,7 +156,8 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
* @param string $value * @param string $value
* @return PHPExcel_Worksheet_MemoryDrawing * @return PHPExcel_Worksheet_MemoryDrawing
*/ */
public function setMimeType($value = PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT) { public function setMimeType($value = PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT)
{
$this->_mimeType = $value; $this->_mimeType = $value;
return $this; return $this;
} }
@ -161,7 +167,8 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
* *
* @return string * @return string
*/ */
public function getIndexedFilename() { public function getIndexedFilename()
{
$extension = strtolower($this->getMimeType()); $extension = strtolower($this->getMimeType());
$extension = explode('/', $extension); $extension = explode('/', $extension);
$extension = $extension[1]; $extension = $extension[1];
@ -174,9 +181,10 @@ class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing im
* *
* @return string Hash code * @return string Hash code
*/ */
public function getHashCode() { public function getHashCode()
{
return md5( return md5(
$this->_renderingFunction $this->_renderingFunction
. $this->_mimeType . $this->_mimeType
. $this->_uniqueName . $this->_uniqueName
. parent::getHashCode() . parent::getHashCode()

View File

@ -89,7 +89,8 @@ class PHPExcel_Worksheet_PageMargins
* *
* @return double * @return double
*/ */
public function getLeft() { public function getLeft()
{
return $this->_left; return $this->_left;
} }
@ -99,7 +100,8 @@ class PHPExcel_Worksheet_PageMargins
* @param double $pValue * @param double $pValue
* @return PHPExcel_Worksheet_PageMargins * @return PHPExcel_Worksheet_PageMargins
*/ */
public function setLeft($pValue) { public function setLeft($pValue)
{
$this->_left = $pValue; $this->_left = $pValue;
return $this; return $this;
} }
@ -109,7 +111,8 @@ class PHPExcel_Worksheet_PageMargins
* *
* @return double * @return double
*/ */
public function getRight() { public function getRight()
{
return $this->_right; return $this->_right;
} }
@ -119,7 +122,8 @@ class PHPExcel_Worksheet_PageMargins
* @param double $pValue * @param double $pValue
* @return PHPExcel_Worksheet_PageMargins * @return PHPExcel_Worksheet_PageMargins
*/ */
public function setRight($pValue) { public function setRight($pValue)
{
$this->_right = $pValue; $this->_right = $pValue;
return $this; return $this;
} }
@ -129,7 +133,8 @@ class PHPExcel_Worksheet_PageMargins
* *
* @return double * @return double
*/ */
public function getTop() { public function getTop()
{
return $this->_top; return $this->_top;
} }
@ -139,7 +144,8 @@ class PHPExcel_Worksheet_PageMargins
* @param double $pValue * @param double $pValue
* @return PHPExcel_Worksheet_PageMargins * @return PHPExcel_Worksheet_PageMargins
*/ */
public function setTop($pValue) { public function setTop($pValue)
{
$this->_top = $pValue; $this->_top = $pValue;
return $this; return $this;
} }
@ -149,7 +155,8 @@ class PHPExcel_Worksheet_PageMargins
* *
* @return double * @return double
*/ */
public function getBottom() { public function getBottom()
{
return $this->_bottom; return $this->_bottom;
} }
@ -159,7 +166,8 @@ class PHPExcel_Worksheet_PageMargins
* @param double $pValue * @param double $pValue
* @return PHPExcel_Worksheet_PageMargins * @return PHPExcel_Worksheet_PageMargins
*/ */
public function setBottom($pValue) { public function setBottom($pValue)
{
$this->_bottom = $pValue; $this->_bottom = $pValue;
return $this; return $this;
} }
@ -169,7 +177,8 @@ class PHPExcel_Worksheet_PageMargins
* *
* @return double * @return double
*/ */
public function getHeader() { public function getHeader()
{
return $this->_header; return $this->_header;
} }
@ -179,7 +188,8 @@ class PHPExcel_Worksheet_PageMargins
* @param double $pValue * @param double $pValue
* @return PHPExcel_Worksheet_PageMargins * @return PHPExcel_Worksheet_PageMargins
*/ */
public function setHeader($pValue) { public function setHeader($pValue)
{
$this->_header = $pValue; $this->_header = $pValue;
return $this; return $this;
} }
@ -189,7 +199,8 @@ class PHPExcel_Worksheet_PageMargins
* *
* @return double * @return double
*/ */
public function getFooter() { public function getFooter()
{
return $this->_footer; return $this->_footer;
} }
@ -199,7 +210,8 @@ class PHPExcel_Worksheet_PageMargins
* @param double $pValue * @param double $pValue
* @return PHPExcel_Worksheet_PageMargins * @return PHPExcel_Worksheet_PageMargins
*/ */
public function setFooter($pValue) { public function setFooter($pValue)
{
$this->_footer = $pValue; $this->_footer = $pValue;
return $this; return $this;
} }
@ -207,7 +219,8 @@ class PHPExcel_Worksheet_PageMargins
/** /**
* Implement PHP __clone to create a deep clone, not just a shallow copy. * Implement PHP __clone to create a deep clone, not just a shallow copy.
*/ */
public function __clone() { public function __clone()
{
$vars = get_object_vars($this); $vars = get_object_vars($this);
foreach ($vars as $key => $value) { foreach ($vars as $key => $value) {
if (is_object($value)) { if (is_object($value)) {

View File

@ -86,7 +86,8 @@ class PHPExcel_Worksheet_SheetView
* *
* @return int * @return int
*/ */
public function getZoomScale() { public function getZoomScale()
{
return $this->_zoomScale; return $this->_zoomScale;
} }
@ -99,7 +100,8 @@ class PHPExcel_Worksheet_SheetView
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_SheetView * @return PHPExcel_Worksheet_SheetView
*/ */
public function setZoomScale($pValue = 100) { public function setZoomScale($pValue = 100)
{
// Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface, // 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 // but it is apparently still able to handle any scale >= 1
if (($pValue >= 1) || is_null($pValue)) { if (($pValue >= 1) || is_null($pValue)) {
@ -115,7 +117,8 @@ class PHPExcel_Worksheet_SheetView
* *
* @return int * @return int
*/ */
public function getZoomScaleNormal() { public function getZoomScaleNormal()
{
return $this->_zoomScaleNormal; return $this->_zoomScaleNormal;
} }
@ -128,7 +131,8 @@ class PHPExcel_Worksheet_SheetView
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_SheetView * @return PHPExcel_Worksheet_SheetView
*/ */
public function setZoomScaleNormal($pValue = 100) { public function setZoomScaleNormal($pValue = 100)
{
if (($pValue >= 1) || is_null($pValue)) { if (($pValue >= 1) || is_null($pValue)) {
$this->_zoomScaleNormal = $pValue; $this->_zoomScaleNormal = $pValue;
} else { } else {
@ -142,7 +146,8 @@ class PHPExcel_Worksheet_SheetView
* *
* @return string * @return string
*/ */
public function getView() { public function getView()
{
return $this->_sheetviewType; return $this->_sheetviewType;
} }
@ -158,11 +163,12 @@ class PHPExcel_Worksheet_SheetView
* @throws PHPExcel_Exception * @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_SheetView * @return PHPExcel_Worksheet_SheetView
*/ */
public function setView($pValue = NULL) { public function setView($pValue = null)
// MS Excel 2007 allows setting the view to 'normal', 'pageLayout' or 'pageBreakPreview' {
// via the user interface // MS Excel 2007 allows setting the view to 'normal', 'pageLayout' or 'pageBreakPreview' via the user interface
if ($pValue === NULL) if ($pValue === null) {
$pValue = self::SHEETVIEW_NORMAL; $pValue = self::SHEETVIEW_NORMAL;
}
if (in_array($pValue, self::$_sheetViewTypes)) { if (in_array($pValue, self::$_sheetViewTypes)) {
$this->_sheetviewType = $pValue; $this->_sheetviewType = $pValue;
} else { } else {
@ -175,7 +181,8 @@ class PHPExcel_Worksheet_SheetView
/** /**
* Implement PHP __clone to create a deep clone, not just a shallow copy. * Implement PHP __clone to create a deep clone, not just a shallow copy.
*/ */
public function __clone() { public function __clone()
{
$vars = get_object_vars($this); $vars = get_object_vars($this);
foreach ($vars as $key => $value) { foreach ($vars as $key => $value) {
if (is_object($value)) { if (is_object($value)) {