Sane argument names in the Chart classes
This commit is contained in:
parent
b5c2709002
commit
b12cebe1f5
|
|
@ -167,30 +167,30 @@ class Axis extends Properties
|
|||
/**
|
||||
* Set Axis Options Properties.
|
||||
*
|
||||
* @param string $axis_labels
|
||||
* @param string $horizontal_crosses_value
|
||||
* @param string $horizontal_crosses
|
||||
* @param string $axis_orientation
|
||||
* @param string $major_tmt
|
||||
* @param string $minor_tmt
|
||||
* @param string $axisLabels
|
||||
* @param string $horizontalCrossesValue
|
||||
* @param string $horizontalCrosses
|
||||
* @param string $axisOrientation
|
||||
* @param string $majorTmt
|
||||
* @param string $minorTmt
|
||||
* @param string $minimum
|
||||
* @param string $maximum
|
||||
* @param string $major_unit
|
||||
* @param string $minor_unit
|
||||
* @param string $majorUnit
|
||||
* @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;
|
||||
($horizontal_crosses_value !== null) ? $this->axisOptions['horizontal_crosses_value'] = (string) $horizontal_crosses_value : null;
|
||||
($horizontal_crosses !== null) ? $this->axisOptions['horizontal_crosses'] = (string) $horizontal_crosses : null;
|
||||
($axis_orientation !== null) ? $this->axisOptions['orientation'] = (string) $axis_orientation : null;
|
||||
($major_tmt !== null) ? $this->axisOptions['major_tick_mark'] = (string) $major_tmt : null;
|
||||
($minor_tmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minor_tmt : null;
|
||||
($minor_tmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minor_tmt : null;
|
||||
$this->axisOptions['axis_labels'] = (string) $axisLabels;
|
||||
($horizontalCrossesValue !== null) ? $this->axisOptions['horizontal_crosses_value'] = (string) $horizontalCrossesValue : null;
|
||||
($horizontalCrosses !== null) ? $this->axisOptions['horizontal_crosses'] = (string) $horizontalCrosses : null;
|
||||
($axisOrientation !== null) ? $this->axisOptions['orientation'] = (string) $axisOrientation : null;
|
||||
($majorTmt !== null) ? $this->axisOptions['major_tick_mark'] = (string) $majorTmt : null;
|
||||
($minorTmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minorTmt : null;
|
||||
($minorTmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minorTmt : null;
|
||||
($minimum !== null) ? $this->axisOptions['minimum'] = (string) $minimum : null;
|
||||
($maximum !== null) ? $this->axisOptions['maximum'] = (string) $maximum : null;
|
||||
($major_unit !== null) ? $this->axisOptions['major_unit'] = (string) $major_unit : null;
|
||||
($minor_unit !== null) ? $this->axisOptions['minor_unit'] = (string) $minor_unit : null;
|
||||
($majorUnit !== null) ? $this->axisOptions['major_unit'] = (string) $majorUnit : null;
|
||||
($minorUnit !== null) ? $this->axisOptions['minor_unit'] = (string) $minorUnit : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -220,11 +220,11 @@ class Axis extends Properties
|
|||
*
|
||||
* @param string $color
|
||||
* @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 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.
|
||||
*
|
||||
* @param float $line_width
|
||||
* @param string $compound_type
|
||||
* @param string $dash_type
|
||||
* @param string $cap_type
|
||||
* @param string $join_type
|
||||
* @param string $head_arrow_type
|
||||
* @param string $head_arrow_size
|
||||
* @param string $end_arrow_type
|
||||
* @param string $end_arrow_size
|
||||
* @param float $lineWidth
|
||||
* @param string $compoundType
|
||||
* @param string $dashType
|
||||
* @param string $capType
|
||||
* @param string $joinType
|
||||
* @param string $headArrowType
|
||||
* @param string $headArrowSize
|
||||
* @param string $endArrowType
|
||||
* @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;
|
||||
($compound_type !== null) ? $this->lineStyleProperties['compound'] = (string) $compound_type : null;
|
||||
($dash_type !== null) ? $this->lineStyleProperties['dash'] = (string) $dash_type : null;
|
||||
($cap_type !== null) ? $this->lineStyleProperties['cap'] = (string) $cap_type : null;
|
||||
($join_type !== null) ? $this->lineStyleProperties['join'] = (string) $join_type : null;
|
||||
($head_arrow_type !== null) ? $this->lineStyleProperties['arrow']['head']['type'] = (string) $head_arrow_type : null;
|
||||
($head_arrow_size !== null) ? $this->lineStyleProperties['arrow']['head']['size'] = (string) $head_arrow_size : null;
|
||||
($end_arrow_type !== null) ? $this->lineStyleProperties['arrow']['end']['type'] = (string) $end_arrow_type : null;
|
||||
($end_arrow_size !== null) ? $this->lineStyleProperties['arrow']['end']['size'] = (string) $end_arrow_size : null;
|
||||
($lineWidth !== null) ? $this->lineStyleProperties['width'] = $this->getExcelPointsWidth((float) $lineWidth) : null;
|
||||
($compoundType !== null) ? $this->lineStyleProperties['compound'] = (string) $compoundType : null;
|
||||
($dashType !== null) ? $this->lineStyleProperties['dash'] = (string) $dashType : null;
|
||||
($capType !== null) ? $this->lineStyleProperties['cap'] = (string) $capType : null;
|
||||
($joinType !== null) ? $this->lineStyleProperties['join'] = (string) $joinType : null;
|
||||
($headArrowType !== null) ? $this->lineStyleProperties['arrow']['head']['type'] = (string) $headArrowType : null;
|
||||
($headArrowSize !== null) ? $this->lineStyleProperties['arrow']['head']['size'] = (string) $headArrowSize : null;
|
||||
($endArrowType !== null) ? $this->lineStyleProperties['arrow']['end']['type'] = (string) $endArrowType : null;
|
||||
($endArrowSize !== null) ? $this->lineStyleProperties['arrow']['end']['size'] = (string) $endArrowSize : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -328,38 +328,38 @@ class Axis extends Properties
|
|||
/**
|
||||
* Set Shadow Properties.
|
||||
*
|
||||
* @param int $sh_presets
|
||||
* @param string $sh_color_value
|
||||
* @param string $sh_color_type
|
||||
* @param string $sh_color_alpha
|
||||
* @param float $sh_blur
|
||||
* @param int $sh_angle
|
||||
* @param float $sh_distance
|
||||
* @param int $shadowPresets
|
||||
* @param string $colorValue
|
||||
* @param string $colorType
|
||||
* @param string $colorAlpha
|
||||
* @param float $blur
|
||||
* @param int $angle
|
||||
* @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(
|
||||
$sh_color_value === null ? $this->shadowProperties['color']['value'] : $sh_color_value,
|
||||
$sh_color_alpha === null ? (int) $this->shadowProperties['color']['alpha'] : $sh_color_alpha,
|
||||
$sh_color_type === null ? $this->shadowProperties['color']['type'] : $sh_color_type
|
||||
$colorValue === null ? $this->shadowProperties['color']['value'] : $colorValue,
|
||||
$colorAlpha === null ? (int) $this->shadowProperties['color']['alpha'] : $colorAlpha,
|
||||
$colorType === null ? $this->shadowProperties['color']['type'] : $colorType
|
||||
)
|
||||
->setShadowBlur($sh_blur)
|
||||
->setShadowAngle($sh_angle)
|
||||
->setShadowDistance($sh_distance);
|
||||
->setShadowBlur($blur)
|
||||
->setShadowAngle($angle)
|
||||
->setShadowDistance($distance);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shadow Color.
|
||||
*
|
||||
* @param int $shadow_presets
|
||||
* @param int $presets
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setShadowPresetsProperties($shadow_presets)
|
||||
private function setShadowPresetsProperties($presets)
|
||||
{
|
||||
$this->shadowProperties['presets'] = $shadow_presets;
|
||||
$this->setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets));
|
||||
$this->shadowProperties['presets'] = $presets;
|
||||
$this->setShadowPropertiesMapValues($this->getShadowPresetsMap($presets));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -371,17 +371,17 @@ class Axis extends Properties
|
|||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setShadowProperiesMapValues(array $properties_map, &$reference = null)
|
||||
private function setShadowPropertiesMapValues(array $propertiesMap, &$reference = null)
|
||||
{
|
||||
$base_reference = $reference;
|
||||
foreach ($properties_map as $property_key => $property_val) {
|
||||
foreach ($propertiesMap as $property_key => $property_val) {
|
||||
if (is_array($property_val)) {
|
||||
if ($reference === null) {
|
||||
$reference = &$this->shadowProperties[$property_key];
|
||||
} else {
|
||||
$reference = &$reference[$property_key];
|
||||
}
|
||||
$this->setShadowProperiesMapValues($property_val, $reference);
|
||||
$this->setShadowPropertiesMapValues($property_val, $reference);
|
||||
} else {
|
||||
if ($base_reference === null) {
|
||||
$this->shadowProperties[$property_key] = $property_val;
|
||||
|
|
@ -399,13 +399,13 @@ class Axis extends Properties
|
|||
*
|
||||
* @param string $color
|
||||
* @param int $alpha
|
||||
* @param string $type
|
||||
* @param string $alphaType
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
|
@ -474,17 +474,17 @@ class Axis extends Properties
|
|||
* Set Glow Properties.
|
||||
*
|
||||
* @param float $size
|
||||
* @param string $color_value
|
||||
* @param int $color_alpha
|
||||
* @param string $color_type
|
||||
* @param string $colorValue
|
||||
* @param int $colorAlpha
|
||||
* @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)
|
||||
->setGlowColor(
|
||||
$color_value === null ? $this->glowProperties['color']['value'] : $color_value,
|
||||
$color_alpha === null ? (int) $this->glowProperties['color']['alpha'] : $color_alpha,
|
||||
$color_type === null ? $this->glowProperties['color']['type'] : $color_type
|
||||
$colorValue === null ? $this->glowProperties['color']['value'] : $colorValue,
|
||||
$colorAlpha === null ? (int) $this->glowProperties['color']['alpha'] : $colorAlpha,
|
||||
$colorType === null ? $this->glowProperties['color']['type'] : $colorType
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -521,13 +521,13 @@ class Axis extends Properties
|
|||
*
|
||||
* @param string $color
|
||||
* @param int $alpha
|
||||
* @param string $type
|
||||
* @param string $colorType
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,13 +186,13 @@ class Chart
|
|||
/**
|
||||
* Set Worksheet.
|
||||
*
|
||||
* @param Worksheet $pValue
|
||||
* @param Worksheet $worksheet
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setWorksheet(?Worksheet $pValue = null)
|
||||
public function setWorksheet(?Worksheet $worksheet = null)
|
||||
{
|
||||
$this->worksheet = $pValue;
|
||||
$this->worksheet = $worksheet;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,73 +105,73 @@ class GridLines extends Properties
|
|||
*
|
||||
* @param string $value
|
||||
* @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()
|
||||
->lineProperties['color'] = $this->setColorProperties(
|
||||
$value,
|
||||
$alpha,
|
||||
$type
|
||||
$colorType
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Line Color Properties.
|
||||
*
|
||||
* @param float $line_width
|
||||
* @param string $compound_type
|
||||
* @param string $dash_type
|
||||
* @param string $cap_type
|
||||
* @param string $join_type
|
||||
* @param string $head_arrow_type
|
||||
* @param string $head_arrow_size
|
||||
* @param string $end_arrow_type
|
||||
* @param string $end_arrow_size
|
||||
* @param float $lineWidth
|
||||
* @param string $compoundType
|
||||
* @param string $dashType
|
||||
* @param string $capType
|
||||
* @param string $joinType
|
||||
* @param string $headArrowType
|
||||
* @param string $headArrowSize
|
||||
* @param string $endArrowType
|
||||
* @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();
|
||||
($line_width !== null)
|
||||
? $this->lineProperties['style']['width'] = $this->getExcelPointsWidth((float) $line_width)
|
||||
($lineWidth !== null)
|
||||
? $this->lineProperties['style']['width'] = $this->getExcelPointsWidth((float) $lineWidth)
|
||||
: null;
|
||||
($compound_type !== null)
|
||||
? $this->lineProperties['style']['compound'] = (string) $compound_type
|
||||
($compoundType !== null)
|
||||
? $this->lineProperties['style']['compound'] = (string) $compoundType
|
||||
: null;
|
||||
($dash_type !== null)
|
||||
? $this->lineProperties['style']['dash'] = (string) $dash_type
|
||||
($dashType !== null)
|
||||
? $this->lineProperties['style']['dash'] = (string) $dashType
|
||||
: null;
|
||||
($cap_type !== null)
|
||||
? $this->lineProperties['style']['cap'] = (string) $cap_type
|
||||
($capType !== null)
|
||||
? $this->lineProperties['style']['cap'] = (string) $capType
|
||||
: null;
|
||||
($join_type !== null)
|
||||
? $this->lineProperties['style']['join'] = (string) $join_type
|
||||
($joinType !== null)
|
||||
? $this->lineProperties['style']['join'] = (string) $joinType
|
||||
: null;
|
||||
($head_arrow_type !== null)
|
||||
? $this->lineProperties['style']['arrow']['head']['type'] = (string) $head_arrow_type
|
||||
($headArrowType !== null)
|
||||
? $this->lineProperties['style']['arrow']['head']['type'] = (string) $headArrowType
|
||||
: null;
|
||||
($head_arrow_size !== null)
|
||||
? $this->lineProperties['style']['arrow']['head']['size'] = (string) $head_arrow_size
|
||||
($headArrowSize !== null)
|
||||
? $this->lineProperties['style']['arrow']['head']['size'] = (string) $headArrowSize
|
||||
: null;
|
||||
($end_arrow_type !== null)
|
||||
? $this->lineProperties['style']['arrow']['end']['type'] = (string) $end_arrow_type
|
||||
($endArrowType !== null)
|
||||
? $this->lineProperties['style']['arrow']['end']['type'] = (string) $endArrowType
|
||||
: null;
|
||||
($end_arrow_size !== null)
|
||||
? $this->lineProperties['style']['arrow']['end']['size'] = (string) $end_arrow_size
|
||||
($endArrowSize !== null)
|
||||
? $this->lineProperties['style']['arrow']['end']['size'] = (string) $endArrowSize
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Line Color Property.
|
||||
*
|
||||
* @param string $parameter
|
||||
* @param string $propertyName
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @param float $size
|
||||
* @param string $color_value
|
||||
* @param int $color_alpha
|
||||
* @param string $color_type
|
||||
* @param string $colorValue
|
||||
* @param int $colorAlpha
|
||||
* @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
|
||||
->activateObject()
|
||||
->setGlowSize($size)
|
||||
->setGlowColor($color_value, $color_alpha, $color_type);
|
||||
->setGlowColor($colorValue, $colorAlpha, $colorType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Glow Color Property.
|
||||
*
|
||||
* @param string $property
|
||||
* @param string $propertyName
|
||||
*
|
||||
* @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 int $alpha
|
||||
* @param string $type
|
||||
* @param string $colorType
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setGlowColor($color, $alpha, $type)
|
||||
private function setGlowColor($color, $alpha, $colorType)
|
||||
{
|
||||
if ($color !== null) {
|
||||
$this->glowProperties['color']['value'] = (string) $color;
|
||||
|
|
@ -255,8 +255,8 @@ class GridLines extends Properties
|
|||
if ($alpha !== null) {
|
||||
$this->glowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha);
|
||||
}
|
||||
if ($type !== null) {
|
||||
$this->glowProperties['color']['type'] = (string) $type;
|
||||
if ($colorType !== null) {
|
||||
$this->glowProperties['color']['type'] = (string) $colorType;
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
@ -265,52 +265,52 @@ class GridLines extends Properties
|
|||
/**
|
||||
* Get Line Style Arrow Parameters.
|
||||
*
|
||||
* @param string $arrow_selector
|
||||
* @param string $property_selector
|
||||
* @param string $arrowSelector
|
||||
* @param string $propertySelector
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @param int $sh_presets
|
||||
* @param string $sh_color_value
|
||||
* @param string $sh_color_type
|
||||
* @param int $sh_color_alpha
|
||||
* @param string $sh_blur
|
||||
* @param int $sh_angle
|
||||
* @param float $sh_distance
|
||||
* @param int $presets
|
||||
* @param string $colorValue
|
||||
* @param string $colorType
|
||||
* @param int $colorAlpha
|
||||
* @param string $blur
|
||||
* @param int $angle
|
||||
* @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()
|
||||
->setShadowPresetsProperties((int) $sh_presets)
|
||||
->setShadowPresetsProperties((int) $presets)
|
||||
->setShadowColor(
|
||||
$sh_color_value === null ? $this->shadowProperties['color']['value'] : $sh_color_value,
|
||||
$sh_color_alpha === null ? (int) $this->shadowProperties['color']['alpha'] : $this->getTrueAlpha($sh_color_alpha),
|
||||
$sh_color_type === null ? $this->shadowProperties['color']['type'] : $sh_color_type
|
||||
$colorValue === null ? $this->shadowProperties['color']['value'] : $colorValue,
|
||||
$colorAlpha === null ? (int) $this->shadowProperties['color']['alpha'] : $this->getTrueAlpha($colorAlpha),
|
||||
$colorType === null ? $this->shadowProperties['color']['type'] : $colorType
|
||||
)
|
||||
->setShadowBlur($sh_blur)
|
||||
->setShadowAngle($sh_angle)
|
||||
->setShadowDistance($sh_distance);
|
||||
->setShadowBlur($blur)
|
||||
->setShadowAngle($angle)
|
||||
->setShadowDistance($distance);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Shadow Presets Properties.
|
||||
*
|
||||
* @param int $shadow_presets
|
||||
* @param int $presets
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setShadowPresetsProperties($shadow_presets)
|
||||
private function setShadowPresetsProperties($presets)
|
||||
{
|
||||
$this->shadowProperties['presets'] = $shadow_presets;
|
||||
$this->setShadowProperiesMapValues($this->getShadowPresetsMap($shadow_presets));
|
||||
$this->shadowProperties['presets'] = $presets;
|
||||
$this->setShadowPropertiesMapValues($this->getShadowPresetsMap($presets));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -322,17 +322,17 @@ class GridLines extends Properties
|
|||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setShadowProperiesMapValues(array $properties_map, &$reference = null)
|
||||
private function setShadowPropertiesMapValues(array $propertiesMap, &$reference = null)
|
||||
{
|
||||
$base_reference = $reference;
|
||||
foreach ($properties_map as $property_key => $property_val) {
|
||||
foreach ($propertiesMap as $property_key => $property_val) {
|
||||
if (is_array($property_val)) {
|
||||
if ($reference === null) {
|
||||
$reference = &$this->shadowProperties[$property_key];
|
||||
} else {
|
||||
$reference = &$reference[$property_key];
|
||||
}
|
||||
$this->setShadowProperiesMapValues($property_val, $reference);
|
||||
$this->setShadowPropertiesMapValues($property_val, $reference);
|
||||
} else {
|
||||
if ($base_reference === null) {
|
||||
$this->shadowProperties[$property_key] = $property_val;
|
||||
|
|
@ -350,11 +350,11 @@ class GridLines extends Properties
|
|||
*
|
||||
* @param string $color
|
||||
* @param int $alpha
|
||||
* @param string $type
|
||||
* @param string $colorType
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
private function setShadowColor($color, $alpha, $type)
|
||||
private function setShadowColor($color, $alpha, $colorType)
|
||||
{
|
||||
if ($color !== null) {
|
||||
$this->shadowProperties['color']['value'] = (string) $color;
|
||||
|
|
@ -362,8 +362,8 @@ class GridLines extends Properties
|
|||
if ($alpha !== null) {
|
||||
$this->shadowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha);
|
||||
}
|
||||
if ($type !== null) {
|
||||
$this->shadowProperties['color']['type'] = (string) $type;
|
||||
if ($colorType !== null) {
|
||||
$this->shadowProperties['color']['type'] = (string) $colorType;
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
|
|||
|
|
@ -149,13 +149,13 @@ class Layout
|
|||
/**
|
||||
* Set Layout Target.
|
||||
*
|
||||
* @param string $value
|
||||
* @param string $target
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLayoutTarget($value)
|
||||
public function setLayoutTarget($target)
|
||||
{
|
||||
$this->layoutTarget = $value;
|
||||
$this->layoutTarget = $target;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -173,13 +173,13 @@ class Layout
|
|||
/**
|
||||
* Set X-Mode.
|
||||
*
|
||||
* @param string $value
|
||||
* @param string $mode
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setXMode($value)
|
||||
public function setXMode($mode)
|
||||
{
|
||||
$this->xMode = (string) $value;
|
||||
$this->xMode = (string) $mode;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -197,13 +197,13 @@ class Layout
|
|||
/**
|
||||
* Set Y-Mode.
|
||||
*
|
||||
* @param string $value
|
||||
* @param string $mode
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setYMode($value)
|
||||
public function setYMode($mode)
|
||||
{
|
||||
$this->yMode = (string) $value;
|
||||
$this->yMode = (string) $mode;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -221,13 +221,13 @@ class Layout
|
|||
/**
|
||||
* Set X-Position.
|
||||
*
|
||||
* @param float $value
|
||||
* @param float $position
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setXPosition($value)
|
||||
public function setXPosition($position)
|
||||
{
|
||||
$this->xPos = (float) $value;
|
||||
$this->xPos = (float) $position;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -245,13 +245,13 @@ class Layout
|
|||
/**
|
||||
* Set Y-Position.
|
||||
*
|
||||
* @param float $value
|
||||
* @param float $position
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setYPosition($value)
|
||||
public function setYPosition($position)
|
||||
{
|
||||
$this->yPos = (float) $value;
|
||||
$this->yPos = (float) $position;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -269,13 +269,13 @@ class Layout
|
|||
/**
|
||||
* Set Width.
|
||||
*
|
||||
* @param float $value
|
||||
* @param float $width
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setWidth($value)
|
||||
public function setWidth($width)
|
||||
{
|
||||
$this->width = $value;
|
||||
$this->width = $width;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -293,13 +293,13 @@ class Layout
|
|||
/**
|
||||
* Set Height.
|
||||
*
|
||||
* @param float $value
|
||||
* @param float $height
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setHeight($value)
|
||||
public function setHeight($height)
|
||||
{
|
||||
$this->height = $value;
|
||||
$this->height = $height;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -318,13 +318,13 @@ class Layout
|
|||
* Set show legend key
|
||||
* Specifies that legend keys should be shown in data labels.
|
||||
*
|
||||
* @param bool $value Show legend key
|
||||
* @param bool $showLegendKey Show legend key
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShowLegendKey($value)
|
||||
public function setShowLegendKey($showLegendKey)
|
||||
{
|
||||
$this->showLegendKey = $value;
|
||||
$this->showLegendKey = $showLegendKey;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -343,13 +343,13 @@ class Layout
|
|||
* Set show val
|
||||
* Specifies that the value should be shown in data labels.
|
||||
*
|
||||
* @param bool $value Show val
|
||||
* @param bool $showDataLabelValues Show val
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShowVal($value)
|
||||
public function setShowVal($showDataLabelValues)
|
||||
{
|
||||
$this->showVal = $value;
|
||||
$this->showVal = $showDataLabelValues;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -368,13 +368,13 @@ class Layout
|
|||
* Set show cat name
|
||||
* 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
|
||||
*/
|
||||
public function setShowCatName($value)
|
||||
public function setShowCatName($showCategoryName)
|
||||
{
|
||||
$this->showCatName = $value;
|
||||
$this->showCatName = $showCategoryName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -393,13 +393,13 @@ class Layout
|
|||
* Set show ser name
|
||||
* 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
|
||||
*/
|
||||
public function setShowSerName($value)
|
||||
public function setShowSerName($showSeriesName)
|
||||
{
|
||||
$this->showSerName = $value;
|
||||
$this->showSerName = $showSeriesName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -418,13 +418,13 @@ class Layout
|
|||
* Set show percentage
|
||||
* Specifies that the percentage should be shown in data labels.
|
||||
*
|
||||
* @param bool $value Show percentage
|
||||
* @param bool $showPercentage Show percentage
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShowPercent($value)
|
||||
public function setShowPercent($showPercentage)
|
||||
{
|
||||
$this->showPercent = $value;
|
||||
$this->showPercent = $showPercentage;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -443,13 +443,13 @@ class Layout
|
|||
* Set show bubble size
|
||||
* 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
|
||||
*/
|
||||
public function setShowBubbleSize($value)
|
||||
public function setShowBubbleSize($showBubbleSize)
|
||||
{
|
||||
$this->showBubbleSize = $value;
|
||||
$this->showBubbleSize = $showBubbleSize;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -468,13 +468,13 @@ class Layout
|
|||
* Set show leader lines
|
||||
* Specifies that leader lines should be shown in data labels.
|
||||
*
|
||||
* @param bool $value Show leader lines
|
||||
* @param bool $showLeaderLines Show leader lines
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setShowLeaderLines($value)
|
||||
public function setShowLeaderLines($showLeaderLines)
|
||||
{
|
||||
$this->showLeaderLines = $value;
|
||||
$this->showLeaderLines = $showLeaderLines;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,16 +135,16 @@ abstract class Properties
|
|||
return (string) 100 - $alpha . '000';
|
||||
}
|
||||
|
||||
protected function setColorProperties($color, $alpha, $type)
|
||||
protected function setColorProperties($color, $alpha, $colorType)
|
||||
{
|
||||
return [
|
||||
'type' => (string) $type,
|
||||
'type' => (string) $colorType,
|
||||
'value' => (string) $color,
|
||||
'alpha' => (string) $this->getTrueAlpha($alpha),
|
||||
];
|
||||
}
|
||||
|
||||
protected function getLineStyleArrowSize($array_selector, $array_kay_selector)
|
||||
protected function getLineStyleArrowSize($arraySelector, $arrayKaySelector)
|
||||
{
|
||||
$sizes = [
|
||||
1 => ['w' => 'sm', 'len' => 'sm'],
|
||||
|
|
@ -158,10 +158,10 @@ abstract class Properties
|
|||
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 = [
|
||||
//OUTER
|
||||
|
|
@ -350,7 +350,7 @@ abstract class Properties
|
|||
],
|
||||
];
|
||||
|
||||
return $presets_options[$shadow_presets_option];
|
||||
return $presets_options[$presetsOption];
|
||||
}
|
||||
|
||||
protected function getArrayElementsValue($properties, $elements)
|
||||
|
|
|
|||
|
|
@ -86,18 +86,18 @@ class Cells
|
|||
/**
|
||||
* 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
|
||||
*/
|
||||
public function has($pCoord)
|
||||
public function has($cellCoordinate)
|
||||
{
|
||||
if ($pCoord === $this->currentCoordinate) {
|
||||
if ($cellCoordinate === $this->currentCoordinate) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 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.
|
||||
*
|
||||
* @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->currentCoordinate = null;
|
||||
$this->currentCell = null;
|
||||
$this->currentCellIsDirty = false;
|
||||
}
|
||||
|
||||
unset($this->index[$pCoord]);
|
||||
unset($this->index[$cellCoordinate]);
|
||||
|
||||
// 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.
|
||||
*
|
||||
* @param Worksheet $parent The new worksheet that we're copying to
|
||||
* @param Worksheet $worksheet The new worksheet that we're copying to
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function cloneCellCollection(Worksheet $parent)
|
||||
public function cloneCellCollection(Worksheet $worksheet)
|
||||
{
|
||||
$this->storeCurrentCell();
|
||||
$newCollection = clone $this;
|
||||
|
||||
$newCollection->parent = $parent;
|
||||
$newCollection->parent = $worksheet;
|
||||
if (($newCollection->currentCell !== null) && (is_object($newCollection->currentCell))) {
|
||||
$newCollection->currentCell->attach($this);
|
||||
}
|
||||
|
|
@ -402,19 +402,19 @@ class Cells
|
|||
/**
|
||||
* 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
|
||||
*
|
||||
* @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->index[$pCoord] = true;
|
||||
$this->index[$cellCoordinate] = true;
|
||||
|
||||
$this->currentCoordinate = $pCoord;
|
||||
$this->currentCoordinate = $cellCoordinate;
|
||||
$this->currentCell = $cell;
|
||||
$this->currentCellIsDirty = true;
|
||||
|
||||
|
|
@ -424,30 +424,30 @@ class Cells
|
|||
/**
|
||||
* 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
|
||||
*/
|
||||
public function get($pCoord)
|
||||
public function get($cellCoordinate)
|
||||
{
|
||||
if ($pCoord === $this->currentCoordinate) {
|
||||
if ($cellCoordinate === $this->currentCoordinate) {
|
||||
return $this->currentCell;
|
||||
}
|
||||
$this->storeCurrentCell();
|
||||
|
||||
// Return null if requested entry doesn't exist in collection
|
||||
if (!$this->has($pCoord)) {
|
||||
if (!$this->has($cellCoordinate)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 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) {
|
||||
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
|
||||
$this->currentCoordinate = $pCoord;
|
||||
$this->currentCoordinate = $cellCoordinate;
|
||||
$this->currentCell = $cell;
|
||||
// Re-attach this as the cell's parent
|
||||
$this->currentCell->attach($this);
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ abstract class CellsFactory
|
|||
/**
|
||||
* Initialise the cache storage.
|
||||
*
|
||||
* @param Worksheet $parent Enable cell caching for this worksheet
|
||||
* @param Worksheet $worksheet Enable cell caching for this worksheet
|
||||
*
|
||||
* @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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue