Sane argument names in the Chart classes

This commit is contained in:
MarkBaker 2020-11-03 20:43:42 +01:00
parent b5c2709002
commit b12cebe1f5
7 changed files with 232 additions and 232 deletions

View File

@ -167,30 +167,30 @@ class Axis extends Properties
/** /**
* Set Axis Options Properties. * Set Axis Options Properties.
* *
* @param string $axis_labels * @param string $axisLabels
* @param string $horizontal_crosses_value * @param string $horizontalCrossesValue
* @param string $horizontal_crosses * @param string $horizontalCrosses
* @param string $axis_orientation * @param string $axisOrientation
* @param string $major_tmt * @param string $majorTmt
* @param string $minor_tmt * @param string $minorTmt
* @param string $minimum * @param string $minimum
* @param string $maximum * @param string $maximum
* @param string $major_unit * @param string $majorUnit
* @param string $minor_unit * @param string $minorUnit
*/ */
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): void public function setAxisOptionsProperties($axisLabels, $horizontalCrossesValue = null, $horizontalCrosses = null, $axisOrientation = null, $majorTmt = null, $minorTmt = null, $minimum = null, $maximum = null, $majorUnit = null, $minorUnit = null): void
{ {
$this->axisOptions['axis_labels'] = (string) $axis_labels; $this->axisOptions['axis_labels'] = (string) $axisLabels;
($horizontal_crosses_value !== null) ? $this->axisOptions['horizontal_crosses_value'] = (string) $horizontal_crosses_value : null; ($horizontalCrossesValue !== null) ? $this->axisOptions['horizontal_crosses_value'] = (string) $horizontalCrossesValue : null;
($horizontal_crosses !== null) ? $this->axisOptions['horizontal_crosses'] = (string) $horizontal_crosses : null; ($horizontalCrosses !== null) ? $this->axisOptions['horizontal_crosses'] = (string) $horizontalCrosses : null;
($axis_orientation !== null) ? $this->axisOptions['orientation'] = (string) $axis_orientation : null; ($axisOrientation !== null) ? $this->axisOptions['orientation'] = (string) $axisOrientation : null;
($major_tmt !== null) ? $this->axisOptions['major_tick_mark'] = (string) $major_tmt : null; ($majorTmt !== null) ? $this->axisOptions['major_tick_mark'] = (string) $majorTmt : null;
($minor_tmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minor_tmt : null; ($minorTmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minorTmt : null;
($minor_tmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minor_tmt : null; ($minorTmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minorTmt : null;
($minimum !== null) ? $this->axisOptions['minimum'] = (string) $minimum : null; ($minimum !== null) ? $this->axisOptions['minimum'] = (string) $minimum : null;
($maximum !== null) ? $this->axisOptions['maximum'] = (string) $maximum : null; ($maximum !== null) ? $this->axisOptions['maximum'] = (string) $maximum : null;
($major_unit !== null) ? $this->axisOptions['major_unit'] = (string) $major_unit : null; ($majorUnit !== null) ? $this->axisOptions['major_unit'] = (string) $majorUnit : null;
($minor_unit !== null) ? $this->axisOptions['minor_unit'] = (string) $minor_unit : null; ($minorUnit !== null) ? $this->axisOptions['minor_unit'] = (string) $minorUnit : null;
} }
/** /**
@ -220,11 +220,11 @@ class Axis extends Properties
* *
* @param string $color * @param string $color
* @param int $alpha * @param int $alpha
* @param string $type * @param string $AlphaType
*/ */
public function setFillParameters($color, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_ARGB): void public function setFillParameters($color, $alpha = 0, $AlphaType = self::EXCEL_COLOR_TYPE_ARGB): void
{ {
$this->fillProperties = $this->setColorProperties($color, $alpha, $type); $this->fillProperties = $this->setColorProperties($color, $alpha, $AlphaType);
} }
/** /**
@ -232,11 +232,11 @@ class Axis extends Properties
* *
* @param string $color * @param string $color
* @param int $alpha * @param int $alpha
* @param string $type * @param string $alphaType
*/ */
public function setLineParameters($color, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_ARGB): void public function setLineParameters($color, $alpha = 0, $alphaType = self::EXCEL_COLOR_TYPE_ARGB): void
{ {
$this->lineProperties = $this->setColorProperties($color, $alpha, $type); $this->lineProperties = $this->setColorProperties($color, $alpha, $alphaType);
} }
/** /**
@ -266,27 +266,27 @@ class Axis extends Properties
/** /**
* Set Line Style Properties. * Set Line Style Properties.
* *
* @param float $line_width * @param float $lineWidth
* @param string $compound_type * @param string $compoundType
* @param string $dash_type * @param string $dashType
* @param string $cap_type * @param string $capType
* @param string $join_type * @param string $joinType
* @param string $head_arrow_type * @param string $headArrowType
* @param string $head_arrow_size * @param string $headArrowSize
* @param string $end_arrow_type * @param string $endArrowType
* @param string $end_arrow_size * @param string $endArrowSize
*/ */
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): void public function setLineStyleProperties($lineWidth = null, $compoundType = null, $dashType = null, $capType = null, $joinType = null, $headArrowType = null, $headArrowSize = null, $endArrowType = null, $endArrowSize = null): void
{ {
($line_width !== null) ? $this->lineStyleProperties['width'] = $this->getExcelPointsWidth((float) $line_width) : null; ($lineWidth !== null) ? $this->lineStyleProperties['width'] = $this->getExcelPointsWidth((float) $lineWidth) : null;
($compound_type !== null) ? $this->lineStyleProperties['compound'] = (string) $compound_type : null; ($compoundType !== null) ? $this->lineStyleProperties['compound'] = (string) $compoundType : null;
($dash_type !== null) ? $this->lineStyleProperties['dash'] = (string) $dash_type : null; ($dashType !== null) ? $this->lineStyleProperties['dash'] = (string) $dashType : null;
($cap_type !== null) ? $this->lineStyleProperties['cap'] = (string) $cap_type : null; ($capType !== null) ? $this->lineStyleProperties['cap'] = (string) $capType : null;
($join_type !== null) ? $this->lineStyleProperties['join'] = (string) $join_type : null; ($joinType !== null) ? $this->lineStyleProperties['join'] = (string) $joinType : null;
($head_arrow_type !== null) ? $this->lineStyleProperties['arrow']['head']['type'] = (string) $head_arrow_type : null; ($headArrowType !== null) ? $this->lineStyleProperties['arrow']['head']['type'] = (string) $headArrowType : null;
($head_arrow_size !== null) ? $this->lineStyleProperties['arrow']['head']['size'] = (string) $head_arrow_size : null; ($headArrowSize !== null) ? $this->lineStyleProperties['arrow']['head']['size'] = (string) $headArrowSize : null;
($end_arrow_type !== null) ? $this->lineStyleProperties['arrow']['end']['type'] = (string) $end_arrow_type : null; ($endArrowType !== null) ? $this->lineStyleProperties['arrow']['end']['type'] = (string) $endArrowType : null;
($end_arrow_size !== null) ? $this->lineStyleProperties['arrow']['end']['size'] = (string) $end_arrow_size : null; ($endArrowSize !== null) ? $this->lineStyleProperties['arrow']['end']['size'] = (string) $endArrowSize : null;
} }
/** /**
@ -328,38 +328,38 @@ class Axis extends Properties
/** /**
* Set Shadow Properties. * Set Shadow Properties.
* *
* @param int $sh_presets * @param int $shadowPresets
* @param string $sh_color_value * @param string $colorValue
* @param string $sh_color_type * @param string $colorType
* @param string $sh_color_alpha * @param string $colorAlpha
* @param float $sh_blur * @param float $blur
* @param int $sh_angle * @param int $angle
* @param float $sh_distance * @param float $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): void public function setShadowProperties($shadowPresets, $colorValue = null, $colorType = null, $colorAlpha = null, $blur = null, $angle = null, $distance = null): void
{ {
$this->setShadowPresetsProperties((int) $sh_presets) $this->setShadowPresetsProperties((int) $shadowPresets)
->setShadowColor( ->setShadowColor(
$sh_color_value === null ? $this->shadowProperties['color']['value'] : $sh_color_value, $colorValue === null ? $this->shadowProperties['color']['value'] : $colorValue,
$sh_color_alpha === null ? (int) $this->shadowProperties['color']['alpha'] : $sh_color_alpha, $colorAlpha === null ? (int) $this->shadowProperties['color']['alpha'] : $colorAlpha,
$sh_color_type === null ? $this->shadowProperties['color']['type'] : $sh_color_type $colorType === null ? $this->shadowProperties['color']['type'] : $colorType
) )
->setShadowBlur($sh_blur) ->setShadowBlur($blur)
->setShadowAngle($sh_angle) ->setShadowAngle($angle)
->setShadowDistance($sh_distance); ->setShadowDistance($distance);
} }
/** /**
* Set Shadow Color. * Set Shadow Color.
* *
* @param int $shadow_presets * @param int $presets
* *
* @return $this * @return $this
*/ */
private function setShadowPresetsProperties($shadow_presets) private function setShadowPresetsProperties($presets)
{ {
$this->shadowProperties['presets'] = $shadow_presets; $this->shadowProperties['presets'] = $presets;
$this->setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets)); $this->setShadowPropertiesMapValues($this->getShadowPresetsMap($presets));
return $this; return $this;
} }
@ -371,17 +371,17 @@ class Axis extends Properties
* *
* @return $this * @return $this
*/ */
private function setShadowProperiesMapValues(array $properties_map, &$reference = null) private function setShadowPropertiesMapValues(array $propertiesMap, &$reference = null)
{ {
$base_reference = $reference; $base_reference = $reference;
foreach ($properties_map as $property_key => $property_val) { foreach ($propertiesMap as $property_key => $property_val) {
if (is_array($property_val)) { if (is_array($property_val)) {
if ($reference === null) { if ($reference === null) {
$reference = &$this->shadowProperties[$property_key]; $reference = &$this->shadowProperties[$property_key];
} else { } else {
$reference = &$reference[$property_key]; $reference = &$reference[$property_key];
} }
$this->setShadowProperiesMapValues($property_val, $reference); $this->setShadowPropertiesMapValues($property_val, $reference);
} else { } else {
if ($base_reference === null) { if ($base_reference === null) {
$this->shadowProperties[$property_key] = $property_val; $this->shadowProperties[$property_key] = $property_val;
@ -399,13 +399,13 @@ class Axis extends Properties
* *
* @param string $color * @param string $color
* @param int $alpha * @param int $alpha
* @param string $type * @param string $alphaType
* *
* @return $this * @return $this
*/ */
private function setShadowColor($color, $alpha, $type) private function setShadowColor($color, $alpha, $alphaType)
{ {
$this->shadowProperties['color'] = $this->setColorProperties($color, $alpha, $type); $this->shadowProperties['color'] = $this->setColorProperties($color, $alpha, $alphaType);
return $this; return $this;
} }
@ -474,17 +474,17 @@ class Axis extends Properties
* Set Glow Properties. * Set Glow Properties.
* *
* @param float $size * @param float $size
* @param string $color_value * @param string $colorValue
* @param int $color_alpha * @param int $colorAlpha
* @param string $color_type * @param string $colorType
*/ */
public function setGlowProperties($size, $color_value = null, $color_alpha = null, $color_type = null): void public function setGlowProperties($size, $colorValue = null, $colorAlpha = null, $colorType = null): void
{ {
$this->setGlowSize($size) $this->setGlowSize($size)
->setGlowColor( ->setGlowColor(
$color_value === null ? $this->glowProperties['color']['value'] : $color_value, $colorValue === null ? $this->glowProperties['color']['value'] : $colorValue,
$color_alpha === null ? (int) $this->glowProperties['color']['alpha'] : $color_alpha, $colorAlpha === null ? (int) $this->glowProperties['color']['alpha'] : $colorAlpha,
$color_type === null ? $this->glowProperties['color']['type'] : $color_type $colorType === null ? $this->glowProperties['color']['type'] : $colorType
); );
} }
@ -521,13 +521,13 @@ class Axis extends Properties
* *
* @param string $color * @param string $color
* @param int $alpha * @param int $alpha
* @param string $type * @param string $colorType
* *
* @return $this * @return $this
*/ */
private function setGlowColor($color, $alpha, $type) private function setGlowColor($color, $alpha, $colorType)
{ {
$this->glowProperties['color'] = $this->setColorProperties($color, $alpha, $type); $this->glowProperties['color'] = $this->setColorProperties($color, $alpha, $colorType);
return $this; return $this;
} }

View File

@ -186,13 +186,13 @@ class Chart
/** /**
* Set Worksheet. * Set Worksheet.
* *
* @param Worksheet $pValue * @param Worksheet $worksheet
* *
* @return $this * @return $this
*/ */
public function setWorksheet(?Worksheet $pValue = null) public function setWorksheet(?Worksheet $worksheet = null)
{ {
$this->worksheet = $pValue; $this->worksheet = $worksheet;
return $this; return $this;
} }

View File

@ -105,73 +105,73 @@ class GridLines extends Properties
* *
* @param string $value * @param string $value
* @param int $alpha * @param int $alpha
* @param string $type * @param string $colorType
*/ */
public function setLineColorProperties($value, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_STANDARD): void public function setLineColorProperties($value, $alpha = 0, $colorType = self::EXCEL_COLOR_TYPE_STANDARD): void
{ {
$this->activateObject() $this->activateObject()
->lineProperties['color'] = $this->setColorProperties( ->lineProperties['color'] = $this->setColorProperties(
$value, $value,
$alpha, $alpha,
$type $colorType
); );
} }
/** /**
* Set Line Color Properties. * Set Line Color Properties.
* *
* @param float $line_width * @param float $lineWidth
* @param string $compound_type * @param string $compoundType
* @param string $dash_type * @param string $dashType
* @param string $cap_type * @param string $capType
* @param string $join_type * @param string $joinType
* @param string $head_arrow_type * @param string $headArrowType
* @param string $head_arrow_size * @param string $headArrowSize
* @param string $end_arrow_type * @param string $endArrowType
* @param string $end_arrow_size * @param string $endArrowSize
*/ */
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): void public function setLineStyleProperties($lineWidth = null, $compoundType = null, $dashType = null, $capType = null, $joinType = null, $headArrowType = null, $headArrowSize = null, $endArrowType = null, $endArrowSize = null): void
{ {
$this->activateObject(); $this->activateObject();
($line_width !== null) ($lineWidth !== null)
? $this->lineProperties['style']['width'] = $this->getExcelPointsWidth((float) $line_width) ? $this->lineProperties['style']['width'] = $this->getExcelPointsWidth((float) $lineWidth)
: null; : null;
($compound_type !== null) ($compoundType !== null)
? $this->lineProperties['style']['compound'] = (string) $compound_type ? $this->lineProperties['style']['compound'] = (string) $compoundType
: null; : null;
($dash_type !== null) ($dashType !== null)
? $this->lineProperties['style']['dash'] = (string) $dash_type ? $this->lineProperties['style']['dash'] = (string) $dashType
: null; : null;
($cap_type !== null) ($capType !== null)
? $this->lineProperties['style']['cap'] = (string) $cap_type ? $this->lineProperties['style']['cap'] = (string) $capType
: null; : null;
($join_type !== null) ($joinType !== null)
? $this->lineProperties['style']['join'] = (string) $join_type ? $this->lineProperties['style']['join'] = (string) $joinType
: null; : null;
($head_arrow_type !== null) ($headArrowType !== null)
? $this->lineProperties['style']['arrow']['head']['type'] = (string) $head_arrow_type ? $this->lineProperties['style']['arrow']['head']['type'] = (string) $headArrowType
: null; : null;
($head_arrow_size !== null) ($headArrowSize !== null)
? $this->lineProperties['style']['arrow']['head']['size'] = (string) $head_arrow_size ? $this->lineProperties['style']['arrow']['head']['size'] = (string) $headArrowSize
: null; : null;
($end_arrow_type !== null) ($endArrowType !== null)
? $this->lineProperties['style']['arrow']['end']['type'] = (string) $end_arrow_type ? $this->lineProperties['style']['arrow']['end']['type'] = (string) $endArrowType
: null; : null;
($end_arrow_size !== null) ($endArrowSize !== null)
? $this->lineProperties['style']['arrow']['end']['size'] = (string) $end_arrow_size ? $this->lineProperties['style']['arrow']['end']['size'] = (string) $endArrowSize
: null; : null;
} }
/** /**
* Get Line Color Property. * Get Line Color Property.
* *
* @param string $parameter * @param string $propertyName
* *
* @return string * @return string
*/ */
public function getLineColorProperty($parameter) public function getLineColorProperty($propertyName)
{ {
return $this->lineProperties['color'][$parameter]; return $this->lineProperties['color'][$propertyName];
} }
/** /**
@ -190,28 +190,28 @@ class GridLines extends Properties
* Set Glow Properties. * Set Glow Properties.
* *
* @param float $size * @param float $size
* @param string $color_value * @param string $colorValue
* @param int $color_alpha * @param int $colorAlpha
* @param string $color_type * @param string $colorType
*/ */
public function setGlowProperties($size, $color_value = null, $color_alpha = null, $color_type = null): void public function setGlowProperties($size, $colorValue = null, $colorAlpha = null, $colorType = null): void
{ {
$this $this
->activateObject() ->activateObject()
->setGlowSize($size) ->setGlowSize($size)
->setGlowColor($color_value, $color_alpha, $color_type); ->setGlowColor($colorValue, $colorAlpha, $colorType);
} }
/** /**
* Get Glow Color Property. * Get Glow Color Property.
* *
* @param string $property * @param string $propertyName
* *
* @return string * @return string
*/ */
public function getGlowColor($property) public function getGlowColor($propertyName)
{ {
return $this->glowProperties['color'][$property]; return $this->glowProperties['color'][$propertyName];
} }
/** /**
@ -243,11 +243,11 @@ class GridLines extends Properties
* *
* @param string $color * @param string $color
* @param int $alpha * @param int $alpha
* @param string $type * @param string $colorType
* *
* @return $this * @return $this
*/ */
private function setGlowColor($color, $alpha, $type) private function setGlowColor($color, $alpha, $colorType)
{ {
if ($color !== null) { if ($color !== null) {
$this->glowProperties['color']['value'] = (string) $color; $this->glowProperties['color']['value'] = (string) $color;
@ -255,8 +255,8 @@ class GridLines extends Properties
if ($alpha !== null) { if ($alpha !== null) {
$this->glowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha); $this->glowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha);
} }
if ($type !== null) { if ($colorType !== null) {
$this->glowProperties['color']['type'] = (string) $type; $this->glowProperties['color']['type'] = (string) $colorType;
} }
return $this; return $this;
@ -265,52 +265,52 @@ class GridLines extends Properties
/** /**
* Get Line Style Arrow Parameters. * Get Line Style Arrow Parameters.
* *
* @param string $arrow_selector * @param string $arrowSelector
* @param string $property_selector * @param string $propertySelector
* *
* @return string * @return string
*/ */
public function getLineStyleArrowParameters($arrow_selector, $property_selector) public function getLineStyleArrowParameters($arrowSelector, $propertySelector)
{ {
return $this->getLineStyleArrowSize($this->lineProperties['style']['arrow'][$arrow_selector]['size'], $property_selector); return $this->getLineStyleArrowSize($this->lineProperties['style']['arrow'][$arrowSelector]['size'], $propertySelector);
} }
/** /**
* Set Shadow Properties. * Set Shadow Properties.
* *
* @param int $sh_presets * @param int $presets
* @param string $sh_color_value * @param string $colorValue
* @param string $sh_color_type * @param string $colorType
* @param int $sh_color_alpha * @param int $colorAlpha
* @param string $sh_blur * @param string $blur
* @param int $sh_angle * @param int $angle
* @param float $sh_distance * @param float $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): void public function setShadowProperties($presets, $colorValue = null, $colorType = null, $colorAlpha = null, $blur = null, $angle = null, $distance = null): void
{ {
$this->activateObject() $this->activateObject()
->setShadowPresetsProperties((int) $sh_presets) ->setShadowPresetsProperties((int) $presets)
->setShadowColor( ->setShadowColor(
$sh_color_value === null ? $this->shadowProperties['color']['value'] : $sh_color_value, $colorValue === null ? $this->shadowProperties['color']['value'] : $colorValue,
$sh_color_alpha === null ? (int) $this->shadowProperties['color']['alpha'] : $this->getTrueAlpha($sh_color_alpha), $colorAlpha === null ? (int) $this->shadowProperties['color']['alpha'] : $this->getTrueAlpha($colorAlpha),
$sh_color_type === null ? $this->shadowProperties['color']['type'] : $sh_color_type $colorType === null ? $this->shadowProperties['color']['type'] : $colorType
) )
->setShadowBlur($sh_blur) ->setShadowBlur($blur)
->setShadowAngle($sh_angle) ->setShadowAngle($angle)
->setShadowDistance($sh_distance); ->setShadowDistance($distance);
} }
/** /**
* Set Shadow Presets Properties. * Set Shadow Presets Properties.
* *
* @param int $shadow_presets * @param int $presets
* *
* @return $this * @return $this
*/ */
private function setShadowPresetsProperties($shadow_presets) private function setShadowPresetsProperties($presets)
{ {
$this->shadowProperties['presets'] = $shadow_presets; $this->shadowProperties['presets'] = $presets;
$this->setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets)); $this->setShadowPropertiesMapValues($this->getShadowPresetsMap($presets));
return $this; return $this;
} }
@ -322,17 +322,17 @@ class GridLines extends Properties
* *
* @return $this * @return $this
*/ */
private function setShadowProperiesMapValues(array $properties_map, &$reference = null) private function setShadowPropertiesMapValues(array $propertiesMap, &$reference = null)
{ {
$base_reference = $reference; $base_reference = $reference;
foreach ($properties_map as $property_key => $property_val) { foreach ($propertiesMap as $property_key => $property_val) {
if (is_array($property_val)) { if (is_array($property_val)) {
if ($reference === null) { if ($reference === null) {
$reference = &$this->shadowProperties[$property_key]; $reference = &$this->shadowProperties[$property_key];
} else { } else {
$reference = &$reference[$property_key]; $reference = &$reference[$property_key];
} }
$this->setShadowProperiesMapValues($property_val, $reference); $this->setShadowPropertiesMapValues($property_val, $reference);
} else { } else {
if ($base_reference === null) { if ($base_reference === null) {
$this->shadowProperties[$property_key] = $property_val; $this->shadowProperties[$property_key] = $property_val;
@ -350,11 +350,11 @@ class GridLines extends Properties
* *
* @param string $color * @param string $color
* @param int $alpha * @param int $alpha
* @param string $type * @param string $colorType
* *
* @return $this * @return $this
*/ */
private function setShadowColor($color, $alpha, $type) private function setShadowColor($color, $alpha, $colorType)
{ {
if ($color !== null) { if ($color !== null) {
$this->shadowProperties['color']['value'] = (string) $color; $this->shadowProperties['color']['value'] = (string) $color;
@ -362,8 +362,8 @@ class GridLines extends Properties
if ($alpha !== null) { if ($alpha !== null) {
$this->shadowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha); $this->shadowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha);
} }
if ($type !== null) { if ($colorType !== null) {
$this->shadowProperties['color']['type'] = (string) $type; $this->shadowProperties['color']['type'] = (string) $colorType;
} }
return $this; return $this;

View File

@ -149,13 +149,13 @@ class Layout
/** /**
* Set Layout Target. * Set Layout Target.
* *
* @param string $value * @param string $target
* *
* @return $this * @return $this
*/ */
public function setLayoutTarget($value) public function setLayoutTarget($target)
{ {
$this->layoutTarget = $value; $this->layoutTarget = $target;
return $this; return $this;
} }
@ -173,13 +173,13 @@ class Layout
/** /**
* Set X-Mode. * Set X-Mode.
* *
* @param string $value * @param string $mode
* *
* @return $this * @return $this
*/ */
public function setXMode($value) public function setXMode($mode)
{ {
$this->xMode = (string) $value; $this->xMode = (string) $mode;
return $this; return $this;
} }
@ -197,13 +197,13 @@ class Layout
/** /**
* Set Y-Mode. * Set Y-Mode.
* *
* @param string $value * @param string $mode
* *
* @return $this * @return $this
*/ */
public function setYMode($value) public function setYMode($mode)
{ {
$this->yMode = (string) $value; $this->yMode = (string) $mode;
return $this; return $this;
} }
@ -221,13 +221,13 @@ class Layout
/** /**
* Set X-Position. * Set X-Position.
* *
* @param float $value * @param float $position
* *
* @return $this * @return $this
*/ */
public function setXPosition($value) public function setXPosition($position)
{ {
$this->xPos = (float) $value; $this->xPos = (float) $position;
return $this; return $this;
} }
@ -245,13 +245,13 @@ class Layout
/** /**
* Set Y-Position. * Set Y-Position.
* *
* @param float $value * @param float $position
* *
* @return $this * @return $this
*/ */
public function setYPosition($value) public function setYPosition($position)
{ {
$this->yPos = (float) $value; $this->yPos = (float) $position;
return $this; return $this;
} }
@ -269,13 +269,13 @@ class Layout
/** /**
* Set Width. * Set Width.
* *
* @param float $value * @param float $width
* *
* @return $this * @return $this
*/ */
public function setWidth($value) public function setWidth($width)
{ {
$this->width = $value; $this->width = $width;
return $this; return $this;
} }
@ -293,13 +293,13 @@ class Layout
/** /**
* Set Height. * Set Height.
* *
* @param float $value * @param float $height
* *
* @return $this * @return $this
*/ */
public function setHeight($value) public function setHeight($height)
{ {
$this->height = $value; $this->height = $height;
return $this; return $this;
} }
@ -318,13 +318,13 @@ class Layout
* Set show legend key * Set show legend key
* Specifies that legend keys should be shown in data labels. * Specifies that legend keys should be shown in data labels.
* *
* @param bool $value Show legend key * @param bool $showLegendKey Show legend key
* *
* @return $this * @return $this
*/ */
public function setShowLegendKey($value) public function setShowLegendKey($showLegendKey)
{ {
$this->showLegendKey = $value; $this->showLegendKey = $showLegendKey;
return $this; return $this;
} }
@ -343,13 +343,13 @@ class Layout
* Set show val * Set show val
* Specifies that the value should be shown in data labels. * Specifies that the value should be shown in data labels.
* *
* @param bool $value Show val * @param bool $showDataLabelValues Show val
* *
* @return $this * @return $this
*/ */
public function setShowVal($value) public function setShowVal($showDataLabelValues)
{ {
$this->showVal = $value; $this->showVal = $showDataLabelValues;
return $this; return $this;
} }
@ -368,13 +368,13 @@ class Layout
* Set show cat name * Set show cat name
* Specifies that the category name should be shown in data labels. * Specifies that the category name should be shown in data labels.
* *
* @param bool $value Show cat name * @param bool $showCategoryName Show cat name
* *
* @return $this * @return $this
*/ */
public function setShowCatName($value) public function setShowCatName($showCategoryName)
{ {
$this->showCatName = $value; $this->showCatName = $showCategoryName;
return $this; return $this;
} }
@ -393,13 +393,13 @@ class Layout
* Set show ser name * Set show ser name
* Specifies that the series name should be shown in data labels. * Specifies that the series name should be shown in data labels.
* *
* @param bool $value Show series name * @param bool $showSeriesName Show series name
* *
* @return $this * @return $this
*/ */
public function setShowSerName($value) public function setShowSerName($showSeriesName)
{ {
$this->showSerName = $value; $this->showSerName = $showSeriesName;
return $this; return $this;
} }
@ -418,13 +418,13 @@ class Layout
* Set show percentage * Set show percentage
* Specifies that the percentage should be shown in data labels. * Specifies that the percentage should be shown in data labels.
* *
* @param bool $value Show percentage * @param bool $showPercentage Show percentage
* *
* @return $this * @return $this
*/ */
public function setShowPercent($value) public function setShowPercent($showPercentage)
{ {
$this->showPercent = $value; $this->showPercent = $showPercentage;
return $this; return $this;
} }
@ -443,13 +443,13 @@ class Layout
* Set show bubble size * Set show bubble size
* Specifies that the bubble size should be shown in data labels. * Specifies that the bubble size should be shown in data labels.
* *
* @param bool $value Show bubble size * @param bool $showBubbleSize Show bubble size
* *
* @return $this * @return $this
*/ */
public function setShowBubbleSize($value) public function setShowBubbleSize($showBubbleSize)
{ {
$this->showBubbleSize = $value; $this->showBubbleSize = $showBubbleSize;
return $this; return $this;
} }
@ -468,13 +468,13 @@ class Layout
* Set show leader lines * Set show leader lines
* Specifies that leader lines should be shown in data labels. * Specifies that leader lines should be shown in data labels.
* *
* @param bool $value Show leader lines * @param bool $showLeaderLines Show leader lines
* *
* @return $this * @return $this
*/ */
public function setShowLeaderLines($value) public function setShowLeaderLines($showLeaderLines)
{ {
$this->showLeaderLines = $value; $this->showLeaderLines = $showLeaderLines;
return $this; return $this;
} }

View File

@ -135,16 +135,16 @@ abstract class Properties
return (string) 100 - $alpha . '000'; return (string) 100 - $alpha . '000';
} }
protected function setColorProperties($color, $alpha, $type) protected function setColorProperties($color, $alpha, $colorType)
{ {
return [ return [
'type' => (string) $type, 'type' => (string) $colorType,
'value' => (string) $color, 'value' => (string) $color,
'alpha' => (string) $this->getTrueAlpha($alpha), 'alpha' => (string) $this->getTrueAlpha($alpha),
]; ];
} }
protected function getLineStyleArrowSize($array_selector, $array_kay_selector) protected function getLineStyleArrowSize($arraySelector, $arrayKaySelector)
{ {
$sizes = [ $sizes = [
1 => ['w' => 'sm', 'len' => 'sm'], 1 => ['w' => 'sm', 'len' => 'sm'],
@ -158,10 +158,10 @@ abstract class Properties
9 => ['w' => 'lg', 'len' => 'lg'], 9 => ['w' => 'lg', 'len' => 'lg'],
]; ];
return $sizes[$array_selector][$array_kay_selector]; return $sizes[$arraySelector][$arrayKaySelector];
} }
protected function getShadowPresetsMap($shadow_presets_option) protected function getShadowPresetsMap($presetsOption)
{ {
$presets_options = [ $presets_options = [
//OUTER //OUTER
@ -350,7 +350,7 @@ abstract class Properties
], ],
]; ];
return $presets_options[$shadow_presets_option]; return $presets_options[$presetsOption];
} }
protected function getArrayElementsValue($properties, $elements) protected function getArrayElementsValue($properties, $elements)

View File

@ -86,18 +86,18 @@ class Cells
/** /**
* Whether the collection holds a cell for the given coordinate. * Whether the collection holds a cell for the given coordinate.
* *
* @param string $pCoord Coordinate of the cell to check * @param string $cellCoordinate Coordinate of the cell to check
* *
* @return bool * @return bool
*/ */
public function has($pCoord) public function has($cellCoordinate)
{ {
if ($pCoord === $this->currentCoordinate) { if ($cellCoordinate === $this->currentCoordinate) {
return true; return true;
} }
// Check if the requested entry exists in the index // Check if the requested entry exists in the index
return isset($this->index[$pCoord]); return isset($this->index[$cellCoordinate]);
} }
/** /**
@ -115,21 +115,21 @@ class Cells
/** /**
* Delete a cell in cache identified by coordinate. * Delete a cell in cache identified by coordinate.
* *
* @param string $pCoord Coordinate of the cell to delete * @param string $cellCoordinate Coordinate of the cell to delete
*/ */
public function delete($pCoord): void public function delete($cellCoordinate): void
{ {
if ($pCoord === $this->currentCoordinate && $this->currentCell !== null) { if ($cellCoordinate === $this->currentCoordinate && $this->currentCell !== null) {
$this->currentCell->detach(); $this->currentCell->detach();
$this->currentCoordinate = null; $this->currentCoordinate = null;
$this->currentCell = null; $this->currentCell = null;
$this->currentCellIsDirty = false; $this->currentCellIsDirty = false;
} }
unset($this->index[$pCoord]); unset($this->index[$cellCoordinate]);
// Delete the entry from cache // Delete the entry from cache
$this->cache->delete($this->cachePrefix . $pCoord); $this->cache->delete($this->cachePrefix . $cellCoordinate);
} }
/** /**
@ -304,16 +304,16 @@ class Cells
/** /**
* Clone the cell collection. * Clone the cell collection.
* *
* @param Worksheet $parent The new worksheet that we're copying to * @param Worksheet $worksheet The new worksheet that we're copying to
* *
* @return self * @return self
*/ */
public function cloneCellCollection(Worksheet $parent) public function cloneCellCollection(Worksheet $worksheet)
{ {
$this->storeCurrentCell(); $this->storeCurrentCell();
$newCollection = clone $this; $newCollection = clone $this;
$newCollection->parent = $parent; $newCollection->parent = $worksheet;
if (($newCollection->currentCell !== null) && (is_object($newCollection->currentCell))) { if (($newCollection->currentCell !== null) && (is_object($newCollection->currentCell))) {
$newCollection->currentCell->attach($this); $newCollection->currentCell->attach($this);
} }
@ -402,19 +402,19 @@ class Cells
/** /**
* Add or update a cell identified by its coordinate into the collection. * Add or update a cell identified by its coordinate into the collection.
* *
* @param string $pCoord Coordinate of the cell to update * @param string $cellCoordinate Coordinate of the cell to update
* @param Cell $cell Cell to update * @param Cell $cell Cell to update
* *
* @return \PhpOffice\PhpSpreadsheet\Cell\Cell * @return \PhpOffice\PhpSpreadsheet\Cell\Cell
*/ */
public function add($pCoord, Cell $cell) public function add($cellCoordinate, Cell $cell)
{ {
if ($pCoord !== $this->currentCoordinate) { if ($cellCoordinate !== $this->currentCoordinate) {
$this->storeCurrentCell(); $this->storeCurrentCell();
} }
$this->index[$pCoord] = true; $this->index[$cellCoordinate] = true;
$this->currentCoordinate = $pCoord; $this->currentCoordinate = $cellCoordinate;
$this->currentCell = $cell; $this->currentCell = $cell;
$this->currentCellIsDirty = true; $this->currentCellIsDirty = true;
@ -424,30 +424,30 @@ class Cells
/** /**
* Get cell at a specific coordinate. * Get cell at a specific coordinate.
* *
* @param string $pCoord Coordinate of the cell * @param string $cellCoordinate Coordinate of the cell
* *
* @return null|\PhpOffice\PhpSpreadsheet\Cell\Cell Cell that was found, or null if not found * @return null|\PhpOffice\PhpSpreadsheet\Cell\Cell Cell that was found, or null if not found
*/ */
public function get($pCoord) public function get($cellCoordinate)
{ {
if ($pCoord === $this->currentCoordinate) { if ($cellCoordinate === $this->currentCoordinate) {
return $this->currentCell; return $this->currentCell;
} }
$this->storeCurrentCell(); $this->storeCurrentCell();
// Return null if requested entry doesn't exist in collection // Return null if requested entry doesn't exist in collection
if (!$this->has($pCoord)) { if (!$this->has($cellCoordinate)) {
return null; return null;
} }
// Check if the entry that has been requested actually exists // Check if the entry that has been requested actually exists
$cell = $this->cache->get($this->cachePrefix . $pCoord); $cell = $this->cache->get($this->cachePrefix . $cellCoordinate);
if ($cell === null) { if ($cell === null) {
throw new PhpSpreadsheetException("Cell entry {$pCoord} no longer exists in cache. This probably means that the cache was cleared by someone else."); throw new PhpSpreadsheetException("Cell entry {$cellCoordinate} no longer exists in cache. This probably means that the cache was cleared by someone else.");
} }
// Set current entry to the requested entry // Set current entry to the requested entry
$this->currentCoordinate = $pCoord; $this->currentCoordinate = $cellCoordinate;
$this->currentCell = $cell; $this->currentCell = $cell;
// Re-attach this as the cell's parent // Re-attach this as the cell's parent
$this->currentCell->attach($this); $this->currentCell->attach($this);

View File

@ -10,12 +10,12 @@ abstract class CellsFactory
/** /**
* Initialise the cache storage. * Initialise the cache storage.
* *
* @param Worksheet $parent Enable cell caching for this worksheet * @param Worksheet $worksheet Enable cell caching for this worksheet
* *
* @return Cells * @return Cells
* */ * */
public static function getInstance(Worksheet $parent) public static function getInstance(Worksheet $worksheet)
{ {
return new Cells($parent, Settings::getCache()); return new Cells($worksheet, Settings::getCache());
} }
} }