Validation PSR-2 : Fixes

This commit is contained in:
Progi1984 2015-05-12 13:17:41 +02:00
parent 95b3fb024a
commit 661ff77749
5 changed files with 1544 additions and 870 deletions

View File

@ -166,7 +166,8 @@ class PHPExcel_Chart_DataSeries
* *
* @return string * @return string
*/ */
public function getPlotType() { public function getPlotType()
{
return $this->_plotType; return $this->_plotType;
} }
@ -176,7 +177,8 @@ class PHPExcel_Chart_DataSeries
* @param string $plotType * @param string $plotType
* @return PHPExcel_Chart_DataSeries * @return PHPExcel_Chart_DataSeries
*/ */
public function setPlotType($plotType = '') { public function setPlotType($plotType = '')
{
$this->_plotType = $plotType; $this->_plotType = $plotType;
return $this; return $this;
} }
@ -186,7 +188,8 @@ class PHPExcel_Chart_DataSeries
* *
* @return string * @return string
*/ */
public function getPlotGrouping() { public function getPlotGrouping()
{
return $this->_plotGrouping; return $this->_plotGrouping;
} }
@ -196,7 +199,8 @@ class PHPExcel_Chart_DataSeries
* @param string $groupingType * @param string $groupingType
* @return PHPExcel_Chart_DataSeries * @return PHPExcel_Chart_DataSeries
*/ */
public function setPlotGrouping($groupingType = null) { public function setPlotGrouping($groupingType = null)
{
$this->_plotGrouping = $groupingType; $this->_plotGrouping = $groupingType;
return $this; return $this;
} }
@ -206,7 +210,8 @@ class PHPExcel_Chart_DataSeries
* *
* @return string * @return string
*/ */
public function getPlotDirection() { public function getPlotDirection()
{
return $this->_plotDirection; return $this->_plotDirection;
} }
@ -216,7 +221,8 @@ class PHPExcel_Chart_DataSeries
* @param string $plotDirection * @param string $plotDirection
* @return PHPExcel_Chart_DataSeries * @return PHPExcel_Chart_DataSeries
*/ */
public function setPlotDirection($plotDirection = null) { public function setPlotDirection($plotDirection = null)
{
$this->_plotDirection = $plotDirection; $this->_plotDirection = $plotDirection;
return $this; return $this;
} }
@ -226,7 +232,8 @@ class PHPExcel_Chart_DataSeries
* *
* @return string * @return string
*/ */
public function getPlotOrder() { public function getPlotOrder()
{
return $this->_plotOrder; return $this->_plotOrder;
} }
@ -235,7 +242,8 @@ class PHPExcel_Chart_DataSeries
* *
* @return array of PHPExcel_Chart_DataSeriesValues * @return array of PHPExcel_Chart_DataSeriesValues
*/ */
public function getPlotLabels() { public function getPlotLabels()
{
return $this->_plotLabel; return $this->_plotLabel;
} }
@ -244,7 +252,8 @@ class PHPExcel_Chart_DataSeries
* *
* @return PHPExcel_Chart_DataSeriesValues * @return PHPExcel_Chart_DataSeriesValues
*/ */
public function getPlotLabelByIndex($index) { public function getPlotLabelByIndex($index)
{
$keys = array_keys($this->_plotLabel); $keys = array_keys($this->_plotLabel);
if (in_array($index, $keys)) { if (in_array($index, $keys)) {
return $this->_plotLabel[$index]; return $this->_plotLabel[$index];
@ -259,7 +268,8 @@ class PHPExcel_Chart_DataSeries
* *
* @return array of PHPExcel_Chart_DataSeriesValues * @return array of PHPExcel_Chart_DataSeriesValues
*/ */
public function getPlotCategories() { public function getPlotCategories()
{
return $this->_plotCategory; return $this->_plotCategory;
} }
@ -268,7 +278,8 @@ class PHPExcel_Chart_DataSeries
* *
* @return PHPExcel_Chart_DataSeriesValues * @return PHPExcel_Chart_DataSeriesValues
*/ */
public function getPlotCategoryByIndex($index) { public function getPlotCategoryByIndex($index)
{
$keys = array_keys($this->_plotCategory); $keys = array_keys($this->_plotCategory);
if (in_array($index, $keys)) { if (in_array($index, $keys)) {
return $this->_plotCategory[$index]; return $this->_plotCategory[$index];
@ -283,7 +294,8 @@ class PHPExcel_Chart_DataSeries
* *
* @return string * @return string
*/ */
public function getPlotStyle() { public function getPlotStyle()
{
return $this->_plotStyle; return $this->_plotStyle;
} }
@ -293,7 +305,8 @@ class PHPExcel_Chart_DataSeries
* @param string $plotStyle * @param string $plotStyle
* @return PHPExcel_Chart_DataSeries * @return PHPExcel_Chart_DataSeries
*/ */
public function setPlotStyle($plotStyle = null) { public function setPlotStyle($plotStyle = null)
{
$this->_plotStyle = $plotStyle; $this->_plotStyle = $plotStyle;
return $this; return $this;
} }
@ -303,7 +316,8 @@ class PHPExcel_Chart_DataSeries
* *
* @return array of PHPExcel_Chart_DataSeriesValues * @return array of PHPExcel_Chart_DataSeriesValues
*/ */
public function getPlotValues() { public function getPlotValues()
{
return $this->_plotValues; return $this->_plotValues;
} }
@ -312,7 +326,8 @@ class PHPExcel_Chart_DataSeries
* *
* @return PHPExcel_Chart_DataSeriesValues * @return PHPExcel_Chart_DataSeriesValues
*/ */
public function getPlotValuesByIndex($index) { public function getPlotValuesByIndex($index)
{
$keys = array_keys($this->_plotValues); $keys = array_keys($this->_plotValues);
if (in_array($index, $keys)) { if (in_array($index, $keys)) {
return $this->_plotValues[$index]; return $this->_plotValues[$index];
@ -327,7 +342,8 @@ class PHPExcel_Chart_DataSeries
* *
* @return integer * @return integer
*/ */
public function getPlotSeriesCount() { public function getPlotSeriesCount()
{
return count($this->_plotValues); return count($this->_plotValues);
} }
@ -336,7 +352,8 @@ class PHPExcel_Chart_DataSeries
* *
* @return boolean * @return boolean
*/ */
public function getSmoothLine() { public function getSmoothLine()
{
return $this->_smoothLine; return $this->_smoothLine;
} }
@ -346,23 +363,28 @@ class PHPExcel_Chart_DataSeries
* @param boolean $smoothLine * @param boolean $smoothLine
* @return PHPExcel_Chart_DataSeries * @return PHPExcel_Chart_DataSeries
*/ */
public function setSmoothLine($smoothLine = TRUE) { public function setSmoothLine($smoothLine = true)
{
$this->_smoothLine = $smoothLine; $this->_smoothLine = $smoothLine;
return $this; return $this;
} }
public function refresh(PHPExcel_Worksheet $worksheet) { public function refresh(PHPExcel_Worksheet $worksheet)
{
foreach($this->_plotValues as $plotValues) { foreach($this->_plotValues as $plotValues) {
if ($plotValues !== NULL) if ($plotValues !== null) {
$plotValues->refresh($worksheet, TRUE); $plotValues->refresh($worksheet, true);
}
} }
foreach($this->_plotLabel as $plotValues) { foreach($this->_plotLabel as $plotValues) {
if ($plotValues !== NULL) if ($plotValues !== null) {
$plotValues->refresh($worksheet, TRUE); $plotValues->refresh($worksheet, true);
}
} }
foreach($this->_plotCategory as $plotValues) { foreach($this->_plotCategory as $plotValues) {
if ($plotValues !== NULL) if ($plotValues !== null) {
$plotValues->refresh($worksheet, FALSE); $plotValues->refresh($worksheet, false);
}
} }
} }

View File

@ -40,49 +40,49 @@ class PHPExcel_Chart_Layout
* *
* @var string * @var string
*/ */
private $_layoutTarget = NULL; private $_layoutTarget = null;
/** /**
* X Mode * X Mode
* *
* @var string * @var string
*/ */
private $_xMode = NULL; private $_xMode = null;
/** /**
* Y Mode * Y Mode
* *
* @var string * @var string
*/ */
private $_yMode = NULL; private $_yMode = null;
/** /**
* X-Position * X-Position
* *
* @var float * @var float
*/ */
private $_xPos = NULL; private $_xPos = null;
/** /**
* Y-Position * Y-Position
* *
* @var float * @var float
*/ */
private $_yPos = NULL; private $_yPos = null;
/** /**
* width * width
* *
* @var float * @var float
*/ */
private $_width = NULL; private $_width = null;
/** /**
* height * height
* *
* @var float * @var float
*/ */
private $_height = NULL; private $_height = null;
/** /**
* show legend key * show legend key
@ -90,7 +90,7 @@ class PHPExcel_Chart_Layout
* *
* @var boolean * @var boolean
*/ */
private $_showLegendKey = NULL; private $_showLegendKey = null;
/** /**
* show value * show value
@ -98,7 +98,7 @@ class PHPExcel_Chart_Layout
* *
* @var boolean * @var boolean
*/ */
private $_showVal = NULL; private $_showVal = null;
/** /**
* show category name * show category name
@ -106,7 +106,7 @@ class PHPExcel_Chart_Layout
* *
* @var boolean * @var boolean
*/ */
private $_showCatName = NULL; private $_showCatName = null;
/** /**
* show data series name * show data series name
@ -114,7 +114,7 @@ class PHPExcel_Chart_Layout
* *
* @var boolean * @var boolean
*/ */
private $_showSerName = NULL; private $_showSerName = null;
/** /**
* show percentage * show percentage
@ -122,14 +122,14 @@ class PHPExcel_Chart_Layout
* *
* @var boolean * @var boolean
*/ */
private $_showPercent = NULL; private $_showPercent = null;
/** /**
* show bubble size * show bubble size
* *
* @var boolean * @var boolean
*/ */
private $_showBubbleSize = NULL; private $_showBubbleSize = null;
/** /**
* show leader lines * show leader lines
@ -137,7 +137,7 @@ class PHPExcel_Chart_Layout
* *
* @var boolean * @var boolean
*/ */
private $_showLeaderLines = NULL; private $_showLeaderLines = null;
/** /**
@ -145,13 +145,27 @@ class PHPExcel_Chart_Layout
*/ */
public function __construct($layout = array()) public function __construct($layout = array())
{ {
if (isset($layout['layoutTarget'])) { $this->_layoutTarget = $layout['layoutTarget']; } if (isset($layout['layoutTarget'])) {
if (isset($layout['xMode'])) { $this->_xMode = $layout['xMode']; } $this->_layoutTarget = $layout['layoutTarget'];
if (isset($layout['yMode'])) { $this->_yMode = $layout['yMode']; } }
if (isset($layout['x'])) { $this->_xPos = (float) $layout['x']; } if (isset($layout['xMode'])) {
if (isset($layout['y'])) { $this->_yPos = (float) $layout['y']; } $this->_xMode = $layout['xMode'];
if (isset($layout['w'])) { $this->_width = (float) $layout['w']; } }
if (isset($layout['h'])) { $this->_height = (float) $layout['h']; } if (isset($layout['yMode'])) {
$this->_yMode = $layout['yMode'];
}
if (isset($layout['x'])) {
$this->_xPos = (float) $layout['x'];
}
if (isset($layout['y'])) {
$this->_yPos = (float) $layout['y'];
}
if (isset($layout['w'])) {
$this->_width = (float) $layout['w'];
}
if (isset($layout['h'])) {
$this->_height = (float) $layout['h'];
}
} }
/** /**
@ -159,7 +173,8 @@ class PHPExcel_Chart_Layout
* *
* @return string * @return string
*/ */
public function getLayoutTarget() { public function getLayoutTarget()
{
return $this->_layoutTarget; return $this->_layoutTarget;
} }
@ -169,7 +184,8 @@ class PHPExcel_Chart_Layout
* @param Layout Target $value * @param Layout Target $value
* @return PHPExcel_Chart_Layout * @return PHPExcel_Chart_Layout
*/ */
public function setLayoutTarget($value) { public function setLayoutTarget($value)
{
$this->_layoutTarget = $value; $this->_layoutTarget = $value;
return $this; return $this;
} }
@ -179,7 +195,8 @@ class PHPExcel_Chart_Layout
* *
* @return string * @return string
*/ */
public function getXMode() { public function getXMode()
{
return $this->_xMode; return $this->_xMode;
} }
@ -189,7 +206,8 @@ class PHPExcel_Chart_Layout
* @param X-Mode $value * @param X-Mode $value
* @return PHPExcel_Chart_Layout * @return PHPExcel_Chart_Layout
*/ */
public function setXMode($value) { public function setXMode($value)
{
$this->_xMode = $value; $this->_xMode = $value;
return $this; return $this;
} }
@ -199,7 +217,8 @@ class PHPExcel_Chart_Layout
* *
* @return string * @return string
*/ */
public function getYMode() { public function getYMode()
{
return $this->_yMode; return $this->_yMode;
} }
@ -209,7 +228,8 @@ class PHPExcel_Chart_Layout
* @param Y-Mode $value * @param Y-Mode $value
* @return PHPExcel_Chart_Layout * @return PHPExcel_Chart_Layout
*/ */
public function setYMode($value) { public function setYMode($value)
{
$this->_yMode = $value; $this->_yMode = $value;
return $this; return $this;
} }
@ -219,7 +239,8 @@ class PHPExcel_Chart_Layout
* *
* @return number * @return number
*/ */
public function getXPosition() { public function getXPosition()
{
return $this->_xPos; return $this->_xPos;
} }
@ -229,7 +250,8 @@ class PHPExcel_Chart_Layout
* @param X-Position $value * @param X-Position $value
* @return PHPExcel_Chart_Layout * @return PHPExcel_Chart_Layout
*/ */
public function setXPosition($value) { public function setXPosition($value)
{
$this->_xPos = $value; $this->_xPos = $value;
return $this; return $this;
} }
@ -239,7 +261,8 @@ class PHPExcel_Chart_Layout
* *
* @return number * @return number
*/ */
public function getYPosition() { public function getYPosition()
{
return $this->_yPos; return $this->_yPos;
} }
@ -249,7 +272,8 @@ class PHPExcel_Chart_Layout
* @param Y-Position $value * @param Y-Position $value
* @return PHPExcel_Chart_Layout * @return PHPExcel_Chart_Layout
*/ */
public function setYPosition($value) { public function setYPosition($value)
{
$this->_yPos = $value; $this->_yPos = $value;
return $this; return $this;
} }
@ -259,7 +283,8 @@ class PHPExcel_Chart_Layout
* *
* @return number * @return number
*/ */
public function getWidth() { public function getWidth()
{
return $this->_width; return $this->_width;
} }
@ -269,7 +294,8 @@ class PHPExcel_Chart_Layout
* @param Width $value * @param Width $value
* @return PHPExcel_Chart_Layout * @return PHPExcel_Chart_Layout
*/ */
public function setWidth($value) { public function setWidth($value)
{
$this->_width = $value; $this->_width = $value;
return $this; return $this;
} }
@ -279,7 +305,8 @@ class PHPExcel_Chart_Layout
* *
* @return number * @return number
*/ */
public function getHeight() { public function getHeight()
{
return $this->_height; return $this->_height;
} }
@ -289,7 +316,8 @@ class PHPExcel_Chart_Layout
* @param Height $value * @param Height $value
* @return PHPExcel_Chart_Layout * @return PHPExcel_Chart_Layout
*/ */
public function setHeight($value) { public function setHeight($value)
{
$this->_height = $value; $this->_height = $value;
return $this; return $this;
} }
@ -300,7 +328,8 @@ class PHPExcel_Chart_Layout
* *
* @return boolean * @return boolean
*/ */
public function getShowLegendKey() { public function getShowLegendKey()
{
return $this->_showLegendKey; return $this->_showLegendKey;
} }
@ -311,7 +340,8 @@ class PHPExcel_Chart_Layout
* @param boolean $value Show legend key * @param boolean $value Show legend key
* @return PHPExcel_Chart_Layout * @return PHPExcel_Chart_Layout
*/ */
public function setShowLegendKey($value) { public function setShowLegendKey($value)
{
$this->_showLegendKey = $value; $this->_showLegendKey = $value;
return $this; return $this;
} }
@ -321,7 +351,8 @@ class PHPExcel_Chart_Layout
* *
* @return boolean * @return boolean
*/ */
public function getShowVal() { public function getShowVal()
{
return $this->_showVal; return $this->_showVal;
} }
@ -332,7 +363,8 @@ class PHPExcel_Chart_Layout
* @param boolean $value Show val * @param boolean $value Show val
* @return PHPExcel_Chart_Layout * @return PHPExcel_Chart_Layout
*/ */
public function setShowVal($value) { public function setShowVal($value)
{
$this->_showVal = $value; $this->_showVal = $value;
return $this; return $this;
} }
@ -342,7 +374,8 @@ class PHPExcel_Chart_Layout
* *
* @return boolean * @return boolean
*/ */
public function getShowCatName() { public function getShowCatName()
{
return $this->_showCatName; return $this->_showCatName;
} }
@ -353,7 +386,8 @@ class PHPExcel_Chart_Layout
* @param boolean $value Show cat name * @param boolean $value Show cat name
* @return PHPExcel_Chart_Layout * @return PHPExcel_Chart_Layout
*/ */
public function setShowCatName($value) { public function setShowCatName($value)
{
$this->_showCatName = $value; $this->_showCatName = $value;
return $this; return $this;
} }
@ -363,7 +397,8 @@ class PHPExcel_Chart_Layout
* *
* @return boolean * @return boolean
*/ */
public function getShowSerName() { public function getShowSerName()
{
return $this->_showSerName; return $this->_showSerName;
} }
@ -374,7 +409,8 @@ class PHPExcel_Chart_Layout
* @param boolean $value Show series name * @param boolean $value Show series name
* @return PHPExcel_Chart_Layout * @return PHPExcel_Chart_Layout
*/ */
public function setShowSerName($value) { public function setShowSerName($value)
{
$this->_showSerName = $value; $this->_showSerName = $value;
return $this; return $this;
} }
@ -384,7 +420,8 @@ class PHPExcel_Chart_Layout
* *
* @return boolean * @return boolean
*/ */
public function getShowPercent() { public function getShowPercent()
{
return $this->_showPercent; return $this->_showPercent;
} }
@ -395,7 +432,8 @@ class PHPExcel_Chart_Layout
* @param boolean $value Show percentage * @param boolean $value Show percentage
* @return PHPExcel_Chart_Layout * @return PHPExcel_Chart_Layout
*/ */
public function setShowPercent($value) { public function setShowPercent($value)
{
$this->_showPercent = $value; $this->_showPercent = $value;
return $this; return $this;
} }
@ -405,7 +443,8 @@ class PHPExcel_Chart_Layout
* *
* @return boolean * @return boolean
*/ */
public function getShowBubbleSize() { public function getShowBubbleSize()
{
return $this->_showBubbleSize; return $this->_showBubbleSize;
} }
@ -416,7 +455,8 @@ class PHPExcel_Chart_Layout
* @param boolean $value Show bubble size * @param boolean $value Show bubble size
* @return PHPExcel_Chart_Layout * @return PHPExcel_Chart_Layout
*/ */
public function setShowBubbleSize($value) { public function setShowBubbleSize($value)
{
$this->_showBubbleSize = $value; $this->_showBubbleSize = $value;
return $this; return $this;
} }
@ -426,7 +466,8 @@ class PHPExcel_Chart_Layout
* *
* @return boolean * @return boolean
*/ */
public function getShowLeaderLines() { public function getShowLeaderLines()
{
return $this->_showLeaderLines; return $this->_showLeaderLines;
} }
@ -437,9 +478,9 @@ class PHPExcel_Chart_Layout
* @param boolean $value Show leader lines * @param boolean $value Show leader lines
* @return PHPExcel_Chart_Layout * @return PHPExcel_Chart_Layout
*/ */
public function setShowLeaderLines($value) { public function setShowLeaderLines($value)
{
$this->_showLeaderLines = $value; $this->_showLeaderLines = $value;
return $this; return $this;
} }
} }

View File

@ -55,7 +55,8 @@ class PHPExcel_Chart_PlotArea
* *
* @return PHPExcel_Chart_Layout * @return PHPExcel_Chart_Layout
*/ */
public function getLayout() { public function getLayout()
{
return $this->_layout; return $this->_layout;
} }
@ -64,7 +65,8 @@ class PHPExcel_Chart_PlotArea
* *
* @return array of PHPExcel_Chart_DataSeries * @return array of PHPExcel_Chart_DataSeries
*/ */
public function getPlotGroupCount() { public function getPlotGroupCount()
{
return count($this->_plotSeries); return count($this->_plotSeries);
} }
@ -73,7 +75,8 @@ class PHPExcel_Chart_PlotArea
* *
* @return integer * @return integer
*/ */
public function getPlotSeriesCount() { public function getPlotSeriesCount()
{
$seriesCount = 0; $seriesCount = 0;
foreach ($this->_plotSeries as $plot) { foreach ($this->_plotSeries as $plot) {
$seriesCount += $plot->getPlotSeriesCount(); $seriesCount += $plot->getPlotSeriesCount();
@ -86,7 +89,8 @@ class PHPExcel_Chart_PlotArea
* *
* @return array of PHPExcel_Chart_DataSeries * @return array of PHPExcel_Chart_DataSeries
*/ */
public function getPlotGroup() { public function getPlotGroup()
{
return $this->_plotSeries; return $this->_plotSeries;
} }
@ -95,7 +99,8 @@ class PHPExcel_Chart_PlotArea
* *
* @return PHPExcel_Chart_DataSeries * @return PHPExcel_Chart_DataSeries
*/ */
public function getPlotGroupByIndex($index) { public function getPlotGroupByIndex($index)
{
return $this->_plotSeries[$index]; return $this->_plotSeries[$index];
} }
@ -105,16 +110,17 @@ class PHPExcel_Chart_PlotArea
* @param [PHPExcel_Chart_DataSeries] * @param [PHPExcel_Chart_DataSeries]
* @return PHPExcel_Chart_PlotArea * @return PHPExcel_Chart_PlotArea
*/ */
public function setPlotSeries($plotSeries = array()) { public function setPlotSeries($plotSeries = array())
{
$this->_plotSeries = $plotSeries; $this->_plotSeries = $plotSeries;
return $this; return $this;
} }
public function refresh(PHPExcel_Worksheet $worksheet) { public function refresh(PHPExcel_Worksheet $worksheet)
{
foreach ($this->_plotSeries as $plotSeries) { foreach ($this->_plotSeries as $plotSeries) {
$plotSeries->refresh($worksheet); $plotSeries->refresh($worksheet);
} }
} }
} }

View File

@ -8,7 +8,6 @@
abstract class PHPExcel_Chart_Properties abstract class PHPExcel_Chart_Properties
{ {
const const
EXCEL_COLOR_TYPE_STANDARD = 'prstClr', EXCEL_COLOR_TYPE_STANDARD = 'prstClr',
EXCEL_COLOR_TYPE_SCHEME = 'schemeClr', EXCEL_COLOR_TYPE_SCHEME = 'schemeClr',
@ -114,19 +113,23 @@ abstract class PHPExcel_Chart_Properties
SHADOW_PRESETS_PERSPECTIVE_LOWER_RIGHT = 22, SHADOW_PRESETS_PERSPECTIVE_LOWER_RIGHT = 22,
SHADOW_PRESETS_PERSPECTIVE_LOWER_LEFT = 23; SHADOW_PRESETS_PERSPECTIVE_LOWER_LEFT = 23;
protected function getExcelPointsWidth($width) { protected function getExcelPointsWidth($width)
{
return $width * 12700; return $width * 12700;
} }
protected function getExcelPointsAngle($angle) { protected function getExcelPointsAngle($angle)
{
return $angle * 60000; return $angle * 60000;
} }
protected function getTrueAlpha($alpha) { protected function getTrueAlpha($alpha)
{
return (string) 100 - $alpha . '000'; return (string) 100 - $alpha . '000';
} }
protected function setColorProperties($color, $alpha, $type) { protected function setColorProperties($color, $alpha, $type)
{
return array( return array(
'type' => (string) $type, 'type' => (string) $type,
'value' => (string) $color, 'value' => (string) $color,
@ -350,11 +353,8 @@ abstract class PHPExcel_Chart_Properties
foreach ($elements as $keys) { foreach ($elements as $keys) {
$reference = & $reference[$keys]; $reference = & $reference[$keys];
} }
return $reference; return $reference;
} }
return $this; return $this;
} }
} }

File diff suppressed because it is too large Load Diff