We changed the coding standard to PSR-2, and wow! What happened next was awesome

This commit is contained in:
MarkBaker 2015-05-13 17:00:22 +01:00
parent 06c1ea78de
commit feac76dadf
4 changed files with 908 additions and 835 deletions

File diff suppressed because it is too large Load Diff

View File

@ -179,8 +179,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
public function setAxisOptionsProperties($axis_labels, $horizontal_crosses_value = null, $horizontal_crosses = null, $axis_orientation = null, $major_tmt = null, $minor_tmt = null, $minimum = null, $maximum = null, $major_unit = null, $minor_unit = null)
{
$this->_axis_options['axis_labels'] = (string) $axis_labels;
($horizontal_crosses_value !== null)
? $this->_axis_options['horizontal_crosses_value'] = (string) $horizontal_crosses_value : null;
($horizontal_crosses_value !== null) ? $this->_axis_options['horizontal_crosses_value'] = (string) $horizontal_crosses_value : null;
($horizontal_crosses !== null) ? $this->_axis_options['horizontal_crosses'] = (string) $horizontal_crosses : null;
($axis_orientation !== null) ? $this->_axis_options['orientation'] = (string) $axis_orientation : null;
($major_tmt !== null) ? $this->_axis_options['major_tick_mark'] = (string) $major_tmt : null;
@ -279,22 +278,16 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* @param string $end_arrow_size
*
*/
public function setLineStyleProperties($line_width = null, $compound_type = null, $dash_type = null, $cap_type = null, $join_type = null, $head_arrow_type = null, $head_arrow_size = null, $end_arrow_type = null, $end_arrow_size = null) {
(!is_null($line_width)) ? $this->_line_style_properties['width'] = $this->getExcelPointsWidth((float) $line_width)
: null;
(!is_null($line_width)) ? $this->_line_style_properties['width'] = $this->getExcelPointsWidth((float) $line_width) : null;
(!is_null($compound_type)) ? $this->_line_style_properties['compound'] = (string) $compound_type : null;
(!is_null($dash_type)) ? $this->_line_style_properties['dash'] = (string) $dash_type : null;
(!is_null($cap_type)) ? $this->_line_style_properties['cap'] = (string) $cap_type : null;
(!is_null($join_type)) ? $this->_line_style_properties['join'] = (string) $join_type : null;
(!is_null($head_arrow_type)) ? $this->_line_style_properties['arrow']['head']['type'] = (string) $head_arrow_type
: null;
(!is_null($head_arrow_size)) ? $this->_line_style_properties['arrow']['head']['size'] = (string) $head_arrow_size
: null;
(!is_null($end_arrow_type)) ? $this->_line_style_properties['arrow']['end']['type'] = (string) $end_arrow_type
: null;
(!is_null($end_arrow_size)) ? $this->_line_style_properties['arrow']['end']['size'] = (string) $end_arrow_size
: null;
(!is_null($head_arrow_type)) ? $this->_line_style_properties['arrow']['head']['type'] = (string) $head_arrow_type : null;
(!is_null($head_arrow_size)) ? $this->_line_style_properties['arrow']['head']['size'] = (string) $head_arrow_size : null;
(!is_null($end_arrow_type)) ? $this->_line_style_properties['arrow']['end']['type'] = (string) $end_arrow_type : null;
(!is_null($end_arrow_size)) ? $this->_line_style_properties['arrow']['end']['size'] = (string) $end_arrow_size : null;
}
/**
@ -304,7 +297,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
*
* @return string
*/
public function getLineStyleProperty($elements)
{
return $this->getArrayElementsValue($this->_line_style_properties, $elements);
@ -317,7 +309,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
*
* @return string
*/
public function getLineStyleArrowWidth($arrow)
{
return $this->getLineStyleArrowSize($this->_line_style_properties['arrow'][$arrow]['size'], 'w');
@ -330,7 +321,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
*
* @return string
*/
public function getLineStyleArrowLength($arrow)
{
return $this->getLineStyleArrowSize($this->_line_style_properties['arrow'][$arrow]['size'], 'len');
@ -348,10 +338,8 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* @param float $sh_distance
*
*/
public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_color_type = null, $sh_color_alpha = null, $sh_blur = null, $sh_angle = null, $sh_distance = null) {
$this
->_setShadowPresetsProperties((int) $sh_presets)
$this->_setShadowPresetsProperties((int) $sh_presets)
->_setShadowColor(
is_null($sh_color_value) ? $this->_shadow_properties['color']['value'] : $sh_color_value
, is_null($sh_color_alpha) ? (int) $this->_shadow_properties['color']['alpha'] : $sh_color_alpha
@ -368,7 +356,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
*
* @return PHPExcel_Chart_Axis
*/
private function _setShadowPresetsProperties($shadow_presets) {
$this->_shadow_properties['presets'] = $shadow_presets;
$this->_setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets));
@ -384,7 +371,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
*
* @return PHPExcel_Chart_Axis
*/
private function _setShadowProperiesMapValues(array $properties_map, &$reference = null) {
$base_reference = $reference;
foreach ($properties_map as $property_key => $property_val) {
@ -416,7 +402,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
*
* @return PHPExcel_Chart_Axis
*/
private function _setShadowColor($color, $alpha, $type) {
$this->_shadow_properties['color'] = $this->setColorProperties($color, $alpha, $type);
@ -430,7 +415,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
*
* @return PHPExcel_Chart_Axis
*/
private function _setShadowBlur($blur) {
if ($blur !== null) {
$this->_shadow_properties['blur'] = (string) $this->getExcelPointsWidth($blur);
@ -446,7 +430,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
*
* @return PHPExcel_Chart_Axis
*/
private function _setShadowAngle($angle) {
if ($angle !== null) {
$this->_shadow_properties['direction'] = (string) $this->getExcelPointsAngle($angle);
@ -462,7 +445,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
*
* @return PHPExcel_Chart_Axis
*/
private function _setShadowDistance($distance) {
if ($distance !== null) {
$this->_shadow_properties['distance'] = (string) $this->getExcelPointsWidth($distance);
@ -479,7 +461,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* @param int $color_alpha
* @param string $color_type
*/
public function getShadowProperty($elements) {
return $this->getArrayElementsValue($this->_shadow_properties, $elements);
}
@ -492,14 +473,13 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* @param int $color_alpha
* @param string $color_type
*/
public function setGlowProperties($size, $color_value = null, $color_alpha = null, $color_type = null) {
$this
->_setGlowSize($size)
$this->_setGlowSize($size)
->_setGlowColor(
is_null($color_value) ? $this->_glow_properties['color']['value'] : $color_value
, is_null($color_alpha) ? (int) $this->_glow_properties['color']['alpha'] : $color_alpha
, is_null($color_type) ? $this->_glow_properties['color']['type'] : $color_type);
, is_null($color_type) ? $this->_glow_properties['color']['type'] : $color_type
);
}
/**
@ -509,7 +489,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
*
* @return string
*/
public function getGlowProperty($property) {
return $this->getArrayElementsValue($this->_glow_properties, $property);
}
@ -521,7 +500,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
*
* @return PHPExcel_Chart_Axis
*/
private function _setGlowSize($size) {
if (!is_null($size)) {
$this->_glow_properties['size'] = $this->getExcelPointsWidth($size);
@ -539,7 +517,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
*
* @return PHPExcel_Chart_Axis
*/
private function _setGlowColor($color, $alpha, $type) {
$this->_glow_properties['color'] = $this->setColorProperties($color, $alpha, $type);
@ -551,7 +528,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
*
* @param float $size
*/
public function setSoftEdges($size) {
if (!is_null($size)) {
$_soft_edges['size'] = (string) $this->getExcelPointsWidth($size);
@ -563,7 +539,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
*
* @return string
*/
public function getSoftEdgesSize() {
return $this->_soft_edges['size'];
}

View File

@ -387,5 +387,4 @@ class PHPExcel_Chart_DataSeries
}
}
}
}