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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff