Remove default values for function that should not have any default
Having default values made it harder for end-user to figure out whether it the arguement had to be supplied or not. Ommitting the argument may lead to hard to debug issues, and is overall not a good idea. Closes #110
This commit is contained in:
parent
67581a0dd5
commit
033a4bdad5
|
@ -171,3 +171,24 @@ to `\PhpOffice\PhpSpreadsheet::getCoordinates()` and
|
||||||
`\PhpOffice\PhpSpreadsheet::getCellCollection()` for clarity.
|
`\PhpOffice\PhpSpreadsheet::getCellCollection()` for clarity.
|
||||||
|
|
||||||
Refer to [the new documentation](./memory_saving.md) to see how to migrate.
|
Refer to [the new documentation](./memory_saving.md) to see how to migrate.
|
||||||
|
|
||||||
|
## Dropped conditionally returned cell
|
||||||
|
|
||||||
|
For all the following methods, it is no more possible to change the type of
|
||||||
|
returned value. It always return the Worksheet and never the Cell or Rule:
|
||||||
|
|
||||||
|
- Worksheet::setCellValue()
|
||||||
|
- Worksheet::setCellValueByColumnAndRow()
|
||||||
|
- Worksheet::setCellValueExplicit()
|
||||||
|
- Worksheet::setCellValueExplicitByColumnAndRow()
|
||||||
|
- Worksheet::addRule()
|
||||||
|
|
||||||
|
Migration would be similar to:
|
||||||
|
|
||||||
|
``` php
|
||||||
|
// Before
|
||||||
|
$cell = $worksheet->setCellValue('A1', 'value', true);
|
||||||
|
|
||||||
|
// After
|
||||||
|
$cell = $worksheet->getCell('A1')->setValue('value');
|
||||||
|
```
|
||||||
|
|
|
@ -74,7 +74,7 @@ class Logger
|
||||||
*
|
*
|
||||||
* @param bool $pValue
|
* @param bool $pValue
|
||||||
*/
|
*/
|
||||||
public function setWriteDebugLog($pValue = false)
|
public function setWriteDebugLog($pValue)
|
||||||
{
|
{
|
||||||
$this->writeDebugLog = $pValue;
|
$this->writeDebugLog = $pValue;
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ class Logger
|
||||||
*
|
*
|
||||||
* @param bool $pValue
|
* @param bool $pValue
|
||||||
*/
|
*/
|
||||||
public function setEchoDebugLog($pValue = false)
|
public function setEchoDebugLog($pValue)
|
||||||
{
|
{
|
||||||
$this->echoDebugLog = $pValue;
|
$this->echoDebugLog = $pValue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2176,7 +2176,7 @@ class Calculation
|
||||||
*
|
*
|
||||||
* @param bool $pValue
|
* @param bool $pValue
|
||||||
*/
|
*/
|
||||||
public function setCalculationCacheEnabled($pValue = true)
|
public function setCalculationCacheEnabled($pValue)
|
||||||
{
|
{
|
||||||
$this->calculationCacheEnabled = $pValue;
|
$this->calculationCacheEnabled = $pValue;
|
||||||
$this->clearCalculationCache();
|
$this->clearCalculationCache();
|
||||||
|
@ -2245,11 +2245,11 @@ class Calculation
|
||||||
/**
|
/**
|
||||||
* Set the locale code.
|
* Set the locale code.
|
||||||
*
|
*
|
||||||
* @param string $locale The locale to use for formula translation
|
* @param string $locale The locale to use for formula translation, eg: 'en_us'
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function setLocale($locale = 'en_us')
|
public function setLocale($locale)
|
||||||
{
|
{
|
||||||
// Identify our locale and language
|
// Identify our locale and language
|
||||||
$language = $locale = strtolower($locale);
|
$language = $locale = strtolower($locale);
|
||||||
|
|
|
@ -142,11 +142,11 @@ class FormulaToken
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Token Type.
|
* Set Token Type (represented by TOKEN_TYPE_*).
|
||||||
*
|
*
|
||||||
* @param string $value
|
* @param string $value
|
||||||
*/
|
*/
|
||||||
public function setTokenType($value = self::TOKEN_TYPE_UNKNOWN)
|
public function setTokenType($value)
|
||||||
{
|
{
|
||||||
$this->tokenType = $value;
|
$this->tokenType = $value;
|
||||||
}
|
}
|
||||||
|
@ -162,11 +162,11 @@ class FormulaToken
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Token SubType.
|
* Set Token SubType (represented by TOKEN_SUBTYPE_*).
|
||||||
*
|
*
|
||||||
* @param string $value
|
* @param string $value
|
||||||
*/
|
*/
|
||||||
public function setTokenSubType($value = self::TOKEN_SUBTYPE_NOTHING)
|
public function setTokenSubType($value)
|
||||||
{
|
{
|
||||||
$this->tokenSubType = $value;
|
$this->tokenSubType = $value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,7 +202,7 @@ class Cell
|
||||||
*
|
*
|
||||||
* @return Cell
|
* @return Cell
|
||||||
*/
|
*/
|
||||||
public function setValue($pValue = null)
|
public function setValue($pValue)
|
||||||
{
|
{
|
||||||
if (!self::getValueBinder()->bindValue($this, $pValue)) {
|
if (!self::getValueBinder()->bindValue($this, $pValue)) {
|
||||||
throw new Exception('Value could not be bound to cell.');
|
throw new Exception('Value could not be bound to cell.');
|
||||||
|
@ -215,13 +215,13 @@ class Cell
|
||||||
* Set the value for a cell, with the explicit data type passed to the method (bypassing any use of the value binder).
|
* Set the value for a cell, with the explicit data type passed to the method (bypassing any use of the value binder).
|
||||||
*
|
*
|
||||||
* @param mixed $pValue Value
|
* @param mixed $pValue Value
|
||||||
* @param string $pDataType Explicit data type
|
* @param string $pDataType Explicit data type, see Cell\DataType::TYPE_*
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @return Cell
|
* @return Cell
|
||||||
*/
|
*/
|
||||||
public function setValueExplicit($pValue = null, $pDataType = Cell\DataType::TYPE_STRING)
|
public function setValueExplicit($pValue, $pDataType)
|
||||||
{
|
{
|
||||||
// set the value according to data type
|
// set the value according to data type
|
||||||
switch ($pDataType) {
|
switch ($pDataType) {
|
||||||
|
@ -311,7 +311,7 @@ class Cell
|
||||||
*
|
*
|
||||||
* @return Cell
|
* @return Cell
|
||||||
*/
|
*/
|
||||||
public function setCalculatedValue($pValue = null)
|
public function setCalculatedValue($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue !== null) {
|
if ($pValue !== null) {
|
||||||
$this->calculatedValue = (is_numeric($pValue)) ? (float) $pValue : $pValue;
|
$this->calculatedValue = (is_numeric($pValue)) ? (float) $pValue : $pValue;
|
||||||
|
@ -348,11 +348,11 @@ class Cell
|
||||||
/**
|
/**
|
||||||
* Set cell data type.
|
* Set cell data type.
|
||||||
*
|
*
|
||||||
* @param string $pDataType
|
* @param string $pDataType see Cell\DataType::TYPE_*
|
||||||
*
|
*
|
||||||
* @return Cell
|
* @return Cell
|
||||||
*/
|
*/
|
||||||
public function setDataType($pDataType = Cell\DataType::TYPE_STRING)
|
public function setDataType($pDataType)
|
||||||
{
|
{
|
||||||
if ($pDataType == Cell\DataType::TYPE_STRING2) {
|
if ($pDataType == Cell\DataType::TYPE_STRING2) {
|
||||||
$pDataType = Cell\DataType::TYPE_STRING;
|
$pDataType = Cell\DataType::TYPE_STRING;
|
||||||
|
@ -571,7 +571,7 @@ class Cell
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isInRange($pRange = 'A1:A1')
|
public function isInRange($pRange)
|
||||||
{
|
{
|
||||||
list($rangeStart, $rangeEnd) = self::rangeBoundaries($pRange);
|
list($rangeStart, $rangeEnd) = self::rangeBoundaries($pRange);
|
||||||
|
|
||||||
|
@ -587,13 +587,13 @@ class Cell
|
||||||
/**
|
/**
|
||||||
* Coordinate from string.
|
* Coordinate from string.
|
||||||
*
|
*
|
||||||
* @param string $pCoordinateString
|
* @param string $pCoordinateString eg: 'A1'
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @return string[] Array containing column and row (indexes 0 and 1)
|
* @return string[] Array containing column and row (indexes 0 and 1)
|
||||||
*/
|
*/
|
||||||
public static function coordinateFromString($pCoordinateString = 'A1')
|
public static function coordinateFromString($pCoordinateString)
|
||||||
{
|
{
|
||||||
if (preg_match("/^([$]?[A-Z]{1,3})([$]?\d{1,7})$/", $pCoordinateString, $matches)) {
|
if (preg_match("/^([$]?[A-Z]{1,3})([$]?\d{1,7})$/", $pCoordinateString, $matches)) {
|
||||||
return [$matches[1], $matches[2]];
|
return [$matches[1], $matches[2]];
|
||||||
|
@ -616,7 +616,7 @@ class Cell
|
||||||
*
|
*
|
||||||
* @return string Absolute coordinate e.g. '$A' or '$1' or '$A$1'
|
* @return string Absolute coordinate e.g. '$A' or '$1' or '$A$1'
|
||||||
*/
|
*/
|
||||||
public static function absoluteReference($pCoordinateString = 'A1')
|
public static function absoluteReference($pCoordinateString)
|
||||||
{
|
{
|
||||||
if (strpos($pCoordinateString, ':') === false && strpos($pCoordinateString, ',') === false) {
|
if (strpos($pCoordinateString, ':') === false && strpos($pCoordinateString, ',') === false) {
|
||||||
// Split out any worksheet name from the reference
|
// Split out any worksheet name from the reference
|
||||||
|
@ -651,7 +651,7 @@ class Cell
|
||||||
*
|
*
|
||||||
* @return string Absolute coordinate e.g. '$A$1'
|
* @return string Absolute coordinate e.g. '$A$1'
|
||||||
*/
|
*/
|
||||||
public static function absoluteCoordinate($pCoordinateString = 'A1')
|
public static function absoluteCoordinate($pCoordinateString)
|
||||||
{
|
{
|
||||||
if (strpos($pCoordinateString, ':') === false && strpos($pCoordinateString, ',') === false) {
|
if (strpos($pCoordinateString, ':') === false && strpos($pCoordinateString, ',') === false) {
|
||||||
// Split out any worksheet name from the coordinate
|
// Split out any worksheet name from the coordinate
|
||||||
|
@ -684,7 +684,7 @@ class Cell
|
||||||
* e.g. array('B4','D9') or array(array('B4','D9'),array('H2','O11'))
|
* e.g. array('B4','D9') or array(array('B4','D9'),array('H2','O11'))
|
||||||
* or array('B4')
|
* or array('B4')
|
||||||
*/
|
*/
|
||||||
public static function splitRange($pRange = 'A1:A1')
|
public static function splitRange($pRange)
|
||||||
{
|
{
|
||||||
// Ensure $pRange is a valid range
|
// Ensure $pRange is a valid range
|
||||||
if (empty($pRange)) {
|
if (empty($pRange)) {
|
||||||
|
@ -735,7 +735,7 @@ class Cell
|
||||||
* @return array Range coordinates array(Start Cell, End Cell)
|
* @return array Range coordinates array(Start Cell, End Cell)
|
||||||
* where Start Cell and End Cell are arrays (Column Number, Row Number)
|
* where Start Cell and End Cell are arrays (Column Number, Row Number)
|
||||||
*/
|
*/
|
||||||
public static function rangeBoundaries($pRange = 'A1:A1')
|
public static function rangeBoundaries($pRange)
|
||||||
{
|
{
|
||||||
// Ensure $pRange is a valid range
|
// Ensure $pRange is a valid range
|
||||||
if (empty($pRange)) {
|
if (empty($pRange)) {
|
||||||
|
@ -770,7 +770,7 @@ class Cell
|
||||||
*
|
*
|
||||||
* @return array Range dimension (width, height)
|
* @return array Range dimension (width, height)
|
||||||
*/
|
*/
|
||||||
public static function rangeDimension($pRange = 'A1:A1')
|
public static function rangeDimension($pRange)
|
||||||
{
|
{
|
||||||
// Calculate range outer borders
|
// Calculate range outer borders
|
||||||
list($rangeStart, $rangeEnd) = self::rangeBoundaries($pRange);
|
list($rangeStart, $rangeEnd) = self::rangeBoundaries($pRange);
|
||||||
|
@ -786,7 +786,7 @@ class Cell
|
||||||
* @return array Range coordinates array(Start Cell, End Cell)
|
* @return array Range coordinates array(Start Cell, End Cell)
|
||||||
* where Start Cell and End Cell are arrays (Column ID, Row Number)
|
* where Start Cell and End Cell are arrays (Column ID, Row Number)
|
||||||
*/
|
*/
|
||||||
public static function getRangeBoundaries($pRange = 'A1:A1')
|
public static function getRangeBoundaries($pRange)
|
||||||
{
|
{
|
||||||
// Ensure $pRange is a valid range
|
// Ensure $pRange is a valid range
|
||||||
if (empty($pRange)) {
|
if (empty($pRange)) {
|
||||||
|
@ -809,11 +809,11 @@ class Cell
|
||||||
/**
|
/**
|
||||||
* Column index from string.
|
* Column index from string.
|
||||||
*
|
*
|
||||||
* @param string $pString
|
* @param string $pString eg 'A'
|
||||||
*
|
*
|
||||||
* @return int Column index (base 1 !!!)
|
* @return int Column index (base 1 !!!)
|
||||||
*/
|
*/
|
||||||
public static function columnIndexFromString($pString = 'A')
|
public static function columnIndexFromString($pString)
|
||||||
{
|
{
|
||||||
// Using a lookup cache adds a slight memory overhead, but boosts speed
|
// Using a lookup cache adds a slight memory overhead, but boosts speed
|
||||||
// caching using a static within the method is faster than a class static,
|
// caching using a static within the method is faster than a class static,
|
||||||
|
@ -856,11 +856,11 @@ class Cell
|
||||||
/**
|
/**
|
||||||
* String from columnindex.
|
* String from columnindex.
|
||||||
*
|
*
|
||||||
* @param int $pColumnIndex Column index (base 0 !!!)
|
* @param int $pColumnIndex Column index (A = 0)
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function stringFromColumnIndex($pColumnIndex = 0)
|
public static function stringFromColumnIndex($pColumnIndex)
|
||||||
{
|
{
|
||||||
// Using a lookup cache adds a slight memory overhead, but boosts speed
|
// Using a lookup cache adds a slight memory overhead, but boosts speed
|
||||||
// caching using a static within the method is faster than a class static,
|
// caching using a static within the method is faster than a class static,
|
||||||
|
@ -891,7 +891,7 @@ class Cell
|
||||||
*
|
*
|
||||||
* @return array Array containing single cell references
|
* @return array Array containing single cell references
|
||||||
*/
|
*/
|
||||||
public static function extractAllCellReferencesInRange($pRange = 'A1')
|
public static function extractAllCellReferencesInRange($pRange)
|
||||||
{
|
{
|
||||||
// Returnvalue
|
// Returnvalue
|
||||||
$returnValue = [];
|
$returnValue = [];
|
||||||
|
@ -1031,7 +1031,7 @@ class Cell
|
||||||
*
|
*
|
||||||
* @return Cell
|
* @return Cell
|
||||||
*/
|
*/
|
||||||
public function setXfIndex($pValue = 0)
|
public function setXfIndex($pValue)
|
||||||
{
|
{
|
||||||
$this->xfIndex = $pValue;
|
$this->xfIndex = $pValue;
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ class DataType
|
||||||
*
|
*
|
||||||
* @return mixed Sanitized value
|
* @return mixed Sanitized value
|
||||||
*/
|
*/
|
||||||
public static function checkString($pValue = null)
|
public static function checkString($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue instanceof \PhpOffice\PhpSpreadsheet\RichText) {
|
if ($pValue instanceof \PhpOffice\PhpSpreadsheet\RichText) {
|
||||||
// TODO: Sanitize Rich-Text string (max. character count is 32,767)
|
// TODO: Sanitize Rich-Text string (max. character count is 32,767)
|
||||||
|
@ -93,7 +93,7 @@ class DataType
|
||||||
*
|
*
|
||||||
* @return string Sanitized value
|
* @return string Sanitized value
|
||||||
*/
|
*/
|
||||||
public static function checkErrorCode($pValue = null)
|
public static function checkErrorCode($pValue)
|
||||||
{
|
{
|
||||||
$pValue = (string) $pValue;
|
$pValue = (string) $pValue;
|
||||||
|
|
||||||
|
|
|
@ -166,7 +166,7 @@ class DataValidation
|
||||||
*
|
*
|
||||||
* @return DataValidation
|
* @return DataValidation
|
||||||
*/
|
*/
|
||||||
public function setFormula1($value = '')
|
public function setFormula1($value)
|
||||||
{
|
{
|
||||||
$this->formula1 = $value;
|
$this->formula1 = $value;
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ class DataValidation
|
||||||
*
|
*
|
||||||
* @return DataValidation
|
* @return DataValidation
|
||||||
*/
|
*/
|
||||||
public function setFormula2($value = '')
|
public function setFormula2($value)
|
||||||
{
|
{
|
||||||
$this->formula2 = $value;
|
$this->formula2 = $value;
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ class DataValidation
|
||||||
*
|
*
|
||||||
* @return DataValidation
|
* @return DataValidation
|
||||||
*/
|
*/
|
||||||
public function setType($value = self::TYPE_NONE)
|
public function setType($value)
|
||||||
{
|
{
|
||||||
$this->type = $value;
|
$this->type = $value;
|
||||||
|
|
||||||
|
@ -234,11 +234,11 @@ class DataValidation
|
||||||
/**
|
/**
|
||||||
* Set Error style.
|
* Set Error style.
|
||||||
*
|
*
|
||||||
* @param string $value
|
* @param string $value see self::STYLE_*
|
||||||
*
|
*
|
||||||
* @return DataValidation
|
* @return DataValidation
|
||||||
*/
|
*/
|
||||||
public function setErrorStyle($value = self::STYLE_STOP)
|
public function setErrorStyle($value)
|
||||||
{
|
{
|
||||||
$this->errorStyle = $value;
|
$this->errorStyle = $value;
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ class DataValidation
|
||||||
*
|
*
|
||||||
* @return DataValidation
|
* @return DataValidation
|
||||||
*/
|
*/
|
||||||
public function setOperator($value = '')
|
public function setOperator($value)
|
||||||
{
|
{
|
||||||
$this->operator = $value;
|
$this->operator = $value;
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ class DataValidation
|
||||||
*
|
*
|
||||||
* @return DataValidation
|
* @return DataValidation
|
||||||
*/
|
*/
|
||||||
public function setAllowBlank($value = false)
|
public function setAllowBlank($value)
|
||||||
{
|
{
|
||||||
$this->allowBlank = $value;
|
$this->allowBlank = $value;
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ class DataValidation
|
||||||
*
|
*
|
||||||
* @return DataValidation
|
* @return DataValidation
|
||||||
*/
|
*/
|
||||||
public function setShowDropDown($value = false)
|
public function setShowDropDown($value)
|
||||||
{
|
{
|
||||||
$this->showDropDown = $value;
|
$this->showDropDown = $value;
|
||||||
|
|
||||||
|
@ -334,7 +334,7 @@ class DataValidation
|
||||||
*
|
*
|
||||||
* @return DataValidation
|
* @return DataValidation
|
||||||
*/
|
*/
|
||||||
public function setShowInputMessage($value = false)
|
public function setShowInputMessage($value)
|
||||||
{
|
{
|
||||||
$this->showInputMessage = $value;
|
$this->showInputMessage = $value;
|
||||||
|
|
||||||
|
@ -358,7 +358,7 @@ class DataValidation
|
||||||
*
|
*
|
||||||
* @return DataValidation
|
* @return DataValidation
|
||||||
*/
|
*/
|
||||||
public function setShowErrorMessage($value = false)
|
public function setShowErrorMessage($value)
|
||||||
{
|
{
|
||||||
$this->showErrorMessage = $value;
|
$this->showErrorMessage = $value;
|
||||||
|
|
||||||
|
@ -382,7 +382,7 @@ class DataValidation
|
||||||
*
|
*
|
||||||
* @return DataValidation
|
* @return DataValidation
|
||||||
*/
|
*/
|
||||||
public function setErrorTitle($value = '')
|
public function setErrorTitle($value)
|
||||||
{
|
{
|
||||||
$this->errorTitle = $value;
|
$this->errorTitle = $value;
|
||||||
|
|
||||||
|
@ -406,7 +406,7 @@ class DataValidation
|
||||||
*
|
*
|
||||||
* @return DataValidation
|
* @return DataValidation
|
||||||
*/
|
*/
|
||||||
public function setError($value = '')
|
public function setError($value)
|
||||||
{
|
{
|
||||||
$this->error = $value;
|
$this->error = $value;
|
||||||
|
|
||||||
|
@ -430,7 +430,7 @@ class DataValidation
|
||||||
*
|
*
|
||||||
* @return DataValidation
|
* @return DataValidation
|
||||||
*/
|
*/
|
||||||
public function setPromptTitle($value = '')
|
public function setPromptTitle($value)
|
||||||
{
|
{
|
||||||
$this->promptTitle = $value;
|
$this->promptTitle = $value;
|
||||||
|
|
||||||
|
@ -454,7 +454,7 @@ class DataValidation
|
||||||
*
|
*
|
||||||
* @return DataValidation
|
* @return DataValidation
|
||||||
*/
|
*/
|
||||||
public function setPrompt($value = '')
|
public function setPrompt($value)
|
||||||
{
|
{
|
||||||
$this->prompt = $value;
|
$this->prompt = $value;
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ class DefaultValueBinder implements IValueBinder
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function dataTypeForValue($pValue = null)
|
public static function dataTypeForValue($pValue)
|
||||||
{
|
{
|
||||||
// Match the value against a few data types
|
// Match the value against a few data types
|
||||||
if ($pValue === null) {
|
if ($pValue === null) {
|
||||||
|
|
|
@ -70,7 +70,7 @@ class Hyperlink
|
||||||
*
|
*
|
||||||
* @return Hyperlink
|
* @return Hyperlink
|
||||||
*/
|
*/
|
||||||
public function setUrl($value = '')
|
public function setUrl($value)
|
||||||
{
|
{
|
||||||
$this->url = $value;
|
$this->url = $value;
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ class Hyperlink
|
||||||
*
|
*
|
||||||
* @return Hyperlink
|
* @return Hyperlink
|
||||||
*/
|
*/
|
||||||
public function setTooltip($value = '')
|
public function setTooltip($value)
|
||||||
{
|
{
|
||||||
$this->tooltip = $value;
|
$this->tooltip = $value;
|
||||||
|
|
||||||
|
|
|
@ -341,7 +341,7 @@ class Chart
|
||||||
*
|
*
|
||||||
* @return Chart
|
* @return Chart
|
||||||
*/
|
*/
|
||||||
public function setPlotVisibleOnly($plotVisibleOnly = true)
|
public function setPlotVisibleOnly($plotVisibleOnly)
|
||||||
{
|
{
|
||||||
$this->plotVisibleOnly = $plotVisibleOnly;
|
$this->plotVisibleOnly = $plotVisibleOnly;
|
||||||
|
|
||||||
|
@ -365,7 +365,7 @@ class Chart
|
||||||
*
|
*
|
||||||
* @return Chart
|
* @return Chart
|
||||||
*/
|
*/
|
||||||
public function setDisplayBlanksAs($displayBlanksAs = '0')
|
public function setDisplayBlanksAs($displayBlanksAs)
|
||||||
{
|
{
|
||||||
$this->displayBlanksAs = $displayBlanksAs;
|
$this->displayBlanksAs = $displayBlanksAs;
|
||||||
}
|
}
|
||||||
|
@ -494,11 +494,12 @@ class Chart
|
||||||
*
|
*
|
||||||
* @return Chart
|
* @return Chart
|
||||||
*/
|
*/
|
||||||
public function setTopLeftOffset($xOffset = null, $yOffset = null)
|
public function setTopLeftOffset($xOffset, $yOffset)
|
||||||
{
|
{
|
||||||
if (!is_null($xOffset)) {
|
if (!is_null($xOffset)) {
|
||||||
$this->setTopLeftXOffset($xOffset);
|
$this->setTopLeftXOffset($xOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_null($yOffset)) {
|
if (!is_null($yOffset)) {
|
||||||
$this->setTopLeftYOffset($yOffset);
|
$this->setTopLeftYOffset($yOffset);
|
||||||
}
|
}
|
||||||
|
@ -604,11 +605,12 @@ class Chart
|
||||||
*
|
*
|
||||||
* @return Chart
|
* @return Chart
|
||||||
*/
|
*/
|
||||||
public function setBottomRightOffset($xOffset = null, $yOffset = null)
|
public function setBottomRightOffset($xOffset, $yOffset)
|
||||||
{
|
{
|
||||||
if (!is_null($xOffset)) {
|
if (!is_null($xOffset)) {
|
||||||
$this->setBottomRightXOffset($xOffset);
|
$this->setBottomRightXOffset($xOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_null($yOffset)) {
|
if (!is_null($yOffset)) {
|
||||||
$this->setBottomRightYOffset($yOffset);
|
$this->setBottomRightYOffset($yOffset);
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,7 +178,7 @@ class DataSeries
|
||||||
*
|
*
|
||||||
* @return DataSeries
|
* @return DataSeries
|
||||||
*/
|
*/
|
||||||
public function setPlotType($plotType = '')
|
public function setPlotType($plotType)
|
||||||
{
|
{
|
||||||
$this->plotType = $plotType;
|
$this->plotType = $plotType;
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ class DataSeries
|
||||||
*
|
*
|
||||||
* @return DataSeries
|
* @return DataSeries
|
||||||
*/
|
*/
|
||||||
public function setPlotGrouping($groupingType = null)
|
public function setPlotGrouping($groupingType)
|
||||||
{
|
{
|
||||||
$this->plotGrouping = $groupingType;
|
$this->plotGrouping = $groupingType;
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ class DataSeries
|
||||||
*
|
*
|
||||||
* @return DataSeries
|
* @return DataSeries
|
||||||
*/
|
*/
|
||||||
public function setPlotDirection($plotDirection = null)
|
public function setPlotDirection($plotDirection)
|
||||||
{
|
{
|
||||||
$this->plotDirection = $plotDirection;
|
$this->plotDirection = $plotDirection;
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ class DataSeries
|
||||||
*
|
*
|
||||||
* @return DataSeries
|
* @return DataSeries
|
||||||
*/
|
*/
|
||||||
public function setPlotStyle($plotStyle = null)
|
public function setPlotStyle($plotStyle)
|
||||||
{
|
{
|
||||||
$this->plotStyle = $plotStyle;
|
$this->plotStyle = $plotStyle;
|
||||||
|
|
||||||
|
@ -381,7 +381,7 @@ class DataSeries
|
||||||
*
|
*
|
||||||
* @return DataSeries
|
* @return DataSeries
|
||||||
*/
|
*/
|
||||||
public function setSmoothLine($smoothLine = true)
|
public function setSmoothLine($smoothLine)
|
||||||
{
|
{
|
||||||
$this->smoothLine = $smoothLine;
|
$this->smoothLine = $smoothLine;
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ class DataSeriesValues
|
||||||
*
|
*
|
||||||
* @return DataSeriesValues
|
* @return DataSeriesValues
|
||||||
*/
|
*/
|
||||||
public function setDataType($dataType = self::DATASERIES_TYPE_NUMBER)
|
public function setDataType($dataType)
|
||||||
{
|
{
|
||||||
if (!in_array($dataType, self::$dataTypeValues)) {
|
if (!in_array($dataType, self::$dataTypeValues)) {
|
||||||
throw new Exception('Invalid datatype for chart data series values');
|
throw new Exception('Invalid datatype for chart data series values');
|
||||||
|
@ -144,18 +144,13 @@ class DataSeriesValues
|
||||||
* Set Series Data Source (formula).
|
* Set Series Data Source (formula).
|
||||||
*
|
*
|
||||||
* @param string $dataSource
|
* @param string $dataSource
|
||||||
* @param mixed $refreshDataValues
|
|
||||||
*
|
*
|
||||||
* @return DataSeriesValues
|
* @return DataSeriesValues
|
||||||
*/
|
*/
|
||||||
public function setDataSource($dataSource = null, $refreshDataValues = true)
|
public function setDataSource($dataSource)
|
||||||
{
|
{
|
||||||
$this->dataSource = $dataSource;
|
$this->dataSource = $dataSource;
|
||||||
|
|
||||||
if ($refreshDataValues) {
|
|
||||||
// TO DO
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,7 +171,7 @@ class DataSeriesValues
|
||||||
*
|
*
|
||||||
* @return DataSeriesValues
|
* @return DataSeriesValues
|
||||||
*/
|
*/
|
||||||
public function setPointMarker($marker = null)
|
public function setPointMarker($marker)
|
||||||
{
|
{
|
||||||
$this->pointMarker = $marker;
|
$this->pointMarker = $marker;
|
||||||
|
|
||||||
|
@ -200,7 +195,7 @@ class DataSeriesValues
|
||||||
*
|
*
|
||||||
* @return DataSeriesValues
|
* @return DataSeriesValues
|
||||||
*/
|
*/
|
||||||
public function setFormatCode($formatCode = null)
|
public function setFormatCode($formatCode)
|
||||||
{
|
{
|
||||||
$this->formatCode = $formatCode;
|
$this->formatCode = $formatCode;
|
||||||
|
|
||||||
|
@ -277,29 +272,17 @@ class DataSeriesValues
|
||||||
* Set Series Data Values.
|
* Set Series Data Values.
|
||||||
*
|
*
|
||||||
* @param array $dataValues
|
* @param array $dataValues
|
||||||
* @param bool $refreshDataSource
|
|
||||||
* TRUE - refresh the value of dataSource based on the values of $dataValues
|
|
||||||
* FALSE - don't change the value of dataSource
|
|
||||||
*
|
*
|
||||||
* @return DataSeriesValues
|
* @return DataSeriesValues
|
||||||
*/
|
*/
|
||||||
public function setDataValues($dataValues = [], $refreshDataSource = true)
|
public function setDataValues($dataValues)
|
||||||
{
|
{
|
||||||
$this->dataValues = \PhpOffice\PhpSpreadsheet\Calculation\Functions::flattenArray($dataValues);
|
$this->dataValues = \PhpOffice\PhpSpreadsheet\Calculation\Functions::flattenArray($dataValues);
|
||||||
$this->pointCount = count($dataValues);
|
$this->pointCount = count($dataValues);
|
||||||
|
|
||||||
if ($refreshDataSource) {
|
|
||||||
// TO DO
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function stripNulls($var)
|
|
||||||
{
|
|
||||||
return $var !== null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function refresh(\PhpOffice\PhpSpreadsheet\Worksheet $worksheet, $flatten = true)
|
public function refresh(\PhpOffice\PhpSpreadsheet\Worksheet $worksheet, $flatten = true)
|
||||||
{
|
{
|
||||||
if ($this->dataSource !== null) {
|
if ($this->dataSource !== null) {
|
||||||
|
|
|
@ -133,9 +133,9 @@ class Layout
|
||||||
/**
|
/**
|
||||||
* Create a new Layout.
|
* Create a new Layout.
|
||||||
*
|
*
|
||||||
* @param mixed $layout
|
* @param array $layout
|
||||||
*/
|
*/
|
||||||
public function __construct($layout = [])
|
public function __construct(array $layout = [])
|
||||||
{
|
{
|
||||||
if (isset($layout['layoutTarget'])) {
|
if (isset($layout['layoutTarget'])) {
|
||||||
$this->layoutTarget = $layout['layoutTarget'];
|
$this->layoutTarget = $layout['layoutTarget'];
|
||||||
|
|
|
@ -96,9 +96,9 @@ class Legend
|
||||||
/**
|
/**
|
||||||
* Get legend position using an excel string value.
|
* Get legend position using an excel string value.
|
||||||
*
|
*
|
||||||
* @param string $position
|
* @param string $position see self::POSITION_*
|
||||||
*/
|
*/
|
||||||
public function setPosition($position = self::POSITION_RIGHT)
|
public function setPosition($position)
|
||||||
{
|
{
|
||||||
if (!in_array($position, self::$positionXLref)) {
|
if (!in_array($position, self::$positionXLref)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -112,7 +112,7 @@ class Legend
|
||||||
/**
|
/**
|
||||||
* Get legend position as an Excel internal numeric value.
|
* Get legend position as an Excel internal numeric value.
|
||||||
*
|
*
|
||||||
* @return number
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getPositionXL()
|
public function getPositionXL()
|
||||||
{
|
{
|
||||||
|
@ -122,9 +122,9 @@ class Legend
|
||||||
/**
|
/**
|
||||||
* Set legend position using an Excel internal numeric value.
|
* Set legend position using an Excel internal numeric value.
|
||||||
*
|
*
|
||||||
* @param number $positionXL
|
* @param int $positionXL see self::XL_LEGEND_POSITION_*
|
||||||
*/
|
*/
|
||||||
public function setPositionXL($positionXL = self::XL_LEGEND_POSITION_RIGHT)
|
public function setPositionXL($positionXL)
|
||||||
{
|
{
|
||||||
if (!isset(self::$positionXLref[$positionXL])) {
|
if (!isset(self::$positionXLref[$positionXL])) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -152,7 +152,7 @@ class Legend
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function setOverlay($overlay = false)
|
public function setOverlay($overlay)
|
||||||
{
|
{
|
||||||
if (!is_bool($overlay)) {
|
if (!is_bool($overlay)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -45,7 +45,7 @@ class PlotArea
|
||||||
*
|
*
|
||||||
* @param mixed $plotSeries
|
* @param mixed $plotSeries
|
||||||
*/
|
*/
|
||||||
public function __construct(Layout $layout = null, $plotSeries = [])
|
public function __construct(Layout $layout = null, array $plotSeries = [])
|
||||||
{
|
{
|
||||||
$this->layout = $layout;
|
$this->layout = $layout;
|
||||||
$this->plotSeries = $plotSeries;
|
$this->plotSeries = $plotSeries;
|
||||||
|
@ -116,7 +116,7 @@ class PlotArea
|
||||||
*
|
*
|
||||||
* @return PlotArea
|
* @return PlotArea
|
||||||
*/
|
*/
|
||||||
public function setPlotSeries($plotSeries = [])
|
public function setPlotSeries(array $plotSeries)
|
||||||
{
|
{
|
||||||
$this->plotSeries = $plotSeries;
|
$this->plotSeries = $plotSeries;
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ class Title
|
||||||
*
|
*
|
||||||
* @return Title
|
* @return Title
|
||||||
*/
|
*/
|
||||||
public function setCaption($caption = null)
|
public function setCaption($caption)
|
||||||
{
|
{
|
||||||
$this->caption = $caption;
|
$this->caption = $caption;
|
||||||
|
|
||||||
|
|
|
@ -116,13 +116,13 @@ class Comment implements IComparable
|
||||||
/**
|
/**
|
||||||
* Set Author.
|
* Set Author.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $author
|
||||||
*
|
*
|
||||||
* @return Comment
|
* @return Comment
|
||||||
*/
|
*/
|
||||||
public function setAuthor($pValue = '')
|
public function setAuthor($author)
|
||||||
{
|
{
|
||||||
$this->author = $pValue;
|
$this->author = $author;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -164,13 +164,13 @@ class Comment implements IComparable
|
||||||
/**
|
/**
|
||||||
* Set comment width (CSS style, i.e. XXpx or YYpt).
|
* Set comment width (CSS style, i.e. XXpx or YYpt).
|
||||||
*
|
*
|
||||||
* @param string $value
|
* @param string $width
|
||||||
*
|
*
|
||||||
* @return Comment
|
* @return Comment
|
||||||
*/
|
*/
|
||||||
public function setWidth($value = '96pt')
|
public function setWidth($width)
|
||||||
{
|
{
|
||||||
$this->width = $value;
|
$this->width = $width;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,7 @@ class Comment implements IComparable
|
||||||
*
|
*
|
||||||
* @return Comment
|
* @return Comment
|
||||||
*/
|
*/
|
||||||
public function setHeight($value = '55.5pt')
|
public function setHeight($value)
|
||||||
{
|
{
|
||||||
$this->height = $value;
|
$this->height = $value;
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ class Comment implements IComparable
|
||||||
*
|
*
|
||||||
* @return Comment
|
* @return Comment
|
||||||
*/
|
*/
|
||||||
public function setMarginLeft($value = '59.25pt')
|
public function setMarginLeft($value)
|
||||||
{
|
{
|
||||||
$this->marginLeft = $value;
|
$this->marginLeft = $value;
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ class Comment implements IComparable
|
||||||
*
|
*
|
||||||
* @return Comment
|
* @return Comment
|
||||||
*/
|
*/
|
||||||
public function setMarginTop($value = '1.5pt')
|
public function setMarginTop($value)
|
||||||
{
|
{
|
||||||
$this->marginTop = $value;
|
$this->marginTop = $value;
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ class Comment implements IComparable
|
||||||
*
|
*
|
||||||
* @return Comment
|
* @return Comment
|
||||||
*/
|
*/
|
||||||
public function setVisible($value = false)
|
public function setVisible($value)
|
||||||
{
|
{
|
||||||
$this->visible = $value;
|
$this->visible = $value;
|
||||||
|
|
||||||
|
@ -284,13 +284,13 @@ class Comment implements IComparable
|
||||||
/**
|
/**
|
||||||
* Set Alignment.
|
* Set Alignment.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $alignment see Style\Alignment::HORIZONTAL_*
|
||||||
*
|
*
|
||||||
* @return Comment
|
* @return Comment
|
||||||
*/
|
*/
|
||||||
public function setAlignment($pValue = Style\Alignment::HORIZONTAL_GENERAL)
|
public function setAlignment($alignment)
|
||||||
{
|
{
|
||||||
$this->alignment = $pValue;
|
$this->alignment = $alignment;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,13 +142,13 @@ class Properties
|
||||||
/**
|
/**
|
||||||
* Set Creator.
|
* Set Creator.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $creator
|
||||||
*
|
*
|
||||||
* @return Properties
|
* @return Properties
|
||||||
*/
|
*/
|
||||||
public function setCreator($pValue = '')
|
public function setCreator($creator)
|
||||||
{
|
{
|
||||||
$this->creator = $pValue;
|
$this->creator = $creator;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,7 @@ class Properties
|
||||||
*
|
*
|
||||||
* @return Properties
|
* @return Properties
|
||||||
*/
|
*/
|
||||||
public function setLastModifiedBy($pValue = '')
|
public function setLastModifiedBy($pValue)
|
||||||
{
|
{
|
||||||
$this->lastModifiedBy = $pValue;
|
$this->lastModifiedBy = $pValue;
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ class Properties
|
||||||
*
|
*
|
||||||
* @return Properties
|
* @return Properties
|
||||||
*/
|
*/
|
||||||
public function setCreated($pValue = null)
|
public function setCreated($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue === null) {
|
if ($pValue === null) {
|
||||||
$pValue = time();
|
$pValue = time();
|
||||||
|
@ -228,7 +228,7 @@ class Properties
|
||||||
*
|
*
|
||||||
* @return Properties
|
* @return Properties
|
||||||
*/
|
*/
|
||||||
public function setModified($pValue = null)
|
public function setModified($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue === null) {
|
if ($pValue === null) {
|
||||||
$pValue = time();
|
$pValue = time();
|
||||||
|
@ -258,13 +258,13 @@ class Properties
|
||||||
/**
|
/**
|
||||||
* Set Title.
|
* Set Title.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $title
|
||||||
*
|
*
|
||||||
* @return Properties
|
* @return Properties
|
||||||
*/
|
*/
|
||||||
public function setTitle($pValue = '')
|
public function setTitle($title)
|
||||||
{
|
{
|
||||||
$this->title = $pValue;
|
$this->title = $title;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -282,13 +282,13 @@ class Properties
|
||||||
/**
|
/**
|
||||||
* Set Description.
|
* Set Description.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $description
|
||||||
*
|
*
|
||||||
* @return Properties
|
* @return Properties
|
||||||
*/
|
*/
|
||||||
public function setDescription($pValue = '')
|
public function setDescription($description)
|
||||||
{
|
{
|
||||||
$this->description = $pValue;
|
$this->description = $description;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -306,13 +306,13 @@ class Properties
|
||||||
/**
|
/**
|
||||||
* Set Subject.
|
* Set Subject.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $subject
|
||||||
*
|
*
|
||||||
* @return Properties
|
* @return Properties
|
||||||
*/
|
*/
|
||||||
public function setSubject($pValue = '')
|
public function setSubject($subject)
|
||||||
{
|
{
|
||||||
$this->subject = $pValue;
|
$this->subject = $subject;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -330,13 +330,13 @@ class Properties
|
||||||
/**
|
/**
|
||||||
* Set Keywords.
|
* Set Keywords.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $keywords
|
||||||
*
|
*
|
||||||
* @return Properties
|
* @return Properties
|
||||||
*/
|
*/
|
||||||
public function setKeywords($pValue = '')
|
public function setKeywords($keywords)
|
||||||
{
|
{
|
||||||
$this->keywords = $pValue;
|
$this->keywords = $keywords;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -354,13 +354,13 @@ class Properties
|
||||||
/**
|
/**
|
||||||
* Set Category.
|
* Set Category.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $category
|
||||||
*
|
*
|
||||||
* @return Properties
|
* @return Properties
|
||||||
*/
|
*/
|
||||||
public function setCategory($pValue = '')
|
public function setCategory($category)
|
||||||
{
|
{
|
||||||
$this->category = $pValue;
|
$this->category = $category;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -378,13 +378,13 @@ class Properties
|
||||||
/**
|
/**
|
||||||
* Set Company.
|
* Set Company.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $company
|
||||||
*
|
*
|
||||||
* @return Properties
|
* @return Properties
|
||||||
*/
|
*/
|
||||||
public function setCompany($pValue = '')
|
public function setCompany($company)
|
||||||
{
|
{
|
||||||
$this->company = $pValue;
|
$this->company = $company;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -402,13 +402,13 @@ class Properties
|
||||||
/**
|
/**
|
||||||
* Set Manager.
|
* Set Manager.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $manager
|
||||||
*
|
*
|
||||||
* @return Properties
|
* @return Properties
|
||||||
*/
|
*/
|
||||||
public function setManager($pValue = '')
|
public function setManager($manager)
|
||||||
{
|
{
|
||||||
$this->manager = $pValue;
|
$this->manager = $manager;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ class Security
|
||||||
*
|
*
|
||||||
* @return Security
|
* @return Security
|
||||||
*/
|
*/
|
||||||
public function setLockRevision($pValue = false)
|
public function setLockRevision($pValue)
|
||||||
{
|
{
|
||||||
$this->lockRevision = $pValue;
|
$this->lockRevision = $pValue;
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ class Security
|
||||||
*
|
*
|
||||||
* @return Security
|
* @return Security
|
||||||
*/
|
*/
|
||||||
public function setLockStructure($pValue = false)
|
public function setLockStructure($pValue)
|
||||||
{
|
{
|
||||||
$this->lockStructure = $pValue;
|
$this->lockStructure = $pValue;
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ class Security
|
||||||
*
|
*
|
||||||
* @return Security
|
* @return Security
|
||||||
*/
|
*/
|
||||||
public function setLockWindows($pValue = false)
|
public function setLockWindows($pValue)
|
||||||
{
|
{
|
||||||
$this->lockWindows = $pValue;
|
$this->lockWindows = $pValue;
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ class Security
|
||||||
*
|
*
|
||||||
* @return Security
|
* @return Security
|
||||||
*/
|
*/
|
||||||
public function setRevisionsPassword($pValue = '', $pAlreadyHashed = false)
|
public function setRevisionsPassword($pValue, $pAlreadyHashed = false)
|
||||||
{
|
{
|
||||||
if (!$pAlreadyHashed) {
|
if (!$pAlreadyHashed) {
|
||||||
$pValue = \PhpOffice\PhpSpreadsheet\Shared\PasswordHasher::hashPassword($pValue);
|
$pValue = \PhpOffice\PhpSpreadsheet\Shared\PasswordHasher::hashPassword($pValue);
|
||||||
|
@ -198,7 +198,7 @@ class Security
|
||||||
*
|
*
|
||||||
* @return Security
|
* @return Security
|
||||||
*/
|
*/
|
||||||
public function setWorkbookPassword($pValue = '', $pAlreadyHashed = false)
|
public function setWorkbookPassword($pValue, $pAlreadyHashed = false)
|
||||||
{
|
{
|
||||||
if (!$pAlreadyHashed) {
|
if (!$pAlreadyHashed) {
|
||||||
$pValue = \PhpOffice\PhpSpreadsheet\Shared\PasswordHasher::hashPassword($pValue);
|
$pValue = \PhpOffice\PhpSpreadsheet\Shared\PasswordHasher::hashPassword($pValue);
|
||||||
|
|
|
@ -62,13 +62,11 @@ class HashTable
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function addFromSource($pSource = null)
|
public function addFromSource(array $pSource = null)
|
||||||
{
|
{
|
||||||
// Check if an array was passed
|
// Check if an array was passed
|
||||||
if ($pSource == null) {
|
if ($pSource == null) {
|
||||||
return;
|
return;
|
||||||
} elseif (!is_array($pSource)) {
|
|
||||||
throw new Exception('Invalid array parameter passed.');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($pSource as $item) {
|
foreach ($pSource as $item) {
|
||||||
|
@ -145,7 +143,7 @@ class HashTable
|
||||||
*
|
*
|
||||||
* @return int Index
|
* @return int Index
|
||||||
*/
|
*/
|
||||||
public function getIndexForHashCode($pHashCode = '')
|
public function getIndexForHashCode($pHashCode)
|
||||||
{
|
{
|
||||||
return array_search($pHashCode, $this->keyMap);
|
return array_search($pHashCode, $this->keyMap);
|
||||||
}
|
}
|
||||||
|
@ -157,7 +155,7 @@ class HashTable
|
||||||
*
|
*
|
||||||
* @return IComparable
|
* @return IComparable
|
||||||
*/
|
*/
|
||||||
public function getByIndex($pIndex = 0)
|
public function getByIndex($pIndex)
|
||||||
{
|
{
|
||||||
if (isset($this->keyMap[$pIndex])) {
|
if (isset($this->keyMap[$pIndex])) {
|
||||||
return $this->getByHashCode($this->keyMap[$pIndex]);
|
return $this->getByHashCode($this->keyMap[$pIndex]);
|
||||||
|
@ -173,7 +171,7 @@ class HashTable
|
||||||
*
|
*
|
||||||
* @return IComparable
|
* @return IComparable
|
||||||
*/
|
*/
|
||||||
public function getByHashCode($pHashCode = '')
|
public function getByHashCode($pHashCode)
|
||||||
{
|
{
|
||||||
if (isset($this->items[$pHashCode])) {
|
if (isset($this->items[$pHashCode])) {
|
||||||
return $this->items[$pHashCode];
|
return $this->items[$pHashCode];
|
||||||
|
|
|
@ -102,7 +102,7 @@ class IOFactory
|
||||||
* @param string $location Example: PhpSpreadsheet/Writer/{0}.php
|
* @param string $location Example: PhpSpreadsheet/Writer/{0}.php
|
||||||
* @param string $classname Example: Writer\{0}
|
* @param string $classname Example: Writer\{0}
|
||||||
*/
|
*/
|
||||||
public static function addSearchLocation($type = '', $location = '', $classname = '')
|
public static function addSearchLocation($type, $location, $classname)
|
||||||
{
|
{
|
||||||
self::$searchLocations[] = ['type' => $type, 'path' => $location, 'class' => $classname];
|
self::$searchLocations[] = ['type' => $type, 'path' => $location, 'class' => $classname];
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ class IOFactory
|
||||||
*
|
*
|
||||||
* @return Reader\IReader
|
* @return Reader\IReader
|
||||||
*/
|
*/
|
||||||
public static function createReader($readerType = '')
|
public static function createReader($readerType)
|
||||||
{
|
{
|
||||||
// Search type
|
// Search type
|
||||||
$searchType = 'IReader';
|
$searchType = 'IReader';
|
||||||
|
|
|
@ -104,7 +104,7 @@ class NamedRange
|
||||||
*
|
*
|
||||||
* @return NamedRange
|
* @return NamedRange
|
||||||
*/
|
*/
|
||||||
public function setName($value = null)
|
public function setName($value)
|
||||||
{
|
{
|
||||||
if ($value !== null) {
|
if ($value !== null) {
|
||||||
// Old title
|
// Old title
|
||||||
|
@ -171,7 +171,7 @@ class NamedRange
|
||||||
*
|
*
|
||||||
* @return NamedRange
|
* @return NamedRange
|
||||||
*/
|
*/
|
||||||
public function setRange($value = null)
|
public function setRange($value)
|
||||||
{
|
{
|
||||||
if ($value !== null) {
|
if ($value !== null) {
|
||||||
$this->range = $value;
|
$this->range = $value;
|
||||||
|
@ -197,7 +197,7 @@ class NamedRange
|
||||||
*
|
*
|
||||||
* @return NamedRange
|
* @return NamedRange
|
||||||
*/
|
*/
|
||||||
public function setLocalOnly($value = false)
|
public function setLocalOnly($value)
|
||||||
{
|
{
|
||||||
$this->localOnly = $value;
|
$this->localOnly = $value;
|
||||||
$this->scope = $value ? $this->worksheet : null;
|
$this->scope = $value ? $this->worksheet : null;
|
||||||
|
|
|
@ -92,7 +92,7 @@ abstract class BaseReader implements IReader
|
||||||
*
|
*
|
||||||
* @return IReader
|
* @return IReader
|
||||||
*/
|
*/
|
||||||
public function setReadDataOnly($pValue = false)
|
public function setReadDataOnly($pValue)
|
||||||
{
|
{
|
||||||
$this->readDataOnly = (bool) $pValue;
|
$this->readDataOnly = (bool) $pValue;
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ abstract class BaseReader implements IReader
|
||||||
*
|
*
|
||||||
* @return IReader
|
* @return IReader
|
||||||
*/
|
*/
|
||||||
public function setReadEmptyCells($pValue = true)
|
public function setReadEmptyCells($pValue)
|
||||||
{
|
{
|
||||||
$this->readEmptyCells = (bool) $pValue;
|
$this->readEmptyCells = (bool) $pValue;
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ abstract class BaseReader implements IReader
|
||||||
*
|
*
|
||||||
* @return IReader
|
* @return IReader
|
||||||
*/
|
*/
|
||||||
public function setIncludeCharts($pValue = false)
|
public function setIncludeCharts($pValue)
|
||||||
{
|
{
|
||||||
$this->includeCharts = (bool) $pValue;
|
$this->includeCharts = (bool) $pValue;
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ abstract class BaseReader implements IReader
|
||||||
*
|
*
|
||||||
* @return IReader
|
* @return IReader
|
||||||
*/
|
*/
|
||||||
public function setLoadSheetsOnly($value = null)
|
public function setLoadSheetsOnly($value)
|
||||||
{
|
{
|
||||||
if ($value === null) {
|
if ($value === null) {
|
||||||
return $this->setLoadAllSheets();
|
return $this->setLoadAllSheets();
|
||||||
|
|
|
@ -81,9 +81,9 @@ class Csv extends BaseReader implements IReader
|
||||||
/**
|
/**
|
||||||
* Set input encoding.
|
* Set input encoding.
|
||||||
*
|
*
|
||||||
* @param string $pValue Input encoding
|
* @param string $pValue Input encoding, eg: 'UTF-8'
|
||||||
*/
|
*/
|
||||||
public function setInputEncoding($pValue = 'UTF-8')
|
public function setInputEncoding($pValue)
|
||||||
{
|
{
|
||||||
$this->inputEncoding = $pValue;
|
$this->inputEncoding = $pValue;
|
||||||
|
|
||||||
|
@ -294,13 +294,13 @@ class Csv extends BaseReader implements IReader
|
||||||
/**
|
/**
|
||||||
* Set delimiter.
|
* Set delimiter.
|
||||||
*
|
*
|
||||||
* @param string $pValue Delimiter, defaults to ,
|
* @param string $delimiter Delimiter, eg: ','
|
||||||
*
|
*
|
||||||
* @return CSV
|
* @return CSV
|
||||||
*/
|
*/
|
||||||
public function setDelimiter($pValue = ',')
|
public function setDelimiter($delimiter)
|
||||||
{
|
{
|
||||||
$this->delimiter = $pValue;
|
$this->delimiter = $delimiter;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -318,16 +318,16 @@ class Csv extends BaseReader implements IReader
|
||||||
/**
|
/**
|
||||||
* Set enclosure.
|
* Set enclosure.
|
||||||
*
|
*
|
||||||
* @param string $pValue Enclosure, defaults to "
|
* @param string $enclosure Enclosure, defaults to "
|
||||||
*
|
*
|
||||||
* @return CSV
|
* @return CSV
|
||||||
*/
|
*/
|
||||||
public function setEnclosure($pValue = '"')
|
public function setEnclosure($enclosure)
|
||||||
{
|
{
|
||||||
if ($pValue == '') {
|
if ($enclosure == '') {
|
||||||
$pValue = '"';
|
$enclosure = '"';
|
||||||
}
|
}
|
||||||
$this->enclosure = $pValue;
|
$this->enclosure = $enclosure;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -349,7 +349,7 @@ class Csv extends BaseReader implements IReader
|
||||||
*
|
*
|
||||||
* @return CSV
|
* @return CSV
|
||||||
*/
|
*/
|
||||||
public function setSheetIndex($pValue = 0)
|
public function setSheetIndex($pValue)
|
||||||
{
|
{
|
||||||
$this->sheetIndex = $pValue;
|
$this->sheetIndex = $pValue;
|
||||||
|
|
||||||
|
@ -361,7 +361,7 @@ class Csv extends BaseReader implements IReader
|
||||||
*
|
*
|
||||||
* @param bool $contiguous
|
* @param bool $contiguous
|
||||||
*/
|
*/
|
||||||
public function setContiguous($contiguous = false)
|
public function setContiguous($contiguous)
|
||||||
{
|
{
|
||||||
$this->contiguous = (bool) $contiguous;
|
$this->contiguous = (bool) $contiguous;
|
||||||
if (!$contiguous) {
|
if (!$contiguous) {
|
||||||
|
|
|
@ -804,7 +804,7 @@ class Gnumeric extends BaseReader implements IReader
|
||||||
return $styleArray;
|
return $styleArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function parseRichText($is = '')
|
private function parseRichText($is)
|
||||||
{
|
{
|
||||||
$value = new \PhpOffice\PhpSpreadsheet\RichText();
|
$value = new \PhpOffice\PhpSpreadsheet\RichText();
|
||||||
$value->createText($is);
|
$value->createText($is);
|
||||||
|
|
|
@ -208,9 +208,9 @@ class Html extends BaseReader implements IReader
|
||||||
/**
|
/**
|
||||||
* Set input encoding.
|
* Set input encoding.
|
||||||
*
|
*
|
||||||
* @param string $pValue Input encoding
|
* @param string $pValue Input encoding, eg: 'ANSI'
|
||||||
*/
|
*/
|
||||||
public function setInputEncoding($pValue = 'ANSI')
|
public function setInputEncoding($pValue)
|
||||||
{
|
{
|
||||||
$this->inputEncoding = $pValue;
|
$this->inputEncoding = $pValue;
|
||||||
|
|
||||||
|
@ -263,7 +263,7 @@ class Html extends BaseReader implements IReader
|
||||||
// Only actually write it if there's content in the string
|
// Only actually write it if there's content in the string
|
||||||
// Write to worksheet to be done here...
|
// Write to worksheet to be done here...
|
||||||
// ... we return the cell so we can mess about with styles more easily
|
// ... we return the cell so we can mess about with styles more easily
|
||||||
$sheet->setCellValue($column . $row, $cellContent, true);
|
$sheet->setCellValue($column . $row, $cellContent);
|
||||||
$this->dataArray[$row][$column] = $cellContent;
|
$this->dataArray[$row][$column] = $cellContent;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -556,7 +556,7 @@ class Html extends BaseReader implements IReader
|
||||||
*
|
*
|
||||||
* @return HTML
|
* @return HTML
|
||||||
*/
|
*/
|
||||||
public function setSheetIndex($pValue = 0)
|
public function setSheetIndex($pValue)
|
||||||
{
|
{
|
||||||
$this->sheetIndex = $pValue;
|
$this->sheetIndex = $pValue;
|
||||||
|
|
||||||
|
|
|
@ -797,7 +797,7 @@ class Ods extends BaseReader implements IReader
|
||||||
*
|
*
|
||||||
* @return \PhpOffice\PhpSpreadsheet\RichText
|
* @return \PhpOffice\PhpSpreadsheet\RichText
|
||||||
*/
|
*/
|
||||||
private function parseRichText($is = '')
|
private function parseRichText($is)
|
||||||
{
|
{
|
||||||
$value = new \PhpOffice\PhpSpreadsheet\RichText();
|
$value = new \PhpOffice\PhpSpreadsheet\RichText();
|
||||||
$value->createText($is);
|
$value->createText($is);
|
||||||
|
|
|
@ -99,9 +99,9 @@ class Slk extends BaseReader implements IReader
|
||||||
/**
|
/**
|
||||||
* Set input encoding.
|
* Set input encoding.
|
||||||
*
|
*
|
||||||
* @param string $pValue Input encoding
|
* @param string $pValue Input encoding, eg: 'ANSI'
|
||||||
*/
|
*/
|
||||||
public function setInputEncoding($pValue = 'ANSI')
|
public function setInputEncoding($pValue)
|
||||||
{
|
{
|
||||||
$this->inputEncoding = $pValue;
|
$this->inputEncoding = $pValue;
|
||||||
|
|
||||||
|
@ -474,7 +474,7 @@ class Slk extends BaseReader implements IReader
|
||||||
*
|
*
|
||||||
* @return SYLK
|
* @return SYLK
|
||||||
*/
|
*/
|
||||||
public function setSheetIndex($pValue = 0)
|
public function setSheetIndex($pValue)
|
||||||
{
|
{
|
||||||
$this->sheetIndex = $pValue;
|
$this->sheetIndex = $pValue;
|
||||||
|
|
||||||
|
|
|
@ -7465,7 +7465,7 @@ class Xls extends BaseReader implements IReader
|
||||||
return ord($data[$pos]) | (ord($data[$pos + 1]) << 8) | (ord($data[$pos + 2]) << 16) | $_ord_24;
|
return ord($data[$pos]) | (ord($data[$pos + 1]) << 8) | (ord($data[$pos + 2]) << 16) | $_ord_24;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function parseRichText($is = '')
|
private function parseRichText($is)
|
||||||
{
|
{
|
||||||
$value = new \PhpOffice\PhpSpreadsheet\RichText();
|
$value = new \PhpOffice\PhpSpreadsheet\RichText();
|
||||||
$value->createText($is);
|
$value->createText($is);
|
||||||
|
|
|
@ -2034,7 +2034,7 @@ class Xlsx extends BaseReader implements IReader
|
||||||
*
|
*
|
||||||
* @return RichText
|
* @return RichText
|
||||||
*/
|
*/
|
||||||
private function parseRichText($is = null)
|
private function parseRichText($is)
|
||||||
{
|
{
|
||||||
$value = new RichText();
|
$value = new RichText();
|
||||||
|
|
||||||
|
@ -2179,7 +2179,7 @@ class Xlsx extends BaseReader implements IReader
|
||||||
return $style;
|
return $style;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function boolean($value = null)
|
private static function boolean($value)
|
||||||
{
|
{
|
||||||
if (is_object($value)) {
|
if (is_object($value)) {
|
||||||
$value = (string) $value;
|
$value = (string) $value;
|
||||||
|
|
|
@ -88,17 +88,17 @@ class Chart
|
||||||
break;
|
break;
|
||||||
case 'catAx':
|
case 'catAx':
|
||||||
if (isset($chartDetail->title)) {
|
if (isset($chartDetail->title)) {
|
||||||
$XaxisLabel = self::chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta, 'cat');
|
$XaxisLabel = self::chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'dateAx':
|
case 'dateAx':
|
||||||
if (isset($chartDetail->title)) {
|
if (isset($chartDetail->title)) {
|
||||||
$XaxisLabel = self::chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta, 'cat');
|
$XaxisLabel = self::chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'valAx':
|
case 'valAx':
|
||||||
if (isset($chartDetail->title)) {
|
if (isset($chartDetail->title)) {
|
||||||
$YaxisLabel = self::chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta, 'cat');
|
$YaxisLabel = self::chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'barChart':
|
case 'barChart':
|
||||||
|
@ -176,7 +176,7 @@ class Chart
|
||||||
$dispBlanksAs = self::getAttribute($chartDetails, 'val', 'string');
|
$dispBlanksAs = self::getAttribute($chartDetails, 'val', 'string');
|
||||||
break;
|
break;
|
||||||
case 'title':
|
case 'title':
|
||||||
$title = self::chartTitle($chartDetails, $namespacesChartMeta, 'title');
|
$title = self::chartTitle($chartDetails, $namespacesChartMeta);
|
||||||
break;
|
break;
|
||||||
case 'legend':
|
case 'legend':
|
||||||
$legendPos = 'r';
|
$legendPos = 'r';
|
||||||
|
@ -206,7 +206,7 @@ class Chart
|
||||||
return $chart;
|
return $chart;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function chartTitle($titleDetails, $namespacesChartMeta, $type)
|
private static function chartTitle(\SimpleXMLElement $titleDetails, array $namespacesChartMeta)
|
||||||
{
|
{
|
||||||
$caption = [];
|
$caption = [];
|
||||||
$titleLayout = null;
|
$titleLayout = null;
|
||||||
|
@ -399,7 +399,7 @@ class Chart
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function parseRichText($titleDetailPart = null)
|
private static function parseRichText(\SimpleXMLElement $titleDetailPart)
|
||||||
{
|
{
|
||||||
$value = new \PhpOffice\PhpSpreadsheet\RichText();
|
$value = new \PhpOffice\PhpSpreadsheet\RichText();
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ class Theme
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getColourByIndex($index = 0)
|
public function getColourByIndex($index)
|
||||||
{
|
{
|
||||||
if (isset($this->colourMap[$index])) {
|
if (isset($this->colourMap[$index])) {
|
||||||
return $this->colourMap[$index];
|
return $this->colourMap[$index];
|
||||||
|
|
|
@ -770,7 +770,7 @@ class Xml extends BaseReader implements IReader
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function parseRichText($is = '')
|
protected function parseRichText($is)
|
||||||
{
|
{
|
||||||
$value = new \PhpOffice\PhpSpreadsheet\RichText();
|
$value = new \PhpOffice\PhpSpreadsheet\RichText();
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ class RichText implements IComparable
|
||||||
*
|
*
|
||||||
* @return RichText\TextElement
|
* @return RichText\TextElement
|
||||||
*/
|
*/
|
||||||
public function createText($pText = '')
|
public function createText($pText)
|
||||||
{
|
{
|
||||||
$objText = new RichText\TextElement($pText);
|
$objText = new RichText\TextElement($pText);
|
||||||
$this->addText($objText);
|
$this->addText($objText);
|
||||||
|
@ -101,7 +101,7 @@ class RichText implements IComparable
|
||||||
*
|
*
|
||||||
* @return RichText\Run
|
* @return RichText\Run
|
||||||
*/
|
*/
|
||||||
public function createTextRun($pText = '')
|
public function createTextRun($pText)
|
||||||
{
|
{
|
||||||
$objText = new RichText\Run($pText);
|
$objText = new RichText\Run($pText);
|
||||||
$this->addText($objText);
|
$this->addText($objText);
|
||||||
|
@ -150,19 +150,15 @@ class RichText implements IComparable
|
||||||
/**
|
/**
|
||||||
* Set Rich Text elements.
|
* Set Rich Text elements.
|
||||||
*
|
*
|
||||||
* @param RichText\ITextElement[] $pElements Array of elements
|
* @param RichText\ITextElement[] $textElements Array of elements
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @return RichText
|
* @return RichText
|
||||||
*/
|
*/
|
||||||
public function setRichTextElements($pElements = null)
|
public function setRichTextElements(array $textElements)
|
||||||
{
|
{
|
||||||
if (is_array($pElements)) {
|
$this->richTextElements = $textElements;
|
||||||
$this->richTextElements = $pElements;
|
|
||||||
} else {
|
|
||||||
throw new Exception("Invalid \PhpOffice\PhpSpreadsheet\RichText\ITextElement[] array passed.");
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,11 +34,11 @@ interface ITextElement
|
||||||
/**
|
/**
|
||||||
* Set text.
|
* Set text.
|
||||||
*
|
*
|
||||||
* @param $pText string Text
|
* @param $text string Text
|
||||||
*
|
*
|
||||||
* @return ITextElement
|
* @return ITextElement
|
||||||
*/
|
*/
|
||||||
public function setText($pText = '');
|
public function setText($text);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get font.
|
* Get font.
|
||||||
|
|
|
@ -55,13 +55,13 @@ class TextElement implements ITextElement
|
||||||
/**
|
/**
|
||||||
* Set text.
|
* Set text.
|
||||||
*
|
*
|
||||||
* @param $pText string Text
|
* @param $text string Text
|
||||||
*
|
*
|
||||||
* @return ITextElement
|
* @return ITextElement
|
||||||
*/
|
*/
|
||||||
public function setText($pText = '')
|
public function setText($text)
|
||||||
{
|
{
|
||||||
$this->text = $pText;
|
$this->text = $text;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ class Settings
|
||||||
*
|
*
|
||||||
* @return bool Success or failure
|
* @return bool Success or failure
|
||||||
*/
|
*/
|
||||||
public static function setLocale($locale = 'en_us')
|
public static function setLocale($locale)
|
||||||
{
|
{
|
||||||
return Calculation::getInstance()->setLocale($locale);
|
return Calculation::getInstance()->setLocale($locale);
|
||||||
}
|
}
|
||||||
|
@ -208,7 +208,7 @@ class Settings
|
||||||
*
|
*
|
||||||
* @param int $options Default options for libxml loader
|
* @param int $options Default options for libxml loader
|
||||||
*/
|
*/
|
||||||
public static function setLibXmlLoaderOptions($options = null)
|
public static function setLibXmlLoaderOptions($options)
|
||||||
{
|
{
|
||||||
if (is_null($options) && defined('LIBXML_DTDLOAD')) {
|
if (is_null($options) && defined('LIBXML_DTDLOAD')) {
|
||||||
$options = LIBXML_DTDLOAD | LIBXML_DTDATTR;
|
$options = LIBXML_DTDLOAD | LIBXML_DTDATTR;
|
||||||
|
|
|
@ -36,7 +36,7 @@ class CodePage
|
||||||
*
|
*
|
||||||
* @return string Code Page Name
|
* @return string Code Page Name
|
||||||
*/
|
*/
|
||||||
public static function numberToName($codePage = 1252)
|
public static function numberToName($codePage)
|
||||||
{
|
{
|
||||||
switch ($codePage) {
|
switch ($codePage) {
|
||||||
case 367:
|
case 367:
|
||||||
|
|
|
@ -176,7 +176,7 @@ class Date
|
||||||
*
|
*
|
||||||
* @return \DateTime PHP date/time object
|
* @return \DateTime PHP date/time object
|
||||||
*/
|
*/
|
||||||
public static function excelToDateTimeObject($excelTimestamp = 0, $timeZone = null)
|
public static function excelToDateTimeObject($excelTimestamp, $timeZone = null)
|
||||||
{
|
{
|
||||||
$timeZone = ($timeZone === null) ? self::getDefaultTimezone() : self::validateTimeZone($timeZone);
|
$timeZone = ($timeZone === null) ? self::getDefaultTimezone() : self::validateTimeZone($timeZone);
|
||||||
if ($excelTimestamp < 1.0) {
|
if ($excelTimestamp < 1.0) {
|
||||||
|
@ -217,7 +217,7 @@ class Date
|
||||||
*
|
*
|
||||||
* @return int Unix timetamp for this date/time
|
* @return int Unix timetamp for this date/time
|
||||||
*/
|
*/
|
||||||
public static function excelToTimestamp($excelTimestamp = 0, $timeZone = null)
|
public static function excelToTimestamp($excelTimestamp, $timeZone = null)
|
||||||
{
|
{
|
||||||
return (int) self::excelToDateTimeObject($excelTimestamp, $timeZone)
|
return (int) self::excelToDateTimeObject($excelTimestamp, $timeZone)
|
||||||
->format('U');
|
->format('U');
|
||||||
|
@ -231,7 +231,7 @@ class Date
|
||||||
* @return float|bool Excel date/time value
|
* @return float|bool Excel date/time value
|
||||||
* or boolean FALSE on failure
|
* or boolean FALSE on failure
|
||||||
*/
|
*/
|
||||||
public static function PHPToExcel($dateValue = 0)
|
public static function PHPToExcel($dateValue)
|
||||||
{
|
{
|
||||||
if ((is_object($dateValue)) && ($dateValue instanceof \DateTimeInterface)) {
|
if ((is_object($dateValue)) && ($dateValue instanceof \DateTimeInterface)) {
|
||||||
return self::dateTimeToExcel($dateValue);
|
return self::dateTimeToExcel($dateValue);
|
||||||
|
@ -270,7 +270,7 @@ class Date
|
||||||
*
|
*
|
||||||
* @return float MS Excel serialized date/time value
|
* @return float MS Excel serialized date/time value
|
||||||
*/
|
*/
|
||||||
public static function timestampToExcel($dateValue = 0)
|
public static function timestampToExcel($dateValue)
|
||||||
{
|
{
|
||||||
if (!is_numeric($dateValue)) {
|
if (!is_numeric($dateValue)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -363,7 +363,7 @@ class Date
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function isDateTimeFormatCode($pFormatCode = '')
|
public static function isDateTimeFormatCode($pFormatCode)
|
||||||
{
|
{
|
||||||
if (strtolower($pFormatCode) === strtolower(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL)) {
|
if (strtolower($pFormatCode) === strtolower(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL)) {
|
||||||
// "General" contains an epoch letter 'e', so we trap for it explicitly here (case-insensitive check)
|
// "General" contains an epoch letter 'e', so we trap for it explicitly here (case-insensitive check)
|
||||||
|
@ -437,7 +437,7 @@ class Date
|
||||||
*
|
*
|
||||||
* @return float|false Excel date/time serial value
|
* @return float|false Excel date/time serial value
|
||||||
*/
|
*/
|
||||||
public static function stringToExcel($dateValue = '')
|
public static function stringToExcel($dateValue)
|
||||||
{
|
{
|
||||||
if (strlen($dateValue) < 2) {
|
if (strlen($dateValue) < 2) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -33,7 +33,7 @@ class Drawing
|
||||||
*
|
*
|
||||||
* @return int Value in EMU
|
* @return int Value in EMU
|
||||||
*/
|
*/
|
||||||
public static function pixelsToEMU($pValue = 0)
|
public static function pixelsToEMU($pValue)
|
||||||
{
|
{
|
||||||
return round($pValue * 9525);
|
return round($pValue * 9525);
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ class Drawing
|
||||||
*
|
*
|
||||||
* @return int Value in pixels
|
* @return int Value in pixels
|
||||||
*/
|
*/
|
||||||
public static function EMUToPixels($pValue = 0)
|
public static function EMUToPixels($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue != 0) {
|
if ($pValue != 0) {
|
||||||
return round($pValue / 9525);
|
return round($pValue / 9525);
|
||||||
|
@ -118,7 +118,7 @@ class Drawing
|
||||||
*
|
*
|
||||||
* @return float Value in points
|
* @return float Value in points
|
||||||
*/
|
*/
|
||||||
public static function pixelsToPoints($pValue = 0)
|
public static function pixelsToPoints($pValue)
|
||||||
{
|
{
|
||||||
return $pValue * 0.67777777;
|
return $pValue * 0.67777777;
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ class Drawing
|
||||||
*
|
*
|
||||||
* @return int Value in pixels
|
* @return int Value in pixels
|
||||||
*/
|
*/
|
||||||
public static function pointsToPixels($pValue = 0)
|
public static function pointsToPixels($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue != 0) {
|
if ($pValue != 0) {
|
||||||
return (int) ceil($pValue * 1.333333333);
|
return (int) ceil($pValue * 1.333333333);
|
||||||
|
@ -146,7 +146,7 @@ class Drawing
|
||||||
*
|
*
|
||||||
* @return int Angle
|
* @return int Angle
|
||||||
*/
|
*/
|
||||||
public static function degreesToAngle($pValue = 0)
|
public static function degreesToAngle($pValue)
|
||||||
{
|
{
|
||||||
return (int) round($pValue * 60000);
|
return (int) round($pValue * 60000);
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ class Drawing
|
||||||
*
|
*
|
||||||
* @return int Degrees
|
* @return int Degrees
|
||||||
*/
|
*/
|
||||||
public static function angleToDegrees($pValue = 0)
|
public static function angleToDegrees($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue != 0) {
|
if ($pValue != 0) {
|
||||||
return round($pValue / 60000);
|
return round($pValue / 60000);
|
||||||
|
|
|
@ -135,7 +135,7 @@ class SpContainer
|
||||||
*
|
*
|
||||||
* @param bool $value
|
* @param bool $value
|
||||||
*/
|
*/
|
||||||
public function setSpgr($value = false)
|
public function setSpgr($value)
|
||||||
{
|
{
|
||||||
$this->spgr = $value;
|
$this->spgr = $value;
|
||||||
}
|
}
|
||||||
|
@ -250,9 +250,9 @@ class SpContainer
|
||||||
/**
|
/**
|
||||||
* Set cell coordinates of upper-left corner of shape.
|
* Set cell coordinates of upper-left corner of shape.
|
||||||
*
|
*
|
||||||
* @param string $value
|
* @param string $value eg: 'A1'
|
||||||
*/
|
*/
|
||||||
public function setStartCoordinates($value = 'A1')
|
public function setStartCoordinates($value)
|
||||||
{
|
{
|
||||||
$this->startCoordinates = $value;
|
$this->startCoordinates = $value;
|
||||||
}
|
}
|
||||||
|
@ -272,7 +272,7 @@ class SpContainer
|
||||||
*
|
*
|
||||||
* @param int $startOffsetX
|
* @param int $startOffsetX
|
||||||
*/
|
*/
|
||||||
public function setStartOffsetX($startOffsetX = 0)
|
public function setStartOffsetX($startOffsetX)
|
||||||
{
|
{
|
||||||
$this->startOffsetX = $startOffsetX;
|
$this->startOffsetX = $startOffsetX;
|
||||||
}
|
}
|
||||||
|
@ -292,7 +292,7 @@ class SpContainer
|
||||||
*
|
*
|
||||||
* @param int $startOffsetY
|
* @param int $startOffsetY
|
||||||
*/
|
*/
|
||||||
public function setStartOffsetY($startOffsetY = 0)
|
public function setStartOffsetY($startOffsetY)
|
||||||
{
|
{
|
||||||
$this->startOffsetY = $startOffsetY;
|
$this->startOffsetY = $startOffsetY;
|
||||||
}
|
}
|
||||||
|
@ -310,9 +310,9 @@ class SpContainer
|
||||||
/**
|
/**
|
||||||
* Set cell coordinates of bottom-right corner of shape.
|
* Set cell coordinates of bottom-right corner of shape.
|
||||||
*
|
*
|
||||||
* @param string $value
|
* @param string $value eg: 'A1'
|
||||||
*/
|
*/
|
||||||
public function setEndCoordinates($value = 'A1')
|
public function setEndCoordinates($value)
|
||||||
{
|
{
|
||||||
$this->endCoordinates = $value;
|
$this->endCoordinates = $value;
|
||||||
}
|
}
|
||||||
|
@ -332,7 +332,7 @@ class SpContainer
|
||||||
*
|
*
|
||||||
* @param int $endOffsetX
|
* @param int $endOffsetX
|
||||||
*/
|
*/
|
||||||
public function setEndOffsetX($endOffsetX = 0)
|
public function setEndOffsetX($endOffsetX)
|
||||||
{
|
{
|
||||||
$this->endOffsetX = $endOffsetX;
|
$this->endOffsetX = $endOffsetX;
|
||||||
}
|
}
|
||||||
|
@ -352,7 +352,7 @@ class SpContainer
|
||||||
*
|
*
|
||||||
* @param int $endOffsetY
|
* @param int $endOffsetY
|
||||||
*/
|
*/
|
||||||
public function setEndOffsetY($endOffsetY = 0)
|
public function setEndOffsetY($endOffsetY)
|
||||||
{
|
{
|
||||||
$this->endOffsetY = $endOffsetY;
|
$this->endOffsetY = $endOffsetY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ class File
|
||||||
*
|
*
|
||||||
* @param bool $useUploadTempDir Use File Upload Temporary directory (true or false)
|
* @param bool $useUploadTempDir Use File Upload Temporary directory (true or false)
|
||||||
*/
|
*/
|
||||||
public static function setUseUploadTempDirectory($useUploadTempDir = false)
|
public static function setUseUploadTempDirectory($useUploadTempDir)
|
||||||
{
|
{
|
||||||
self::$useUploadTempDirectory = (bool) $useUploadTempDir;
|
self::$useUploadTempDirectory = (bool) $useUploadTempDir;
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,11 +182,11 @@ class Font
|
||||||
/**
|
/**
|
||||||
* Set autoSize method.
|
* Set autoSize method.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $pValue see self::AUTOSIZE_METHOD_*
|
||||||
*
|
*
|
||||||
* @return bool Success or failure
|
* @return bool Success or failure
|
||||||
*/
|
*/
|
||||||
public static function setAutoSizeMethod($pValue = self::AUTOSIZE_METHOD_APPROX)
|
public static function setAutoSizeMethod($pValue)
|
||||||
{
|
{
|
||||||
if (!in_array($pValue, self::$autoSizeMethods)) {
|
if (!in_array($pValue, self::$autoSizeMethods)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -217,7 +217,7 @@ class Font
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $pValue
|
||||||
*/
|
*/
|
||||||
public static function setTrueTypeFontPath($pValue = '')
|
public static function setTrueTypeFontPath($pValue)
|
||||||
{
|
{
|
||||||
self::$trueTypeFontPath = $pValue;
|
self::$trueTypeFontPath = $pValue;
|
||||||
}
|
}
|
||||||
|
@ -382,7 +382,7 @@ class Font
|
||||||
*
|
*
|
||||||
* @return int Font size (in pixels)
|
* @return int Font size (in pixels)
|
||||||
*/
|
*/
|
||||||
public static function fontSizeToPixels($fontSizeInPoints = 11)
|
public static function fontSizeToPixels($fontSizeInPoints)
|
||||||
{
|
{
|
||||||
return (int) ((4 / 3) * $fontSizeInPoints);
|
return (int) ((4 / 3) * $fontSizeInPoints);
|
||||||
}
|
}
|
||||||
|
@ -394,7 +394,7 @@ class Font
|
||||||
*
|
*
|
||||||
* @return int Size (in pixels)
|
* @return int Size (in pixels)
|
||||||
*/
|
*/
|
||||||
public static function inchSizeToPixels($sizeInInch = 1)
|
public static function inchSizeToPixels($sizeInInch)
|
||||||
{
|
{
|
||||||
return $sizeInInch * 96;
|
return $sizeInInch * 96;
|
||||||
}
|
}
|
||||||
|
@ -406,7 +406,7 @@ class Font
|
||||||
*
|
*
|
||||||
* @return float Size (in pixels)
|
* @return float Size (in pixels)
|
||||||
*/
|
*/
|
||||||
public static function centimeterSizeToPixels($sizeInCm = 1)
|
public static function centimeterSizeToPixels($sizeInCm)
|
||||||
{
|
{
|
||||||
return $sizeInCm * 37.795275591;
|
return $sizeInCm * 37.795275591;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,9 +48,8 @@ class CholeskyDecomposition
|
||||||
* @param mixed Matrix square symmetric positive definite matrix
|
* @param mixed Matrix square symmetric positive definite matrix
|
||||||
* @param null|mixed $A
|
* @param null|mixed $A
|
||||||
*/
|
*/
|
||||||
public function __construct($A = null)
|
public function __construct(Matrix $A)
|
||||||
{
|
{
|
||||||
if ($A instanceof Matrix) {
|
|
||||||
$this->L = $A->getArray();
|
$this->L = $A->getArray();
|
||||||
$this->m = $A->getRowDimension();
|
$this->m = $A->getRowDimension();
|
||||||
|
|
||||||
|
@ -76,12 +75,7 @@ class CholeskyDecomposition
|
||||||
$this->L[$i][$k] = 0.0;
|
$this->L[$i][$k] = 0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION));
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// function __construct()
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is the matrix symmetric and positive definite?
|
* Is the matrix symmetric and positive definite?
|
||||||
|
@ -93,8 +87,6 @@ class CholeskyDecomposition
|
||||||
return $this->isspd;
|
return $this->isspd;
|
||||||
}
|
}
|
||||||
|
|
||||||
// function isSPD()
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getL.
|
* getL.
|
||||||
*
|
*
|
||||||
|
@ -107,8 +99,6 @@ class CholeskyDecomposition
|
||||||
return new Matrix($this->L);
|
return new Matrix($this->L);
|
||||||
}
|
}
|
||||||
|
|
||||||
// function getL()
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Solve A*X = B.
|
* Solve A*X = B.
|
||||||
*
|
*
|
||||||
|
@ -116,9 +106,8 @@ class CholeskyDecomposition
|
||||||
*
|
*
|
||||||
* @return Matrix L * L' * X = B
|
* @return Matrix L * L' * X = B
|
||||||
*/
|
*/
|
||||||
public function solve($B = null)
|
public function solve(Matrix $B)
|
||||||
{
|
{
|
||||||
if ($B instanceof Matrix) {
|
|
||||||
if ($B->getRowDimension() == $this->m) {
|
if ($B->getRowDimension() == $this->m) {
|
||||||
if ($this->isspd) {
|
if ($this->isspd) {
|
||||||
$X = $B->getArrayCopy();
|
$X = $B->getArrayCopy();
|
||||||
|
@ -152,8 +141,4 @@ class CholeskyDecomposition
|
||||||
}
|
}
|
||||||
throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(JAMAError(MATRIX_DIMENSION_EXCEPTION));
|
throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(JAMAError(MATRIX_DIMENSION_EXCEPTION));
|
||||||
}
|
}
|
||||||
throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION));
|
|
||||||
}
|
|
||||||
|
|
||||||
// function solve()
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,17 +67,13 @@ $error['EN'][ROW_LENGTH_EXCEPTION] = 'All rows must have the same length.';
|
||||||
*
|
*
|
||||||
* @param int $errorNumber Error number
|
* @param int $errorNumber Error number
|
||||||
*/
|
*/
|
||||||
function JAMAError($errorNumber = null)
|
function JAMAError($errorNumber)
|
||||||
{
|
{
|
||||||
global $error;
|
global $error;
|
||||||
|
|
||||||
if (isset($errorNumber)) {
|
|
||||||
if (isset($error[JAMALANG][$errorNumber])) {
|
if (isset($error[JAMALANG][$errorNumber])) {
|
||||||
return $error[JAMALANG][$errorNumber];
|
return $error[JAMALANG][$errorNumber];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $error['EN'][$errorNumber];
|
return $error['EN'][$errorNumber];
|
||||||
}
|
|
||||||
|
|
||||||
return 'Invalid argument to JAMAError()';
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -486,7 +486,7 @@ class OLE
|
||||||
*
|
*
|
||||||
* @return string The string for the OLE container
|
* @return string The string for the OLE container
|
||||||
*/
|
*/
|
||||||
public static function localDateToOLE($date = null)
|
public static function localDateToOLE($date)
|
||||||
{
|
{
|
||||||
if (!isset($date)) {
|
if (!isset($date)) {
|
||||||
return "\x00\x00\x00\x00\x00\x00\x00\x00";
|
return "\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||||
|
|
|
@ -37,7 +37,7 @@ class PasswordHasher
|
||||||
*
|
*
|
||||||
* @return string Hashed password
|
* @return string Hashed password
|
||||||
*/
|
*/
|
||||||
public static function hashPassword($pPassword = '')
|
public static function hashPassword($pPassword)
|
||||||
{
|
{
|
||||||
$password = 0x0000;
|
$password = 0x0000;
|
||||||
$charPos = 1; // char position
|
$charPos = 1; // char position
|
||||||
|
|
|
@ -323,7 +323,7 @@ class StringHelper
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function controlCharacterOOXML2PHP($value = '')
|
public static function controlCharacterOOXML2PHP($value)
|
||||||
{
|
{
|
||||||
return str_replace(array_keys(self::$controlCharacters), array_values(self::$controlCharacters), $value);
|
return str_replace(array_keys(self::$controlCharacters), array_values(self::$controlCharacters), $value);
|
||||||
}
|
}
|
||||||
|
@ -343,7 +343,7 @@ class StringHelper
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function controlCharacterPHP2OOXML($value = '')
|
public static function controlCharacterPHP2OOXML($value)
|
||||||
{
|
{
|
||||||
return str_replace(array_values(self::$controlCharacters), array_keys(self::$controlCharacters), $value);
|
return str_replace(array_values(self::$controlCharacters), array_keys(self::$controlCharacters), $value);
|
||||||
}
|
}
|
||||||
|
@ -375,7 +375,7 @@ class StringHelper
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function isUTF8($value = '')
|
public static function isUTF8($value)
|
||||||
{
|
{
|
||||||
return $value === '' || preg_match('/^./su', $value) === 1;
|
return $value === '' || preg_match('/^./su', $value) === 1;
|
||||||
}
|
}
|
||||||
|
@ -499,7 +499,7 @@ class StringHelper
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function substring($pValue = '', $pStart = 0, $pLength = 0)
|
public static function substring($pValue, $pStart, $pLength = 0)
|
||||||
{
|
{
|
||||||
return mb_substr($pValue, $pStart, $pLength, 'UTF-8');
|
return mb_substr($pValue, $pStart, $pLength, 'UTF-8');
|
||||||
}
|
}
|
||||||
|
@ -511,7 +511,7 @@ class StringHelper
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function strToUpper($pValue = '')
|
public static function strToUpper($pValue)
|
||||||
{
|
{
|
||||||
return mb_convert_case($pValue, MB_CASE_UPPER, 'UTF-8');
|
return mb_convert_case($pValue, MB_CASE_UPPER, 'UTF-8');
|
||||||
}
|
}
|
||||||
|
@ -523,7 +523,7 @@ class StringHelper
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function strToLower($pValue = '')
|
public static function strToLower($pValue)
|
||||||
{
|
{
|
||||||
return mb_convert_case($pValue, MB_CASE_LOWER, 'UTF-8');
|
return mb_convert_case($pValue, MB_CASE_LOWER, 'UTF-8');
|
||||||
}
|
}
|
||||||
|
@ -536,7 +536,7 @@ class StringHelper
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function strToTitle($pValue = '')
|
public static function strToTitle($pValue)
|
||||||
{
|
{
|
||||||
return mb_convert_case($pValue, MB_CASE_TITLE, 'UTF-8');
|
return mb_convert_case($pValue, MB_CASE_TITLE, 'UTF-8');
|
||||||
}
|
}
|
||||||
|
@ -561,7 +561,7 @@ class StringHelper
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function strCaseReverse($pValue = '')
|
public static function strCaseReverse($pValue)
|
||||||
{
|
{
|
||||||
$characters = self::mbStrSplit($pValue);
|
$characters = self::mbStrSplit($pValue);
|
||||||
foreach ($characters as &$character) {
|
foreach ($characters as &$character) {
|
||||||
|
@ -626,7 +626,7 @@ class StringHelper
|
||||||
*
|
*
|
||||||
* @param string $pValue Character for decimal separator
|
* @param string $pValue Character for decimal separator
|
||||||
*/
|
*/
|
||||||
public static function setDecimalSeparator($pValue = '.')
|
public static function setDecimalSeparator($pValue)
|
||||||
{
|
{
|
||||||
self::$decimalSeparator = $pValue;
|
self::$decimalSeparator = $pValue;
|
||||||
}
|
}
|
||||||
|
@ -659,7 +659,7 @@ class StringHelper
|
||||||
*
|
*
|
||||||
* @param string $pValue Character for thousands separator
|
* @param string $pValue Character for thousands separator
|
||||||
*/
|
*/
|
||||||
public static function setThousandsSeparator($pValue = ',')
|
public static function setThousandsSeparator($pValue)
|
||||||
{
|
{
|
||||||
self::$thousandsSeparator = $pValue;
|
self::$thousandsSeparator = $pValue;
|
||||||
}
|
}
|
||||||
|
@ -697,7 +697,7 @@ class StringHelper
|
||||||
*
|
*
|
||||||
* @param string $pValue Character for currency code
|
* @param string $pValue Character for currency code
|
||||||
*/
|
*/
|
||||||
public static function setCurrencyCode($pValue = '$')
|
public static function setCurrencyCode($pValue)
|
||||||
{
|
{
|
||||||
self::$currencyCode = $pValue;
|
self::$currencyCode = $pValue;
|
||||||
}
|
}
|
||||||
|
@ -709,7 +709,7 @@ class StringHelper
|
||||||
*
|
*
|
||||||
* @return string UTF-8 encoded string
|
* @return string UTF-8 encoded string
|
||||||
*/
|
*/
|
||||||
public static function SYLKtoUTF8($pValue = '')
|
public static function SYLKtoUTF8($pValue)
|
||||||
{
|
{
|
||||||
// If there is no escape character in the string there is nothing to do
|
// If there is no escape character in the string there is nothing to do
|
||||||
if (strpos($pValue, '') === false) {
|
if (strpos($pValue, '') === false) {
|
||||||
|
|
|
@ -148,7 +148,7 @@ class Spreadsheet
|
||||||
*
|
*
|
||||||
* @param bool $hasMacros true|false
|
* @param bool $hasMacros true|false
|
||||||
*/
|
*/
|
||||||
public function setHasMacros($hasMacros = false)
|
public function setHasMacros($hasMacros)
|
||||||
{
|
{
|
||||||
$this->hasMacros = (bool) $hasMacros;
|
$this->hasMacros = (bool) $hasMacros;
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ class Spreadsheet
|
||||||
*
|
*
|
||||||
* @param string $macroCode string|null
|
* @param string $macroCode string|null
|
||||||
*/
|
*/
|
||||||
public function setMacrosCode($macroCode = null)
|
public function setMacrosCode($macroCode)
|
||||||
{
|
{
|
||||||
$this->macrosCode = $macroCode;
|
$this->macrosCode = $macroCode;
|
||||||
$this->setHasMacros(!is_null($macroCode));
|
$this->setHasMacros(!is_null($macroCode));
|
||||||
|
@ -179,7 +179,7 @@ class Spreadsheet
|
||||||
*
|
*
|
||||||
* @param string|null $certificate
|
* @param string|null $certificate
|
||||||
*/
|
*/
|
||||||
public function setMacrosCertificate($certificate = null)
|
public function setMacrosCertificate($certificate)
|
||||||
{
|
{
|
||||||
$this->macrosCertificate = $certificate;
|
$this->macrosCertificate = $certificate;
|
||||||
}
|
}
|
||||||
|
@ -220,7 +220,7 @@ class Spreadsheet
|
||||||
* @param null|mixed $target
|
* @param null|mixed $target
|
||||||
* @param null|mixed $xmlData
|
* @param null|mixed $xmlData
|
||||||
*/
|
*/
|
||||||
public function setRibbonXMLData($target = null, $xmlData = null)
|
public function setRibbonXMLData($target, $xmlData)
|
||||||
{
|
{
|
||||||
if (!is_null($target) && !is_null($xmlData)) {
|
if (!is_null($target) && !is_null($xmlData)) {
|
||||||
$this->ribbonXMLData = ['target' => $target, 'data' => $xmlData];
|
$this->ribbonXMLData = ['target' => $target, 'data' => $xmlData];
|
||||||
|
@ -234,7 +234,7 @@ class Spreadsheet
|
||||||
*
|
*
|
||||||
* return string|null|array
|
* return string|null|array
|
||||||
*
|
*
|
||||||
* @param mixed $what
|
* @param string $what
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
@ -263,7 +263,7 @@ class Spreadsheet
|
||||||
* @param null|mixed $BinObjectsNames
|
* @param null|mixed $BinObjectsNames
|
||||||
* @param null|mixed $BinObjectsData
|
* @param null|mixed $BinObjectsData
|
||||||
*/
|
*/
|
||||||
public function setRibbonBinObjects($BinObjectsNames = null, $BinObjectsData = null)
|
public function setRibbonBinObjects($BinObjectsNames, $BinObjectsData)
|
||||||
{
|
{
|
||||||
if (!is_null($BinObjectsNames) && !is_null($BinObjectsData)) {
|
if (!is_null($BinObjectsNames) && !is_null($BinObjectsData)) {
|
||||||
$this->ribbonBinObjects = ['names' => $BinObjectsNames, 'data' => $BinObjectsData];
|
$this->ribbonBinObjects = ['names' => $BinObjectsNames, 'data' => $BinObjectsData];
|
||||||
|
@ -285,20 +285,20 @@ class Spreadsheet
|
||||||
/**
|
/**
|
||||||
* retrieve Binaries Ribbon Objects.
|
* retrieve Binaries Ribbon Objects.
|
||||||
*
|
*
|
||||||
* @param mixed $What
|
* @param mixed $what
|
||||||
*/
|
*/
|
||||||
public function getRibbonBinObjects($What = 'all')
|
public function getRibbonBinObjects($what = 'all')
|
||||||
{
|
{
|
||||||
$ReturnData = null;
|
$ReturnData = null;
|
||||||
$What = strtolower($What);
|
$what = strtolower($what);
|
||||||
switch ($What) {
|
switch ($what) {
|
||||||
case 'all':
|
case 'all':
|
||||||
return $this->ribbonBinObjects;
|
return $this->ribbonBinObjects;
|
||||||
break;
|
break;
|
||||||
case 'names':
|
case 'names':
|
||||||
case 'data':
|
case 'data':
|
||||||
if (is_array($this->ribbonBinObjects) && isset($this->ribbonBinObjects[$What])) {
|
if (is_array($this->ribbonBinObjects) && isset($this->ribbonBinObjects[$what])) {
|
||||||
$ReturnData = $this->ribbonBinObjects[$What];
|
$ReturnData = $this->ribbonBinObjects[$what];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'types':
|
case 'types':
|
||||||
|
@ -354,7 +354,7 @@ class Spreadsheet
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function getSheetByCodeName($pName = '')
|
public function getSheetByCodeName($pName)
|
||||||
{
|
{
|
||||||
$worksheetCount = count($this->workSheetCollection);
|
$worksheetCount = count($this->workSheetCollection);
|
||||||
for ($i = 0; $i < $worksheetCount; ++$i) {
|
for ($i = 0; $i < $worksheetCount; ++$i) {
|
||||||
|
@ -486,16 +486,16 @@ class Spreadsheet
|
||||||
/**
|
/**
|
||||||
* Create sheet and add it to this workbook.
|
* Create sheet and add it to this workbook.
|
||||||
*
|
*
|
||||||
* @param int|null $iSheetIndex Index where sheet should go (0,1,..., or null for last)
|
* @param int|null $sheetIndex Index where sheet should go (0,1,..., or null for last)
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function createSheet($iSheetIndex = null)
|
public function createSheet($sheetIndex = null)
|
||||||
{
|
{
|
||||||
$newSheet = new Worksheet($this);
|
$newSheet = new Worksheet($this);
|
||||||
$this->addSheet($newSheet, $iSheetIndex);
|
$this->addSheet($newSheet, $sheetIndex);
|
||||||
|
|
||||||
return $newSheet;
|
return $newSheet;
|
||||||
}
|
}
|
||||||
|
@ -564,7 +564,7 @@ class Spreadsheet
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function removeSheetByIndex($pIndex = 0)
|
public function removeSheetByIndex($pIndex)
|
||||||
{
|
{
|
||||||
$numSheets = count($this->workSheetCollection);
|
$numSheets = count($this->workSheetCollection);
|
||||||
if ($pIndex > $numSheets - 1) {
|
if ($pIndex > $numSheets - 1) {
|
||||||
|
@ -590,7 +590,7 @@ class Spreadsheet
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function getSheet($pIndex = 0)
|
public function getSheet($pIndex)
|
||||||
{
|
{
|
||||||
if (!isset($this->workSheetCollection[$pIndex])) {
|
if (!isset($this->workSheetCollection[$pIndex])) {
|
||||||
$numSheets = $this->getSheetCount();
|
$numSheets = $this->getSheetCount();
|
||||||
|
@ -619,7 +619,7 @@ class Spreadsheet
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function getSheetByName($pName = '')
|
public function getSheetByName($pName)
|
||||||
{
|
{
|
||||||
$worksheetCount = count($this->workSheetCollection);
|
$worksheetCount = count($this->workSheetCollection);
|
||||||
for ($i = 0; $i < $worksheetCount; ++$i) {
|
for ($i = 0; $i < $worksheetCount; ++$i) {
|
||||||
|
@ -708,7 +708,7 @@ class Spreadsheet
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setActiveSheetIndex($pIndex = 0)
|
public function setActiveSheetIndex($pIndex)
|
||||||
{
|
{
|
||||||
$numSheets = count($this->workSheetCollection);
|
$numSheets = count($this->workSheetCollection);
|
||||||
|
|
||||||
|
@ -731,7 +731,7 @@ class Spreadsheet
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setActiveSheetIndexByName($pValue = '')
|
public function setActiveSheetIndexByName($pValue)
|
||||||
{
|
{
|
||||||
if (($worksheet = $this->getSheetByName($pValue)) instanceof Worksheet) {
|
if (($worksheet = $this->getSheetByName($pValue)) instanceof Worksheet) {
|
||||||
$this->setActiveSheetIndex($this->getIndex($worksheet));
|
$this->setActiveSheetIndex($this->getIndex($worksheet));
|
||||||
|
@ -931,7 +931,7 @@ class Spreadsheet
|
||||||
*
|
*
|
||||||
* @return Style
|
* @return Style
|
||||||
*/
|
*/
|
||||||
public function getCellXfByIndex($pIndex = 0)
|
public function getCellXfByIndex($pIndex)
|
||||||
{
|
{
|
||||||
return $this->cellXfCollection[$pIndex];
|
return $this->cellXfCollection[$pIndex];
|
||||||
}
|
}
|
||||||
|
@ -943,7 +943,7 @@ class Spreadsheet
|
||||||
*
|
*
|
||||||
* @return Style|false
|
* @return Style|false
|
||||||
*/
|
*/
|
||||||
public function getCellXfByHashCode($pValue = '')
|
public function getCellXfByHashCode($pValue)
|
||||||
{
|
{
|
||||||
foreach ($this->cellXfCollection as $cellXf) {
|
foreach ($this->cellXfCollection as $cellXf) {
|
||||||
if ($cellXf->getHashCode() == $pValue) {
|
if ($cellXf->getHashCode() == $pValue) {
|
||||||
|
@ -961,7 +961,7 @@ class Spreadsheet
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function cellXfExists($pCellStyle = null)
|
public function cellXfExists($pCellStyle)
|
||||||
{
|
{
|
||||||
return in_array($pCellStyle, $this->cellXfCollection, true);
|
return in_array($pCellStyle, $this->cellXfCollection, true);
|
||||||
}
|
}
|
||||||
|
@ -999,7 +999,7 @@ class Spreadsheet
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function removeCellXfByIndex($pIndex = 0)
|
public function removeCellXfByIndex($pIndex)
|
||||||
{
|
{
|
||||||
if ($pIndex > count($this->cellXfCollection) - 1) {
|
if ($pIndex > count($this->cellXfCollection) - 1) {
|
||||||
throw new Exception('CellXf index is out of bounds.');
|
throw new Exception('CellXf index is out of bounds.');
|
||||||
|
@ -1051,7 +1051,7 @@ class Spreadsheet
|
||||||
*
|
*
|
||||||
* @return Style
|
* @return Style
|
||||||
*/
|
*/
|
||||||
public function getCellStyleXfByIndex($pIndex = 0)
|
public function getCellStyleXfByIndex($pIndex)
|
||||||
{
|
{
|
||||||
return $this->cellStyleXfCollection[$pIndex];
|
return $this->cellStyleXfCollection[$pIndex];
|
||||||
}
|
}
|
||||||
|
@ -1063,7 +1063,7 @@ class Spreadsheet
|
||||||
*
|
*
|
||||||
* @return Style|false
|
* @return Style|false
|
||||||
*/
|
*/
|
||||||
public function getCellStyleXfByHashCode($pValue = '')
|
public function getCellStyleXfByHashCode($pValue)
|
||||||
{
|
{
|
||||||
foreach ($this->cellStyleXfCollection as $cellStyleXf) {
|
foreach ($this->cellStyleXfCollection as $cellStyleXf) {
|
||||||
if ($cellStyleXf->getHashCode() == $pValue) {
|
if ($cellStyleXf->getHashCode() == $pValue) {
|
||||||
|
@ -1092,7 +1092,7 @@ class Spreadsheet
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function removeCellStyleXfByIndex($pIndex = 0)
|
public function removeCellStyleXfByIndex($pIndex)
|
||||||
{
|
{
|
||||||
if ($pIndex > count($this->cellStyleXfCollection) - 1) {
|
if ($pIndex > count($this->cellStyleXfCollection) - 1) {
|
||||||
throw new Exception('CellStyleXf index is out of bounds.');
|
throw new Exception('CellStyleXf index is out of bounds.');
|
||||||
|
|
|
@ -208,9 +208,8 @@ class Style extends Style\Supervisor implements IComparable
|
||||||
*
|
*
|
||||||
* @return Style
|
* @return Style
|
||||||
*/
|
*/
|
||||||
public function applyFromArray($pStyles = null, $pAdvanced = true)
|
public function applyFromArray(array $pStyles, $pAdvanced = true)
|
||||||
{
|
{
|
||||||
if (is_array($pStyles)) {
|
|
||||||
if ($this->isSupervisor) {
|
if ($this->isSupervisor) {
|
||||||
$pRange = $this->getSelectedCells();
|
$pRange = $this->getSelectedCells();
|
||||||
|
|
||||||
|
@ -463,9 +462,6 @@ class Style extends Style\Supervisor implements IComparable
|
||||||
$this->quotePrefix = $pStyles['quotePrefix'];
|
$this->quotePrefix = $pStyles['quotePrefix'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
throw new Exception('Invalid style array passed.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -547,15 +543,13 @@ class Style extends Style\Supervisor implements IComparable
|
||||||
/**
|
/**
|
||||||
* Set Conditional Styles. Only used on supervisor.
|
* Set Conditional Styles. Only used on supervisor.
|
||||||
*
|
*
|
||||||
* @param Style\Conditional[] $pValue Array of condtional styles
|
* @param Style\Conditional[] $pValue Array of conditional styles
|
||||||
*
|
*
|
||||||
* @return Style
|
* @return Style
|
||||||
*/
|
*/
|
||||||
public function setConditionalStyles($pValue = null)
|
public function setConditionalStyles(array $pValue)
|
||||||
{
|
{
|
||||||
if (is_array($pValue)) {
|
|
||||||
$this->getActiveSheet()->setConditionalStyles($this->getSelectedCells(), $pValue);
|
$this->getActiveSheet()->setConditionalStyles($this->getSelectedCells(), $pValue);
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,9 +162,8 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
|
||||||
*
|
*
|
||||||
* @return Alignment
|
* @return Alignment
|
||||||
*/
|
*/
|
||||||
public function applyFromArray($pStyles = null)
|
public function applyFromArray(array $pStyles)
|
||||||
{
|
{
|
||||||
if (is_array($pStyles)) {
|
|
||||||
if ($this->isSupervisor) {
|
if ($this->isSupervisor) {
|
||||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())
|
$this->getActiveSheet()->getStyle($this->getSelectedCells())
|
||||||
->applyFromArray($this->getStyleArray($pStyles));
|
->applyFromArray($this->getStyleArray($pStyles));
|
||||||
|
@ -191,9 +190,6 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
|
||||||
$this->setReadorder($pStyles['readorder']);
|
$this->setReadorder($pStyles['readorder']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid style array passed.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -215,11 +211,11 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
|
||||||
/**
|
/**
|
||||||
* Set Horizontal.
|
* Set Horizontal.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $pValue see self::HORIZONTAL_*
|
||||||
*
|
*
|
||||||
* @return Alignment
|
* @return Alignment
|
||||||
*/
|
*/
|
||||||
public function setHorizontal($pValue = self::HORIZONTAL_GENERAL)
|
public function setHorizontal($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue == '') {
|
if ($pValue == '') {
|
||||||
$pValue = self::HORIZONTAL_GENERAL;
|
$pValue = self::HORIZONTAL_GENERAL;
|
||||||
|
@ -252,11 +248,11 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
|
||||||
/**
|
/**
|
||||||
* Set Vertical.
|
* Set Vertical.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $pValue see self::VERTICAL_*
|
||||||
*
|
*
|
||||||
* @return Alignment
|
* @return Alignment
|
||||||
*/
|
*/
|
||||||
public function setVertical($pValue = self::VERTICAL_BOTTOM)
|
public function setVertical($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue == '') {
|
if ($pValue == '') {
|
||||||
$pValue = self::VERTICAL_BOTTOM;
|
$pValue = self::VERTICAL_BOTTOM;
|
||||||
|
@ -295,7 +291,7 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
|
||||||
*
|
*
|
||||||
* @return Alignment
|
* @return Alignment
|
||||||
*/
|
*/
|
||||||
public function setTextRotation($pValue = 0)
|
public function setTextRotation($pValue)
|
||||||
{
|
{
|
||||||
// Excel2007 value 255 => PhpSpreadsheet value -165
|
// Excel2007 value 255 => PhpSpreadsheet value -165
|
||||||
if ($pValue == 255) {
|
if ($pValue == 255) {
|
||||||
|
@ -338,7 +334,7 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
|
||||||
*
|
*
|
||||||
* @return Alignment
|
* @return Alignment
|
||||||
*/
|
*/
|
||||||
public function setWrapText($pValue = false)
|
public function setWrapText($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue == '') {
|
if ($pValue == '') {
|
||||||
$pValue = false;
|
$pValue = false;
|
||||||
|
@ -374,7 +370,7 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
|
||||||
*
|
*
|
||||||
* @return Alignment
|
* @return Alignment
|
||||||
*/
|
*/
|
||||||
public function setShrinkToFit($pValue = false)
|
public function setShrinkToFit($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue == '') {
|
if ($pValue == '') {
|
||||||
$pValue = false;
|
$pValue = false;
|
||||||
|
@ -410,7 +406,7 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
|
||||||
*
|
*
|
||||||
* @return Alignment
|
* @return Alignment
|
||||||
*/
|
*/
|
||||||
public function setIndent($pValue = 0)
|
public function setIndent($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue > 0) {
|
if ($pValue > 0) {
|
||||||
if ($this->getHorizontal() != self::HORIZONTAL_GENERAL &&
|
if ($this->getHorizontal() != self::HORIZONTAL_GENERAL &&
|
||||||
|
@ -450,7 +446,7 @@ class Alignment extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompara
|
||||||
*
|
*
|
||||||
* @return Alignment
|
* @return Alignment
|
||||||
*/
|
*/
|
||||||
public function setReadorder($pValue = 0)
|
public function setReadorder($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue < 0 || $pValue > 2) {
|
if ($pValue < 0 || $pValue > 2) {
|
||||||
$pValue = 0;
|
$pValue = 0;
|
||||||
|
|
|
@ -181,9 +181,8 @@ class Border extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Border
|
* @return Border
|
||||||
*/
|
*/
|
||||||
public function applyFromArray($pStyles = null)
|
public function applyFromArray(array $pStyles)
|
||||||
{
|
{
|
||||||
if (is_array($pStyles)) {
|
|
||||||
if ($this->isSupervisor) {
|
if ($this->isSupervisor) {
|
||||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
|
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
|
||||||
} else {
|
} else {
|
||||||
|
@ -194,9 +193,6 @@ class Border extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
$this->getColor()->applyFromArray($pStyles['color']);
|
$this->getColor()->applyFromArray($pStyles['color']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid style array passed.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -224,7 +220,7 @@ class Border extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Border
|
* @return Border
|
||||||
*/
|
*/
|
||||||
public function setBorderStyle($pValue = self::BORDER_NONE)
|
public function setBorderStyle($pValue)
|
||||||
{
|
{
|
||||||
if (empty($pValue)) {
|
if (empty($pValue)) {
|
||||||
$pValue = self::BORDER_NONE;
|
$pValue = self::BORDER_NONE;
|
||||||
|
|
|
@ -218,9 +218,8 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
|
||||||
*
|
*
|
||||||
* @return Borders
|
* @return Borders
|
||||||
*/
|
*/
|
||||||
public function applyFromArray($pStyles = null)
|
public function applyFromArray(array $pStyles)
|
||||||
{
|
{
|
||||||
if (is_array($pStyles)) {
|
|
||||||
if ($this->isSupervisor) {
|
if ($this->isSupervisor) {
|
||||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
|
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
|
||||||
} else {
|
} else {
|
||||||
|
@ -249,9 +248,6 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
|
||||||
$this->getBottom()->applyFromArray($pStyles['allborders']);
|
$this->getBottom()->applyFromArray($pStyles['allborders']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid style array passed.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -403,11 +399,11 @@ class Borders extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparabl
|
||||||
/**
|
/**
|
||||||
* Set DiagonalDirection.
|
* Set DiagonalDirection.
|
||||||
*
|
*
|
||||||
* @param int $pValue
|
* @param int $pValue see self::DIAGONAL_*
|
||||||
*
|
*
|
||||||
* @return Borders
|
* @return Borders
|
||||||
*/
|
*/
|
||||||
public function setDiagonalDirection($pValue = self::DIAGONAL_NONE)
|
public function setDiagonalDirection($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue == '') {
|
if ($pValue == '') {
|
||||||
$pValue = self::DIAGONAL_NONE;
|
$pValue = self::DIAGONAL_NONE;
|
||||||
|
|
|
@ -152,9 +152,8 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Color
|
* @return Color
|
||||||
*/
|
*/
|
||||||
public function applyFromArray($pStyles = null)
|
public function applyFromArray(array $pStyles)
|
||||||
{
|
{
|
||||||
if (is_array($pStyles)) {
|
|
||||||
if ($this->isSupervisor) {
|
if ($this->isSupervisor) {
|
||||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
|
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
|
||||||
} else {
|
} else {
|
||||||
|
@ -165,9 +164,6 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
$this->setARGB($pStyles['argb']);
|
$this->setARGB($pStyles['argb']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid style array passed.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -189,11 +185,11 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
/**
|
/**
|
||||||
* Set ARGB.
|
* Set ARGB.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $pValue see self::COLOR_*
|
||||||
*
|
*
|
||||||
* @return Color
|
* @return Color
|
||||||
*/
|
*/
|
||||||
public function setARGB($pValue = self::COLOR_BLACK)
|
public function setARGB($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue == '') {
|
if ($pValue == '') {
|
||||||
$pValue = self::COLOR_BLACK;
|
$pValue = self::COLOR_BLACK;
|
||||||
|
@ -229,7 +225,7 @@ class Color extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Color
|
* @return Color
|
||||||
*/
|
*/
|
||||||
public function setRGB($pValue = '000000')
|
public function setRGB($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue == '') {
|
if ($pValue == '') {
|
||||||
$pValue = '000000';
|
$pValue = '000000';
|
||||||
|
|
|
@ -108,11 +108,11 @@ class Conditional implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
/**
|
/**
|
||||||
* Set Condition type.
|
* Set Condition type.
|
||||||
*
|
*
|
||||||
* @param string $pValue Condition type
|
* @param string $pValue Condition type, see self::CONDITION_*
|
||||||
*
|
*
|
||||||
* @return Conditional
|
* @return Conditional
|
||||||
*/
|
*/
|
||||||
public function setConditionType($pValue = self::CONDITION_NONE)
|
public function setConditionType($pValue)
|
||||||
{
|
{
|
||||||
$this->conditionType = $pValue;
|
$this->conditionType = $pValue;
|
||||||
|
|
||||||
|
@ -132,11 +132,11 @@ class Conditional implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
/**
|
/**
|
||||||
* Set Operator type.
|
* Set Operator type.
|
||||||
*
|
*
|
||||||
* @param string $pValue Conditional operator type
|
* @param string $pValue Conditional operator type, see self::OPERATOR_*
|
||||||
*
|
*
|
||||||
* @return Conditional
|
* @return Conditional
|
||||||
*/
|
*/
|
||||||
public function setOperatorType($pValue = self::OPERATOR_NONE)
|
public function setOperatorType($pValue)
|
||||||
{
|
{
|
||||||
$this->operatorType = $pValue;
|
$this->operatorType = $pValue;
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ class Conditional implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Conditional
|
* @return Conditional
|
||||||
*/
|
*/
|
||||||
public function setText($value = null)
|
public function setText($value)
|
||||||
{
|
{
|
||||||
$this->text = $value;
|
$this->text = $value;
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ class Conditional implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Conditional
|
* @return Conditional
|
||||||
*/
|
*/
|
||||||
public function addCondition($pValue = '')
|
public function addCondition($pValue)
|
||||||
{
|
{
|
||||||
$this->condition[] = $pValue;
|
$this->condition[] = $pValue;
|
||||||
|
|
||||||
|
|
|
@ -153,9 +153,8 @@ class Fill extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Fill
|
* @return Fill
|
||||||
*/
|
*/
|
||||||
public function applyFromArray($pStyles = null)
|
public function applyFromArray(array $pStyles)
|
||||||
{
|
{
|
||||||
if (is_array($pStyles)) {
|
|
||||||
if ($this->isSupervisor) {
|
if ($this->isSupervisor) {
|
||||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
|
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
|
||||||
} else {
|
} else {
|
||||||
|
@ -176,9 +175,6 @@ class Fill extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
$this->getEndColor()->applyFromArray($pStyles['color']);
|
$this->getEndColor()->applyFromArray($pStyles['color']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid style array passed.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -200,11 +196,11 @@ class Fill extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
/**
|
/**
|
||||||
* Set Fill Type.
|
* Set Fill Type.
|
||||||
*
|
*
|
||||||
* @param string $pValue Fill type
|
* @param string $pValue Fill type, see self::FILL_*
|
||||||
*
|
*
|
||||||
* @return Fill
|
* @return Fill
|
||||||
*/
|
*/
|
||||||
public function setFillType($pValue = self::FILL_NONE)
|
public function setFillType($pValue)
|
||||||
{
|
{
|
||||||
if ($this->isSupervisor) {
|
if ($this->isSupervisor) {
|
||||||
$styleArray = $this->getStyleArray(['type' => $pValue]);
|
$styleArray = $this->getStyleArray(['type' => $pValue]);
|
||||||
|
@ -237,7 +233,7 @@ class Fill extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Fill
|
* @return Fill
|
||||||
*/
|
*/
|
||||||
public function setRotation($pValue = 0)
|
public function setRotation($pValue)
|
||||||
{
|
{
|
||||||
if ($this->isSupervisor) {
|
if ($this->isSupervisor) {
|
||||||
$styleArray = $this->getStyleArray(['rotation' => $pValue]);
|
$styleArray = $this->getStyleArray(['rotation' => $pValue]);
|
||||||
|
|
|
@ -178,9 +178,8 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Font
|
* @return Font
|
||||||
*/
|
*/
|
||||||
public function applyFromArray($pStyles = null)
|
public function applyFromArray(array $pStyles)
|
||||||
{
|
{
|
||||||
if (is_array($pStyles)) {
|
|
||||||
if ($this->isSupervisor) {
|
if ($this->isSupervisor) {
|
||||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
|
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
|
||||||
} else {
|
} else {
|
||||||
|
@ -212,9 +211,6 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
$this->setSize($pStyles['size']);
|
$this->setSize($pStyles['size']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid style array passed.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -240,7 +236,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Font
|
* @return Font
|
||||||
*/
|
*/
|
||||||
public function setName($pValue = 'Calibri')
|
public function setName($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue == '') {
|
if ($pValue == '') {
|
||||||
$pValue = 'Calibri';
|
$pValue = 'Calibri';
|
||||||
|
@ -276,7 +272,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Font
|
* @return Font
|
||||||
*/
|
*/
|
||||||
public function setSize($pValue = 10)
|
public function setSize($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue == '') {
|
if ($pValue == '') {
|
||||||
$pValue = 10;
|
$pValue = 10;
|
||||||
|
@ -312,7 +308,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Font
|
* @return Font
|
||||||
*/
|
*/
|
||||||
public function setBold($pValue = false)
|
public function setBold($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue == '') {
|
if ($pValue == '') {
|
||||||
$pValue = false;
|
$pValue = false;
|
||||||
|
@ -348,7 +344,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Font
|
* @return Font
|
||||||
*/
|
*/
|
||||||
public function setItalic($pValue = false)
|
public function setItalic($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue == '') {
|
if ($pValue == '') {
|
||||||
$pValue = false;
|
$pValue = false;
|
||||||
|
@ -384,7 +380,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Font
|
* @return Font
|
||||||
*/
|
*/
|
||||||
public function setSuperScript($pValue = false)
|
public function setSuperScript($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue == '') {
|
if ($pValue == '') {
|
||||||
$pValue = false;
|
$pValue = false;
|
||||||
|
@ -421,7 +417,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Font
|
* @return Font
|
||||||
*/
|
*/
|
||||||
public function setSubScript($pValue = false)
|
public function setSubScript($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue == '') {
|
if ($pValue == '') {
|
||||||
$pValue = false;
|
$pValue = false;
|
||||||
|
@ -460,7 +456,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Font
|
* @return Font
|
||||||
*/
|
*/
|
||||||
public function setUnderline($pValue = self::UNDERLINE_NONE)
|
public function setUnderline($pValue)
|
||||||
{
|
{
|
||||||
if (is_bool($pValue)) {
|
if (is_bool($pValue)) {
|
||||||
$pValue = ($pValue) ? self::UNDERLINE_SINGLE : self::UNDERLINE_NONE;
|
$pValue = ($pValue) ? self::UNDERLINE_SINGLE : self::UNDERLINE_NONE;
|
||||||
|
@ -498,7 +494,7 @@ class Font extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Font
|
* @return Font
|
||||||
*/
|
*/
|
||||||
public function setStrikethrough($pValue = false)
|
public function setStrikethrough($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue == '') {
|
if ($pValue == '') {
|
||||||
$pValue = false;
|
$pValue = false;
|
||||||
|
|
|
@ -155,9 +155,8 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
|
||||||
*
|
*
|
||||||
* @return NumberFormat
|
* @return NumberFormat
|
||||||
*/
|
*/
|
||||||
public function applyFromArray($pStyles = null)
|
public function applyFromArray(array $pStyles)
|
||||||
{
|
{
|
||||||
if (is_array($pStyles)) {
|
|
||||||
if ($this->isSupervisor) {
|
if ($this->isSupervisor) {
|
||||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
|
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
|
||||||
} else {
|
} else {
|
||||||
|
@ -165,9 +164,6 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
|
||||||
$this->setFormatCode($pStyles['code']);
|
$this->setFormatCode($pStyles['code']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid style array passed.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -192,11 +188,11 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
|
||||||
/**
|
/**
|
||||||
* Set Format Code.
|
* Set Format Code.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $pValue see self::FORMAT_*
|
||||||
*
|
*
|
||||||
* @return NumberFormat
|
* @return NumberFormat
|
||||||
*/
|
*/
|
||||||
public function setFormatCode($pValue = self::FORMAT_GENERAL)
|
public function setFormatCode($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue == '') {
|
if ($pValue == '') {
|
||||||
$pValue = self::FORMAT_GENERAL;
|
$pValue = self::FORMAT_GENERAL;
|
||||||
|
@ -233,7 +229,7 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
|
||||||
*
|
*
|
||||||
* @return NumberFormat
|
* @return NumberFormat
|
||||||
*/
|
*/
|
||||||
public function setBuiltInFormatCode($pValue = 0)
|
public function setBuiltInFormatCode($pValue)
|
||||||
{
|
{
|
||||||
if ($this->isSupervisor) {
|
if ($this->isSupervisor) {
|
||||||
$styleArray = $this->getStyleArray(['code' => self::builtInFormatCode($pValue)]);
|
$styleArray = $this->getStyleArray(['code' => self::builtInFormatCode($pValue)]);
|
||||||
|
@ -588,12 +584,12 @@ class NumberFormat extends Supervisor implements \PhpOffice\PhpSpreadsheet\IComp
|
||||||
* Convert a value in a pre-defined format to a PHP string.
|
* Convert a value in a pre-defined format to a PHP string.
|
||||||
*
|
*
|
||||||
* @param mixed $value Value to format
|
* @param mixed $value Value to format
|
||||||
* @param string $format Format code
|
* @param string $format Format code, see = self::FORMAT_*
|
||||||
* @param array $callBack Callback function for additional formatting of string
|
* @param array $callBack Callback function for additional formatting of string
|
||||||
*
|
*
|
||||||
* @return string Formatted string
|
* @return string Formatted string
|
||||||
*/
|
*/
|
||||||
public static function toFormattedString($value = '0', $format = self::FORMAT_GENERAL, $callBack = null)
|
public static function toFormattedString($value, $format, $callBack = null)
|
||||||
{
|
{
|
||||||
// For now we do not treat strings although section 4 of a format code affects strings
|
// For now we do not treat strings although section 4 of a format code affects strings
|
||||||
if (!is_numeric($value)) {
|
if (!is_numeric($value)) {
|
||||||
|
|
|
@ -108,9 +108,8 @@ class Protection extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompar
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function applyFromArray($pStyles = null)
|
public function applyFromArray(array $pStyles)
|
||||||
{
|
{
|
||||||
if (is_array($pStyles)) {
|
|
||||||
if ($this->isSupervisor) {
|
if ($this->isSupervisor) {
|
||||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
|
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
|
||||||
} else {
|
} else {
|
||||||
|
@ -121,9 +120,6 @@ class Protection extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompar
|
||||||
$this->setHidden($pStyles['hidden']);
|
$this->setHidden($pStyles['hidden']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid style array passed.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -145,11 +141,11 @@ class Protection extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompar
|
||||||
/**
|
/**
|
||||||
* Set locked.
|
* Set locked.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $pValue see self::PROTECTION_*
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setLocked($pValue = self::PROTECTION_INHERIT)
|
public function setLocked($pValue)
|
||||||
{
|
{
|
||||||
if ($this->isSupervisor) {
|
if ($this->isSupervisor) {
|
||||||
$styleArray = $this->getStyleArray(['locked' => $pValue]);
|
$styleArray = $this->getStyleArray(['locked' => $pValue]);
|
||||||
|
@ -178,11 +174,11 @@ class Protection extends Supervisor implements \PhpOffice\PhpSpreadsheet\ICompar
|
||||||
/**
|
/**
|
||||||
* Set hidden.
|
* Set hidden.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $pValue see self::PROTECTION_*
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setHidden($pValue = self::PROTECTION_INHERIT)
|
public function setHidden($pValue)
|
||||||
{
|
{
|
||||||
if ($this->isSupervisor) {
|
if ($this->isSupervisor) {
|
||||||
$styleArray = $this->getStyleArray(['hidden' => $pValue]);
|
$styleArray = $this->getStyleArray(['hidden' => $pValue]);
|
||||||
|
|
|
@ -582,7 +582,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return false|Chart
|
* @return false|Chart
|
||||||
*/
|
*/
|
||||||
public function getChartByIndex($index = null)
|
public function getChartByIndex($index)
|
||||||
{
|
{
|
||||||
$chartCount = count($this->chartCollection);
|
$chartCount = count($this->chartCollection);
|
||||||
if ($chartCount == 0) {
|
if ($chartCount == 0) {
|
||||||
|
@ -624,7 +624,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return false|Chart
|
* @return false|Chart
|
||||||
*/
|
*/
|
||||||
public function getChartByName($chartName = '')
|
public function getChartByName($chartName)
|
||||||
{
|
{
|
||||||
$chartCount = count($this->chartCollection);
|
$chartCount = count($this->chartCollection);
|
||||||
if ($chartCount == 0) {
|
if ($chartCount == 0) {
|
||||||
|
@ -833,7 +833,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setTitle($pValue = 'Worksheet', $updateFormulaCellReferences = true)
|
public function setTitle($pValue, $updateFormulaCellReferences = true)
|
||||||
{
|
{
|
||||||
// Is this a 'rename' or not?
|
// Is this a 'rename' or not?
|
||||||
if ($this->getTitle() == $pValue) {
|
if ($this->getTitle() == $pValue) {
|
||||||
|
@ -908,7 +908,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setSheetState($value = self::SHEETSTATE_VISIBLE)
|
public function setSheetState($value)
|
||||||
{
|
{
|
||||||
$this->sheetState = $value;
|
$this->sheetState = $value;
|
||||||
|
|
||||||
|
@ -1109,17 +1109,16 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Set a cell value.
|
* Set a cell value.
|
||||||
*
|
*
|
||||||
* @param string $pCoordinate Coordinate of the cell
|
* @param string $pCoordinate Coordinate of the cell, eg: 'A1'
|
||||||
* @param mixed $pValue Value of the cell
|
* @param mixed $pValue Value of the cell
|
||||||
* @param bool $returnCell Return the worksheet (false, default) or the cell (true)
|
|
||||||
*
|
*
|
||||||
* @return Worksheet|Cell Depending on the last parameter being specified
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setCellValue($pCoordinate = 'A1', $pValue = null, $returnCell = false)
|
public function setCellValue($pCoordinate, $pValue)
|
||||||
{
|
{
|
||||||
$cell = $this->getCell(strtoupper($pCoordinate))->setValue($pValue);
|
$this->getCell($pCoordinate)->setValue($pValue);
|
||||||
|
|
||||||
return ($returnCell) ? $cell : $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1128,57 +1127,55 @@ class Worksheet implements IComparable
|
||||||
* @param int $pColumn Numeric column coordinate of the cell (A = 0)
|
* @param int $pColumn Numeric column coordinate of the cell (A = 0)
|
||||||
* @param int $pRow Numeric row coordinate of the cell
|
* @param int $pRow Numeric row coordinate of the cell
|
||||||
* @param mixed $pValue Value of the cell
|
* @param mixed $pValue Value of the cell
|
||||||
* @param bool $returnCell Return the worksheet (false, default) or the cell (true)
|
|
||||||
*
|
*
|
||||||
* @return Worksheet|Cell Depending on the last parameter being specified
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setCellValueByColumnAndRow($pColumn = 0, $pRow = 1, $pValue = null, $returnCell = false)
|
public function setCellValueByColumnAndRow($pColumn, $pRow, $pValue)
|
||||||
{
|
{
|
||||||
$cell = $this->getCellByColumnAndRow($pColumn, $pRow)->setValue($pValue);
|
$this->getCellByColumnAndRow($pColumn, $pRow)->setValue($pValue);
|
||||||
|
|
||||||
return ($returnCell) ? $cell : $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a cell value.
|
* Set a cell value.
|
||||||
*
|
*
|
||||||
* @param string $pCoordinate Coordinate of the cell
|
* @param string $pCoordinate Coordinate of the cell, eg: 'A1'
|
||||||
* @param mixed $pValue Value of the cell
|
* @param mixed $pValue Value of the cell
|
||||||
* @param string $pDataType Explicit data type
|
* @param string $pDataType Explicit data type, see Cell\DataType::TYPE_*
|
||||||
* @param bool $returnCell Return the worksheet (false, default) or the cell (true)
|
|
||||||
*
|
*
|
||||||
* @return Worksheet|Cell Depending on the last parameter being specified
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setCellValueExplicit($pCoordinate = 'A1', $pValue = null, $pDataType = Cell\DataType::TYPE_STRING, $returnCell = false)
|
public function setCellValueExplicit($pCoordinate, $pValue, $pDataType)
|
||||||
{
|
{
|
||||||
// Set value
|
// Set value
|
||||||
$cell = $this->getCell(strtoupper($pCoordinate))->setValueExplicit($pValue, $pDataType);
|
$this->getCell($pCoordinate)->setValueExplicit($pValue, $pDataType);
|
||||||
|
|
||||||
return ($returnCell) ? $cell : $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a cell value by using numeric cell coordinates.
|
* Set a cell value by using numeric cell coordinates.
|
||||||
*
|
*
|
||||||
* @param int $pColumn Numeric column coordinate of the cell
|
* @param int $pColumn Numeric column coordinate of the cell (A = 0)
|
||||||
* @param int $pRow Numeric row coordinate of the cell
|
* @param int $pRow Numeric row coordinate of the cell
|
||||||
* @param mixed $pValue Value of the cell
|
* @param mixed $pValue Value of the cell
|
||||||
* @param string $pDataType Explicit data type
|
* @param string $pDataType Explicit data type, see Cell\DataType::TYPE_*
|
||||||
* @param bool $returnCell Return the worksheet (false, default) or the cell (true)
|
* @param bool $returnCell Return the worksheet (false, default) or the cell (true)
|
||||||
*
|
*
|
||||||
* @return Worksheet|Cell Depending on the last parameter being specified
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setCellValueExplicitByColumnAndRow($pColumn = 0, $pRow = 1, $pValue = null, $pDataType = Cell\DataType::TYPE_STRING, $returnCell = false)
|
public function setCellValueExplicitByColumnAndRow($pColumn, $pRow, $pValue, $pDataType)
|
||||||
{
|
{
|
||||||
$cell = $this->getCellByColumnAndRow($pColumn, $pRow)->setValueExplicit($pValue, $pDataType);
|
$this->getCellByColumnAndRow($pColumn, $pRow)->setValueExplicit($pValue, $pDataType);
|
||||||
|
|
||||||
return ($returnCell) ? $cell : $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get cell at a specific coordinate.
|
* Get cell at a specific coordinate.
|
||||||
*
|
*
|
||||||
* @param string $pCoordinate Coordinate of the cell
|
* @param string $pCoordinate Coordinate of the cell, eg: 'A1'
|
||||||
* @param bool $createIfNotExists Flag indicating whether a new cell should be created if it doesn't
|
* @param bool $createIfNotExists Flag indicating whether a new cell should be created if it doesn't
|
||||||
* already exist, or a null should be returned instead
|
* already exist, or a null should be returned instead
|
||||||
*
|
*
|
||||||
|
@ -1186,7 +1183,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return null|Cell Cell that was found/created or null
|
* @return null|Cell Cell that was found/created or null
|
||||||
*/
|
*/
|
||||||
public function getCell($pCoordinate = 'A1', $createIfNotExists = true)
|
public function getCell($pCoordinate, $createIfNotExists = true)
|
||||||
{
|
{
|
||||||
// Check cell collection
|
// Check cell collection
|
||||||
if ($this->cellCollection->has(strtoupper($pCoordinate))) {
|
if ($this->cellCollection->has(strtoupper($pCoordinate))) {
|
||||||
|
@ -1234,7 +1231,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return null|Cell Cell that was found/created or null
|
* @return null|Cell Cell that was found/created or null
|
||||||
*/
|
*/
|
||||||
public function getCellByColumnAndRow($pColumn = 0, $pRow = 1, $createIfNotExists = true)
|
public function getCellByColumnAndRow($pColumn, $pRow, $createIfNotExists = true)
|
||||||
{
|
{
|
||||||
$columnLetter = Cell::stringFromColumnIndex($pColumn);
|
$columnLetter = Cell::stringFromColumnIndex($pColumn);
|
||||||
$coordinate = $columnLetter . $pRow;
|
$coordinate = $columnLetter . $pRow;
|
||||||
|
@ -1286,13 +1283,13 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Does the cell at a specific coordinate exist?
|
* Does the cell at a specific coordinate exist?
|
||||||
*
|
*
|
||||||
* @param string $pCoordinate Coordinate of the cell
|
* @param string $pCoordinate Coordinate of the cell eg: 'A1'
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function cellExists($pCoordinate = 'A1')
|
public function cellExists($pCoordinate)
|
||||||
{
|
{
|
||||||
// Worksheet reference?
|
// Worksheet reference?
|
||||||
if (strpos($pCoordinate, '!') !== false) {
|
if (strpos($pCoordinate, '!') !== false) {
|
||||||
|
@ -1336,12 +1333,12 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Cell at a specific coordinate by using numeric cell coordinates exists?
|
* Cell at a specific coordinate by using numeric cell coordinates exists?
|
||||||
*
|
*
|
||||||
* @param string $pColumn Numeric column coordinate of the cell
|
* @param string $pColumn Numeric column coordinate of the cell (A = 0)
|
||||||
* @param string $pRow Numeric row coordinate of the cell
|
* @param string $pRow Numeric row coordinate of the cell
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function cellExistsByColumnAndRow($pColumn = 0, $pRow = 1)
|
public function cellExistsByColumnAndRow($pColumn, $pRow)
|
||||||
{
|
{
|
||||||
return $this->cellExists(Cell::stringFromColumnIndex($pColumn) . $pRow);
|
return $this->cellExists(Cell::stringFromColumnIndex($pColumn) . $pRow);
|
||||||
}
|
}
|
||||||
|
@ -1354,7 +1351,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet\RowDimension
|
* @return Worksheet\RowDimension
|
||||||
*/
|
*/
|
||||||
public function getRowDimension($pRow = 1, $create = true)
|
public function getRowDimension($pRow, $create = true)
|
||||||
{
|
{
|
||||||
// Found
|
// Found
|
||||||
$found = null;
|
$found = null;
|
||||||
|
@ -1375,12 +1372,12 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Get column dimension at a specific column.
|
* Get column dimension at a specific column.
|
||||||
*
|
*
|
||||||
* @param string $pColumn String index of the column
|
* @param string $pColumn String index of the column eg: 'A'
|
||||||
* @param mixed $create
|
* @param mixed $create
|
||||||
*
|
*
|
||||||
* @return Worksheet\ColumnDimension
|
* @return Worksheet\ColumnDimension
|
||||||
*/
|
*/
|
||||||
public function getColumnDimension($pColumn = 'A', $create = true)
|
public function getColumnDimension($pColumn, $create = true)
|
||||||
{
|
{
|
||||||
// Uppercase coordinate
|
// Uppercase coordinate
|
||||||
$pColumn = strtoupper($pColumn);
|
$pColumn = strtoupper($pColumn);
|
||||||
|
@ -1403,11 +1400,11 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Get column dimension at a specific column by using numeric cell coordinates.
|
* Get column dimension at a specific column by using numeric cell coordinates.
|
||||||
*
|
*
|
||||||
* @param int $pColumn Numeric column coordinate of the cell
|
* @param int $pColumn Numeric column coordinate of the cell (A = 0)
|
||||||
*
|
*
|
||||||
* @return Worksheet\ColumnDimension
|
* @return Worksheet\ColumnDimension
|
||||||
*/
|
*/
|
||||||
public function getColumnDimensionByColumn($pColumn = 0)
|
public function getColumnDimensionByColumn($pColumn)
|
||||||
{
|
{
|
||||||
return $this->getColumnDimension(Cell::stringFromColumnIndex($pColumn));
|
return $this->getColumnDimension(Cell::stringFromColumnIndex($pColumn));
|
||||||
}
|
}
|
||||||
|
@ -1425,13 +1422,13 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Get style for cell.
|
* Get style for cell.
|
||||||
*
|
*
|
||||||
* @param string $pCellCoordinate Cell coordinate (or range) to get style for
|
* @param string $pCellCoordinate Cell coordinate (or range) to get style for, eg: 'A1'
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @return Style
|
* @return Style
|
||||||
*/
|
*/
|
||||||
public function getStyle($pCellCoordinate = 'A1')
|
public function getStyle($pCellCoordinate)
|
||||||
{
|
{
|
||||||
// set this sheet as active
|
// set this sheet as active
|
||||||
$this->parent->setActiveSheetIndex($this->parent->getIndex($this));
|
$this->parent->setActiveSheetIndex($this->parent->getIndex($this));
|
||||||
|
@ -1445,11 +1442,11 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Get conditional styles for a cell.
|
* Get conditional styles for a cell.
|
||||||
*
|
*
|
||||||
* @param string $pCoordinate
|
* @param string $pCoordinate eg: 'A1'
|
||||||
*
|
*
|
||||||
* @return Style\Conditional[]
|
* @return Style\Conditional[]
|
||||||
*/
|
*/
|
||||||
public function getConditionalStyles($pCoordinate = 'A1')
|
public function getConditionalStyles($pCoordinate)
|
||||||
{
|
{
|
||||||
$pCoordinate = strtoupper($pCoordinate);
|
$pCoordinate = strtoupper($pCoordinate);
|
||||||
if (!isset($this->conditionalStylesCollection[$pCoordinate])) {
|
if (!isset($this->conditionalStylesCollection[$pCoordinate])) {
|
||||||
|
@ -1462,11 +1459,11 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Do conditional styles exist for this cell?
|
* Do conditional styles exist for this cell?
|
||||||
*
|
*
|
||||||
* @param string $pCoordinate
|
* @param string $pCoordinate eg: 'A1'
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function conditionalStylesExists($pCoordinate = 'A1')
|
public function conditionalStylesExists($pCoordinate)
|
||||||
{
|
{
|
||||||
if (isset($this->conditionalStylesCollection[strtoupper($pCoordinate)])) {
|
if (isset($this->conditionalStylesCollection[strtoupper($pCoordinate)])) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -1478,11 +1475,11 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Removes conditional styles for a cell.
|
* Removes conditional styles for a cell.
|
||||||
*
|
*
|
||||||
* @param string $pCoordinate
|
* @param string $pCoordinate eg: 'A1'
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function removeConditionalStyles($pCoordinate = 'A1')
|
public function removeConditionalStyles($pCoordinate)
|
||||||
{
|
{
|
||||||
unset($this->conditionalStylesCollection[strtoupper($pCoordinate)]);
|
unset($this->conditionalStylesCollection[strtoupper($pCoordinate)]);
|
||||||
|
|
||||||
|
@ -1517,16 +1514,16 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Get style for cell by using numeric cell coordinates.
|
* Get style for cell by using numeric cell coordinates.
|
||||||
*
|
*
|
||||||
* @param int $pColumn Numeric column coordinate of the cell
|
* @param int $pColumn Numeric column coordinate of the cell (A = 0)
|
||||||
* @param int $pRow Numeric row coordinate of the cell
|
* @param int $pRow Numeric row coordinate of the cell
|
||||||
* @param int pColumn2 Numeric column coordinate of the range cell
|
* @param int pColumn2 Numeric column coordinate of the range cell (A = 0)
|
||||||
* @param int pRow2 Numeric row coordinate of the range cell
|
* @param int pRow2 Numeric row coordinate of the range cell
|
||||||
* @param null|mixed $pColumn2
|
* @param null|mixed $pColumn2
|
||||||
* @param null|mixed $pRow2
|
* @param null|mixed $pRow2
|
||||||
*
|
*
|
||||||
* @return Style
|
* @return Style
|
||||||
*/
|
*/
|
||||||
public function getStyleByColumnAndRow($pColumn = 0, $pRow = 1, $pColumn2 = null, $pRow2 = null)
|
public function getStyleByColumnAndRow($pColumn, $pRow, $pColumn2 = null, $pRow2 = null)
|
||||||
{
|
{
|
||||||
if (!is_null($pColumn2) && !is_null($pRow2)) {
|
if (!is_null($pColumn2) && !is_null($pRow2)) {
|
||||||
$cellRange = Cell::stringFromColumnIndex($pColumn) . $pRow . ':' . Cell::stringFromColumnIndex($pColumn2) . $pRow2;
|
$cellRange = Cell::stringFromColumnIndex($pColumn) . $pRow . ':' . Cell::stringFromColumnIndex($pColumn2) . $pRow2;
|
||||||
|
@ -1628,25 +1625,25 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Set break on a cell.
|
* Set break on a cell.
|
||||||
*
|
*
|
||||||
* @param string $pCell Cell coordinate (e.g. A1)
|
* @param string $pCoordinate Cell coordinate (e.g. A1)
|
||||||
* @param int $pBreak Break type (type of Worksheet::BREAK_*)
|
* @param int $pBreak Break type (type of Worksheet::BREAK_*)
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setBreak($pCell = 'A1', $pBreak = self::BREAK_NONE)
|
public function setBreak($pCoordinate, $pBreak)
|
||||||
{
|
{
|
||||||
// Uppercase coordinate
|
// Uppercase coordinate
|
||||||
$pCell = strtoupper($pCell);
|
$pCoordinate = strtoupper($pCoordinate);
|
||||||
|
|
||||||
if ($pCell != '') {
|
if ($pCoordinate != '') {
|
||||||
if ($pBreak == self::BREAK_NONE) {
|
if ($pBreak == self::BREAK_NONE) {
|
||||||
if (isset($this->breaks[$pCell])) {
|
if (isset($this->breaks[$pCoordinate])) {
|
||||||
unset($this->breaks[$pCell]);
|
unset($this->breaks[$pCoordinate]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->breaks[$pCell] = $pBreak;
|
$this->breaks[$pCoordinate] = $pBreak;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Exception('No cell coordinate specified.');
|
throw new Exception('No cell coordinate specified.');
|
||||||
|
@ -1658,13 +1655,13 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Set break on a cell by using numeric cell coordinates.
|
* Set break on a cell by using numeric cell coordinates.
|
||||||
*
|
*
|
||||||
* @param int $pColumn Numeric column coordinate of the cell
|
* @param int $pColumn Numeric column coordinate of the cell (A = 0)
|
||||||
* @param int $pRow Numeric row coordinate of the cell
|
* @param int $pRow Numeric row coordinate of the cell
|
||||||
* @param int $pBreak Break type (type of \PhpOffice\PhpSpreadsheet\Worksheet::BREAK_*)
|
* @param int $pBreak Break type (type of \PhpOffice\PhpSpreadsheet\Worksheet::BREAK_*)
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setBreakByColumnAndRow($pColumn = 0, $pRow = 1, $pBreak = self::BREAK_NONE)
|
public function setBreakByColumnAndRow($pColumn, $pRow, $pBreak)
|
||||||
{
|
{
|
||||||
return $this->setBreak(Cell::stringFromColumnIndex($pColumn) . $pRow, $pBreak);
|
return $this->setBreak(Cell::stringFromColumnIndex($pColumn) . $pRow, $pBreak);
|
||||||
}
|
}
|
||||||
|
@ -1688,7 +1685,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function mergeCells($pRange = 'A1:A1')
|
public function mergeCells($pRange)
|
||||||
{
|
{
|
||||||
// Uppercase coordinate
|
// Uppercase coordinate
|
||||||
$pRange = strtoupper($pRange);
|
$pRange = strtoupper($pRange);
|
||||||
|
@ -1724,16 +1721,16 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Set merge on a cell range by using numeric cell coordinates.
|
* Set merge on a cell range by using numeric cell coordinates.
|
||||||
*
|
*
|
||||||
* @param int $pColumn1 Numeric column coordinate of the first cell
|
* @param int $pColumn1 Numeric column coordinate of the first cell (A = 0)
|
||||||
* @param int $pRow1 Numeric row coordinate of the first cell
|
* @param int $pRow1 Numeric row coordinate of the first cell
|
||||||
* @param int $pColumn2 Numeric column coordinate of the last cell
|
* @param int $pColumn2 Numeric column coordinate of the last cell (A = 0)
|
||||||
* @param int $pRow2 Numeric row coordinate of the last cell
|
* @param int $pRow2 Numeric row coordinate of the last cell
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function mergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1)
|
public function mergeCellsByColumnAndRow($pColumn1, $pRow1, $pColumn2, $pRow2)
|
||||||
{
|
{
|
||||||
$cellRange = Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . Cell::stringFromColumnIndex($pColumn2) . $pRow2;
|
$cellRange = Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . Cell::stringFromColumnIndex($pColumn2) . $pRow2;
|
||||||
|
|
||||||
|
@ -1749,7 +1746,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function unmergeCells($pRange = 'A1:A1')
|
public function unmergeCells($pRange)
|
||||||
{
|
{
|
||||||
// Uppercase coordinate
|
// Uppercase coordinate
|
||||||
$pRange = strtoupper($pRange);
|
$pRange = strtoupper($pRange);
|
||||||
|
@ -1770,16 +1767,16 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Remove merge on a cell range by using numeric cell coordinates.
|
* Remove merge on a cell range by using numeric cell coordinates.
|
||||||
*
|
*
|
||||||
* @param int $pColumn1 Numeric column coordinate of the first cell
|
* @param int $pColumn1 Numeric column coordinate of the first cell (A = 0)
|
||||||
* @param int $pRow1 Numeric row coordinate of the first cell
|
* @param int $pRow1 Numeric row coordinate of the first cell
|
||||||
* @param int $pColumn2 Numeric column coordinate of the last cell
|
* @param int $pColumn2 Numeric column coordinate of the last cell (A = 0)
|
||||||
* @param int $pRow2 Numeric row coordinate of the last cell
|
* @param int $pRow2 Numeric row coordinate of the last cell
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function unmergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1)
|
public function unmergeCellsByColumnAndRow($pColumn1, $pRow1, $pColumn2, $pRow2)
|
||||||
{
|
{
|
||||||
$cellRange = Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . Cell::stringFromColumnIndex($pColumn2) . $pRow2;
|
$cellRange = Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . Cell::stringFromColumnIndex($pColumn2) . $pRow2;
|
||||||
|
|
||||||
|
@ -1803,7 +1800,7 @@ class Worksheet implements IComparable
|
||||||
* @param array
|
* @param array
|
||||||
* @param mixed $pValue
|
* @param mixed $pValue
|
||||||
*/
|
*/
|
||||||
public function setMergeCells($pValue = [])
|
public function setMergeCells(array $pValue)
|
||||||
{
|
{
|
||||||
$this->mergeCells = $pValue;
|
$this->mergeCells = $pValue;
|
||||||
|
|
||||||
|
@ -1821,7 +1818,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function protectCells($pRange = 'A1', $pPassword = '', $pAlreadyHashed = false)
|
public function protectCells($pRange, $pPassword, $pAlreadyHashed = false)
|
||||||
{
|
{
|
||||||
// Uppercase coordinate
|
// Uppercase coordinate
|
||||||
$pRange = strtoupper($pRange);
|
$pRange = strtoupper($pRange);
|
||||||
|
@ -1837,9 +1834,9 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Set protection on a cell range by using numeric cell coordinates.
|
* Set protection on a cell range by using numeric cell coordinates.
|
||||||
*
|
*
|
||||||
* @param int $pColumn1 Numeric column coordinate of the first cell
|
* @param int $pColumn1 Numeric column coordinate of the first cell (A = 0)
|
||||||
* @param int $pRow1 Numeric row coordinate of the first cell
|
* @param int $pRow1 Numeric row coordinate of the first cell
|
||||||
* @param int $pColumn2 Numeric column coordinate of the last cell
|
* @param int $pColumn2 Numeric column coordinate of the last cell (A = 0)
|
||||||
* @param int $pRow2 Numeric row coordinate of the last cell
|
* @param int $pRow2 Numeric row coordinate of the last cell
|
||||||
* @param string $pPassword Password to unlock the protection
|
* @param string $pPassword Password to unlock the protection
|
||||||
* @param bool $pAlreadyHashed If the password has already been hashed, set this to true
|
* @param bool $pAlreadyHashed If the password has already been hashed, set this to true
|
||||||
|
@ -1848,7 +1845,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function protectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false)
|
public function protectCellsByColumnAndRow($pColumn1, $pRow1, $pColumn2, $pRow2, $pPassword, $pAlreadyHashed = false)
|
||||||
{
|
{
|
||||||
$cellRange = Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . Cell::stringFromColumnIndex($pColumn2) . $pRow2;
|
$cellRange = Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . Cell::stringFromColumnIndex($pColumn2) . $pRow2;
|
||||||
|
|
||||||
|
@ -1864,7 +1861,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function unprotectCells($pRange = 'A1')
|
public function unprotectCells($pRange)
|
||||||
{
|
{
|
||||||
// Uppercase coordinate
|
// Uppercase coordinate
|
||||||
$pRange = strtoupper($pRange);
|
$pRange = strtoupper($pRange);
|
||||||
|
@ -1881,9 +1878,9 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Remove protection on a cell range by using numeric cell coordinates.
|
* Remove protection on a cell range by using numeric cell coordinates.
|
||||||
*
|
*
|
||||||
* @param int $pColumn1 Numeric column coordinate of the first cell
|
* @param int $pColumn1 Numeric column coordinate of the first cell (A = 0)
|
||||||
* @param int $pRow1 Numeric row coordinate of the first cell
|
* @param int $pRow1 Numeric row coordinate of the first cell
|
||||||
* @param int $pColumn2 Numeric column coordinate of the last cell
|
* @param int $pColumn2 Numeric column coordinate of the last cell (A = 0)
|
||||||
* @param int $pRow2 Numeric row coordinate of the last cell
|
* @param int $pRow2 Numeric row coordinate of the last cell
|
||||||
* @param string $pPassword Password to unlock the protection
|
* @param string $pPassword Password to unlock the protection
|
||||||
* @param bool $pAlreadyHashed If the password has already been hashed, set this to true
|
* @param bool $pAlreadyHashed If the password has already been hashed, set this to true
|
||||||
|
@ -1892,7 +1889,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function unprotectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false)
|
public function unprotectCellsByColumnAndRow($pColumn1, $pRow1, $pColumn2, $pRow2, $pPassword, $pAlreadyHashed = false)
|
||||||
{
|
{
|
||||||
$cellRange = Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . Cell::stringFromColumnIndex($pColumn2) . $pRow2;
|
$cellRange = Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . Cell::stringFromColumnIndex($pColumn2) . $pRow2;
|
||||||
|
|
||||||
|
@ -1944,16 +1941,16 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Set Autofilter Range by using numeric cell coordinates.
|
* Set Autofilter Range by using numeric cell coordinates.
|
||||||
*
|
*
|
||||||
* @param int $pColumn1 Numeric column coordinate of the first cell
|
* @param int $pColumn1 Numeric column coordinate of the first cell (A = 0)
|
||||||
* @param int $pRow1 Numeric row coordinate of the first cell
|
* @param int $pRow1 Numeric row coordinate of the first cell
|
||||||
* @param int $pColumn2 Numeric column coordinate of the second cell
|
* @param int $pColumn2 Numeric column coordinate of the second cell (A = 0)
|
||||||
* @param int $pRow2 Numeric row coordinate of the second cell
|
* @param int $pRow2 Numeric row coordinate of the second cell
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setAutoFilterByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1)
|
public function setAutoFilterByColumnAndRow($pColumn1, $pRow1, $pColumn2, $pRow2)
|
||||||
{
|
{
|
||||||
return $this->setAutoFilter(
|
return $this->setAutoFilter(
|
||||||
Cell::stringFromColumnIndex($pColumn1) . $pRow1
|
Cell::stringFromColumnIndex($pColumn1) . $pRow1
|
||||||
|
@ -1998,7 +1995,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function freezePane($pCell = '')
|
public function freezePane($pCell)
|
||||||
{
|
{
|
||||||
// Uppercase coordinate
|
// Uppercase coordinate
|
||||||
$pCell = strtoupper($pCell);
|
$pCell = strtoupper($pCell);
|
||||||
|
@ -2014,14 +2011,14 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Freeze Pane by using numeric cell coordinates.
|
* Freeze Pane by using numeric cell coordinates.
|
||||||
*
|
*
|
||||||
* @param int $pColumn Numeric column coordinate of the cell
|
* @param int $pColumn Numeric column coordinate of the cell (A = 0)
|
||||||
* @param int $pRow Numeric row coordinate of the cell
|
* @param int $pRow Numeric row coordinate of the cell
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function freezePaneByColumnAndRow($pColumn = 0, $pRow = 1)
|
public function freezePaneByColumnAndRow($pColumn, $pRow)
|
||||||
{
|
{
|
||||||
return $this->freezePane(Cell::stringFromColumnIndex($pColumn) . $pRow);
|
return $this->freezePane(Cell::stringFromColumnIndex($pColumn) . $pRow);
|
||||||
}
|
}
|
||||||
|
@ -2046,7 +2043,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function insertNewRowBefore($pBefore = 1, $pNumRows = 1)
|
public function insertNewRowBefore($pBefore, $pNumRows = 1)
|
||||||
{
|
{
|
||||||
if ($pBefore >= 1) {
|
if ($pBefore >= 1) {
|
||||||
$objReferenceHelper = ReferenceHelper::getInstance();
|
$objReferenceHelper = ReferenceHelper::getInstance();
|
||||||
|
@ -2061,14 +2058,14 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Insert a new column, updating all possible related data.
|
* Insert a new column, updating all possible related data.
|
||||||
*
|
*
|
||||||
* @param int $pBefore Insert before this one
|
* @param int $pBefore Insert before this one, eg: 'A'
|
||||||
* @param int $pNumCols Number of columns to insert
|
* @param int $pNumCols Number of columns to insert
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function insertNewColumnBefore($pBefore = 'A', $pNumCols = 1)
|
public function insertNewColumnBefore($pBefore, $pNumCols = 1)
|
||||||
{
|
{
|
||||||
if (!is_numeric($pBefore)) {
|
if (!is_numeric($pBefore)) {
|
||||||
$objReferenceHelper = ReferenceHelper::getInstance();
|
$objReferenceHelper = ReferenceHelper::getInstance();
|
||||||
|
@ -2083,14 +2080,14 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Insert a new column, updating all possible related data.
|
* Insert a new column, updating all possible related data.
|
||||||
*
|
*
|
||||||
* @param int $pBefore Insert before this one (numeric column coordinate of the cell)
|
* @param int $pBefore Insert before this one (numeric column coordinate of the cell, A = 0)
|
||||||
* @param int $pNumCols Number of columns to insert
|
* @param int $pNumCols Number of columns to insert
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function insertNewColumnBeforeByIndex($pBefore = 0, $pNumCols = 1)
|
public function insertNewColumnBeforeByIndex($pBefore, $pNumCols = 1)
|
||||||
{
|
{
|
||||||
if ($pBefore >= 0) {
|
if ($pBefore >= 0) {
|
||||||
return $this->insertNewColumnBefore(Cell::stringFromColumnIndex($pBefore), $pNumCols);
|
return $this->insertNewColumnBefore(Cell::stringFromColumnIndex($pBefore), $pNumCols);
|
||||||
|
@ -2108,7 +2105,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function removeRow($pRow = 1, $pNumRows = 1)
|
public function removeRow($pRow, $pNumRows = 1)
|
||||||
{
|
{
|
||||||
if ($pRow >= 1) {
|
if ($pRow >= 1) {
|
||||||
$highestRow = $this->getHighestDataRow();
|
$highestRow = $this->getHighestDataRow();
|
||||||
|
@ -2128,14 +2125,14 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Remove a column, updating all possible related data.
|
* Remove a column, updating all possible related data.
|
||||||
*
|
*
|
||||||
* @param string $pColumn Remove starting with this one
|
* @param string $pColumn Remove starting with this one, eg: 'A'
|
||||||
* @param int $pNumCols Number of columns to remove
|
* @param int $pNumCols Number of columns to remove
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function removeColumn($pColumn = 'A', $pNumCols = 1)
|
public function removeColumn($pColumn, $pNumCols = 1)
|
||||||
{
|
{
|
||||||
if (!is_numeric($pColumn)) {
|
if (!is_numeric($pColumn)) {
|
||||||
$highestColumn = $this->getHighestDataColumn();
|
$highestColumn = $this->getHighestDataColumn();
|
||||||
|
@ -2156,14 +2153,14 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Remove a column, updating all possible related data.
|
* Remove a column, updating all possible related data.
|
||||||
*
|
*
|
||||||
* @param int $pColumn Remove starting with this one (numeric column coordinate of the cell)
|
* @param int $pColumn Remove starting with this one (numeric column coordinate of the cell A = 0)
|
||||||
* @param int $pNumCols Number of columns to remove
|
* @param int $pNumCols Number of columns to remove
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function removeColumnByIndex($pColumn = 0, $pNumCols = 1)
|
public function removeColumnByIndex($pColumn, $pNumCols = 1)
|
||||||
{
|
{
|
||||||
if ($pColumn >= 0) {
|
if ($pColumn >= 0) {
|
||||||
return $this->removeColumn(Cell::stringFromColumnIndex($pColumn), $pNumCols);
|
return $this->removeColumn(Cell::stringFromColumnIndex($pColumn), $pNumCols);
|
||||||
|
@ -2188,7 +2185,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setShowGridlines($pValue = false)
|
public function setShowGridlines($pValue)
|
||||||
{
|
{
|
||||||
$this->showGridlines = $pValue;
|
$this->showGridlines = $pValue;
|
||||||
|
|
||||||
|
@ -2212,7 +2209,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setPrintGridlines($pValue = false)
|
public function setPrintGridlines($pValue)
|
||||||
{
|
{
|
||||||
$this->printGridlines = $pValue;
|
$this->printGridlines = $pValue;
|
||||||
|
|
||||||
|
@ -2236,7 +2233,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setShowRowColHeaders($pValue = false)
|
public function setShowRowColHeaders($pValue)
|
||||||
{
|
{
|
||||||
$this->showRowColHeaders = $pValue;
|
$this->showRowColHeaders = $pValue;
|
||||||
|
|
||||||
|
@ -2260,7 +2257,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setShowSummaryBelow($pValue = true)
|
public function setShowSummaryBelow($pValue)
|
||||||
{
|
{
|
||||||
$this->showSummaryBelow = $pValue;
|
$this->showSummaryBelow = $pValue;
|
||||||
|
|
||||||
|
@ -2284,7 +2281,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setShowSummaryRight($pValue = true)
|
public function setShowSummaryRight($pValue)
|
||||||
{
|
{
|
||||||
$this->showSummaryRight = $pValue;
|
$this->showSummaryRight = $pValue;
|
||||||
|
|
||||||
|
@ -2309,7 +2306,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setComments($pValue = [])
|
public function setComments(array $pValue)
|
||||||
{
|
{
|
||||||
$this->comments = $pValue;
|
$this->comments = $pValue;
|
||||||
|
|
||||||
|
@ -2319,13 +2316,13 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Get comment for cell.
|
* Get comment for cell.
|
||||||
*
|
*
|
||||||
* @param string $pCellCoordinate Cell coordinate to get comment for
|
* @param string $pCellCoordinate Cell coordinate to get comment for, eg: 'A1'
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @return Comment
|
* @return Comment
|
||||||
*/
|
*/
|
||||||
public function getComment($pCellCoordinate = 'A1')
|
public function getComment($pCellCoordinate)
|
||||||
{
|
{
|
||||||
// Uppercase coordinate
|
// Uppercase coordinate
|
||||||
$pCellCoordinate = strtoupper($pCellCoordinate);
|
$pCellCoordinate = strtoupper($pCellCoordinate);
|
||||||
|
@ -2353,12 +2350,12 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Get comment for cell by using numeric cell coordinates.
|
* Get comment for cell by using numeric cell coordinates.
|
||||||
*
|
*
|
||||||
* @param int $pColumn Numeric column coordinate of the cell
|
* @param int $pColumn Numeric column coordinate of the cell (A = 0)
|
||||||
* @param int $pRow Numeric row coordinate of the cell
|
* @param int $pRow Numeric row coordinate of the cell
|
||||||
*
|
*
|
||||||
* @return Comment
|
* @return Comment
|
||||||
*/
|
*/
|
||||||
public function getCommentByColumnAndRow($pColumn = 0, $pRow = 1)
|
public function getCommentByColumnAndRow($pColumn, $pRow)
|
||||||
{
|
{
|
||||||
return $this->getComment(Cell::stringFromColumnIndex($pColumn) . $pRow);
|
return $this->getComment(Cell::stringFromColumnIndex($pColumn) . $pRow);
|
||||||
}
|
}
|
||||||
|
@ -2390,7 +2387,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setSelectedCell($pCoordinate = 'A1')
|
public function setSelectedCell($pCoordinate)
|
||||||
{
|
{
|
||||||
return $this->setSelectedCells($pCoordinate);
|
return $this->setSelectedCells($pCoordinate);
|
||||||
}
|
}
|
||||||
|
@ -2404,7 +2401,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setSelectedCells($pCoordinate = 'A1')
|
public function setSelectedCells($pCoordinate)
|
||||||
{
|
{
|
||||||
// Uppercase coordinate
|
// Uppercase coordinate
|
||||||
$pCoordinate = strtoupper($pCoordinate);
|
$pCoordinate = strtoupper($pCoordinate);
|
||||||
|
@ -2435,14 +2432,14 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Selected cell by using numeric cell coordinates.
|
* Selected cell by using numeric cell coordinates.
|
||||||
*
|
*
|
||||||
* @param int $pColumn Numeric column coordinate of the cell
|
* @param int $pColumn Numeric column coordinate of the cell (A = 0)
|
||||||
* @param int $pRow Numeric row coordinate of the cell
|
* @param int $pRow Numeric row coordinate of the cell
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setSelectedCellByColumnAndRow($pColumn = 0, $pRow = 1)
|
public function setSelectedCellByColumnAndRow($pColumn, $pRow)
|
||||||
{
|
{
|
||||||
return $this->setSelectedCells(Cell::stringFromColumnIndex($pColumn) . $pRow);
|
return $this->setSelectedCells(Cell::stringFromColumnIndex($pColumn) . $pRow);
|
||||||
}
|
}
|
||||||
|
@ -2464,7 +2461,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setRightToLeft($value = false)
|
public function setRightToLeft($value)
|
||||||
{
|
{
|
||||||
$this->rightToLeft = $value;
|
$this->rightToLeft = $value;
|
||||||
|
|
||||||
|
@ -2483,9 +2480,8 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function fromArray($source = null, $nullValue = null, $startCell = 'A1', $strictNullComparison = false)
|
public function fromArray(array $source, $nullValue = null, $startCell = 'A1', $strictNullComparison = false)
|
||||||
{
|
{
|
||||||
if (is_array($source)) {
|
|
||||||
// Convert a 1-D array to 2-D (for ease of looping)
|
// Convert a 1-D array to 2-D (for ease of looping)
|
||||||
if (!is_array(end($source))) {
|
if (!is_array(end($source))) {
|
||||||
$source = [$source];
|
$source = [$source];
|
||||||
|
@ -2513,9 +2509,6 @@ class Worksheet implements IComparable
|
||||||
}
|
}
|
||||||
++$startRow;
|
++$startRow;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
throw new Exception('Parameter $source should be an array.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -2532,7 +2525,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function rangeToArray($pRange = 'A1', $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false)
|
public function rangeToArray($pRange, $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false)
|
||||||
{
|
{
|
||||||
// Returnvalue
|
// Returnvalue
|
||||||
$returnValue = [];
|
$returnValue = [];
|
||||||
|
@ -2604,7 +2597,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function namedRangeToArray($pNamedRange = '', $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false)
|
public function namedRangeToArray($pNamedRange, $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false)
|
||||||
{
|
{
|
||||||
$namedRange = NamedRange::resolveRange($pNamedRange, $this);
|
$namedRange = NamedRange::resolveRange($pNamedRange, $this);
|
||||||
if ($namedRange !== null) {
|
if ($namedRange !== null) {
|
||||||
|
@ -2746,9 +2739,9 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Get hyperlink.
|
* Get hyperlink.
|
||||||
*
|
*
|
||||||
* @param string $pCellCoordinate Cell coordinate to get hyperlink for
|
* @param string $pCellCoordinate Cell coordinate to get hyperlink for, eg: 'A1'
|
||||||
*/
|
*/
|
||||||
public function getHyperlink($pCellCoordinate = 'A1')
|
public function getHyperlink($pCellCoordinate)
|
||||||
{
|
{
|
||||||
// return hyperlink if we already have one
|
// return hyperlink if we already have one
|
||||||
if (isset($this->hyperlinkCollection[$pCellCoordinate])) {
|
if (isset($this->hyperlinkCollection[$pCellCoordinate])) {
|
||||||
|
@ -2762,14 +2755,14 @@ class Worksheet implements IComparable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set hyperlnk.
|
* Set hyperlink.
|
||||||
*
|
*
|
||||||
* @param string $pCellCoordinate Cell coordinate to insert hyperlink
|
* @param string $pCellCoordinate Cell coordinate to insert hyperlink, eg: 'A1'
|
||||||
* @param Cell\Hyperlink $pHyperlink
|
* @param Cell\Hyperlink|null $pHyperlink
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setHyperlink($pCellCoordinate = 'A1', Cell\Hyperlink $pHyperlink = null)
|
public function setHyperlink($pCellCoordinate, Cell\Hyperlink $pHyperlink = null)
|
||||||
{
|
{
|
||||||
if ($pHyperlink === null) {
|
if ($pHyperlink === null) {
|
||||||
unset($this->hyperlinkCollection[$pCellCoordinate]);
|
unset($this->hyperlinkCollection[$pCellCoordinate]);
|
||||||
|
@ -2783,11 +2776,11 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Hyperlink at a specific coordinate exists?
|
* Hyperlink at a specific coordinate exists?
|
||||||
*
|
*
|
||||||
* @param string $pCoordinate
|
* @param string $pCoordinate eg: 'A1'
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function hyperlinkExists($pCoordinate = 'A1')
|
public function hyperlinkExists($pCoordinate)
|
||||||
{
|
{
|
||||||
return isset($this->hyperlinkCollection[$pCoordinate]);
|
return isset($this->hyperlinkCollection[$pCoordinate]);
|
||||||
}
|
}
|
||||||
|
@ -2805,9 +2798,9 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Get data validation.
|
* Get data validation.
|
||||||
*
|
*
|
||||||
* @param string $pCellCoordinate Cell coordinate to get data validation for
|
* @param string $pCellCoordinate Cell coordinate to get data validation for, eg: 'A1'
|
||||||
*/
|
*/
|
||||||
public function getDataValidation($pCellCoordinate = 'A1')
|
public function getDataValidation($pCellCoordinate)
|
||||||
{
|
{
|
||||||
// return data validation if we already have one
|
// return data validation if we already have one
|
||||||
if (isset($this->dataValidationCollection[$pCellCoordinate])) {
|
if (isset($this->dataValidationCollection[$pCellCoordinate])) {
|
||||||
|
@ -2823,12 +2816,12 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Set data validation.
|
* Set data validation.
|
||||||
*
|
*
|
||||||
* @param string $pCellCoordinate Cell coordinate to insert data validation
|
* @param string $pCellCoordinate Cell coordinate to insert data validation, eg: 'A1'
|
||||||
* @param Cell\DataValidation $pDataValidation
|
* @param Cell\DataValidation|null $pDataValidation
|
||||||
*
|
*
|
||||||
* @return Worksheet
|
* @return Worksheet
|
||||||
*/
|
*/
|
||||||
public function setDataValidation($pCellCoordinate = 'A1', Cell\DataValidation $pDataValidation = null)
|
public function setDataValidation($pCellCoordinate, Cell\DataValidation $pDataValidation = null)
|
||||||
{
|
{
|
||||||
if ($pDataValidation === null) {
|
if ($pDataValidation === null) {
|
||||||
unset($this->dataValidationCollection[$pCellCoordinate]);
|
unset($this->dataValidationCollection[$pCellCoordinate]);
|
||||||
|
@ -2842,11 +2835,11 @@ class Worksheet implements IComparable
|
||||||
/**
|
/**
|
||||||
* Data validation at a specific coordinate exists?
|
* Data validation at a specific coordinate exists?
|
||||||
*
|
*
|
||||||
* @param string $pCoordinate
|
* @param string $pCoordinate eg: 'A1'
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function dataValidationExists($pCoordinate = 'A1')
|
public function dataValidationExists($pCoordinate)
|
||||||
{
|
{
|
||||||
return isset($this->dataValidationCollection[$pCoordinate]);
|
return isset($this->dataValidationCollection[$pCoordinate]);
|
||||||
}
|
}
|
||||||
|
@ -2990,7 +2983,7 @@ class Worksheet implements IComparable
|
||||||
*
|
*
|
||||||
* @return objWorksheet
|
* @return objWorksheet
|
||||||
*/
|
*/
|
||||||
public function setCodeName($pValue = null)
|
public function setCodeName($pValue)
|
||||||
{
|
{
|
||||||
// Is this a 'rename' or not?
|
// Is this a 'rename' or not?
|
||||||
if ($this->getCodeName() == $pValue) {
|
if ($this->getCodeName() == $pValue) {
|
||||||
|
|
|
@ -102,7 +102,7 @@ class AutoFilter
|
||||||
*
|
*
|
||||||
* @return AutoFilter
|
* @return AutoFilter
|
||||||
*/
|
*/
|
||||||
public function setRange($pRange = '')
|
public function setRange($pRange)
|
||||||
{
|
{
|
||||||
// Uppercase coordinate
|
// Uppercase coordinate
|
||||||
$cellAddress = explode('!', strtoupper($pRange));
|
$cellAddress = explode('!', strtoupper($pRange));
|
||||||
|
@ -214,7 +214,7 @@ class AutoFilter
|
||||||
*
|
*
|
||||||
* @return AutoFilter\Column
|
* @return AutoFilter\Column
|
||||||
*/
|
*/
|
||||||
public function getColumnByOffset($pColumnOffset = 0)
|
public function getColumnByOffset($pColumnOffset)
|
||||||
{
|
{
|
||||||
list($rangeStart, $rangeEnd) = \PhpOffice\PhpSpreadsheet\Cell::rangeBoundaries($this->range);
|
list($rangeStart, $rangeEnd) = \PhpOffice\PhpSpreadsheet\Cell::rangeBoundaries($this->range);
|
||||||
$pColumn = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($rangeStart[0] + $pColumnOffset - 1);
|
$pColumn = \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($rangeStart[0] + $pColumnOffset - 1);
|
||||||
|
@ -278,7 +278,7 @@ class AutoFilter
|
||||||
* Shift an AutoFilter Column Rule to a different column.
|
* Shift an AutoFilter Column Rule to a different column.
|
||||||
*
|
*
|
||||||
* Note: This method bypasses validation of the destination column to ensure it is within this AutoFilter range.
|
* Note: This method bypasses validation of the destination column to ensure it is within this AutoFilter range.
|
||||||
* Nor does it verify whether any column rule already exists at $toColumn, but will simply overrideany existing value.
|
* Nor does it verify whether any column rule already exists at $toColumn, but will simply override any existing value.
|
||||||
* Use with caution.
|
* Use with caution.
|
||||||
*
|
*
|
||||||
* @param string $fromColumn Column name (e.g. A)
|
* @param string $fromColumn Column name (e.g. A)
|
||||||
|
@ -286,7 +286,7 @@ class AutoFilter
|
||||||
*
|
*
|
||||||
* @return AutoFilter
|
* @return AutoFilter
|
||||||
*/
|
*/
|
||||||
public function shiftColumn($fromColumn = null, $toColumn = null)
|
public function shiftColumn($fromColumn, $toColumn)
|
||||||
{
|
{
|
||||||
$fromColumn = strtoupper($fromColumn);
|
$fromColumn = strtoupper($fromColumn);
|
||||||
$toColumn = strtoupper($toColumn);
|
$toColumn = strtoupper($toColumn);
|
||||||
|
|
|
@ -194,7 +194,7 @@ class Column
|
||||||
*
|
*
|
||||||
* @return Column
|
* @return Column
|
||||||
*/
|
*/
|
||||||
public function setFilterType($pFilterType = self::AUTOFILTER_FILTERTYPE_FILTER)
|
public function setFilterType($pFilterType)
|
||||||
{
|
{
|
||||||
if (!in_array($pFilterType, self::$filterTypes)) {
|
if (!in_array($pFilterType, self::$filterTypes)) {
|
||||||
throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid filter type for column AutoFilter.');
|
throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid filter type for column AutoFilter.');
|
||||||
|
@ -224,7 +224,7 @@ class Column
|
||||||
*
|
*
|
||||||
* @return Column
|
* @return Column
|
||||||
*/
|
*/
|
||||||
public function setJoin($pJoin = self::AUTOFILTER_COLUMN_JOIN_OR)
|
public function setJoin($pJoin)
|
||||||
{
|
{
|
||||||
// Lowercase And/Or
|
// Lowercase And/Or
|
||||||
$pJoin = strtolower($pJoin);
|
$pJoin = strtolower($pJoin);
|
||||||
|
@ -240,15 +240,15 @@ class Column
|
||||||
/**
|
/**
|
||||||
* Set AutoFilter Attributes.
|
* Set AutoFilter Attributes.
|
||||||
*
|
*
|
||||||
* @param string[] $pAttributes
|
* @param string[] $attributes
|
||||||
*
|
*
|
||||||
* @throws \PhpOffice\PhpSpreadsheet\Exception
|
* @throws \PhpOffice\PhpSpreadsheet\Exception
|
||||||
*
|
*
|
||||||
* @return Column
|
* @return Column
|
||||||
*/
|
*/
|
||||||
public function setAttributes($pAttributes = [])
|
public function setAttributes(array $attributes)
|
||||||
{
|
{
|
||||||
$this->attributes = $pAttributes;
|
$this->attributes = $attributes;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -273,7 +273,7 @@ class Column
|
||||||
/**
|
/**
|
||||||
* Get AutoFilter Column Attributes.
|
* Get AutoFilter Column Attributes.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string[]
|
||||||
*/
|
*/
|
||||||
public function getAttributes()
|
public function getAttributes()
|
||||||
{
|
{
|
||||||
|
@ -340,16 +340,15 @@ class Column
|
||||||
* Add a new AutoFilter Column Rule to the ruleset.
|
* Add a new AutoFilter Column Rule to the ruleset.
|
||||||
*
|
*
|
||||||
* @param Column\Rule $pRule
|
* @param Column\Rule $pRule
|
||||||
* @param bool $returnRule Flag indicating whether the rule object or the column object should be returned
|
|
||||||
*
|
*
|
||||||
* @return Column|Column\Rule
|
* @return Column
|
||||||
*/
|
*/
|
||||||
public function addRule(Column\Rule $pRule, $returnRule = true)
|
public function addRule(Column\Rule $pRule)
|
||||||
{
|
{
|
||||||
$pRule->setParent($this);
|
$pRule->setParent($this);
|
||||||
$this->ruleset[] = $pRule;
|
$this->ruleset[] = $pRule;
|
||||||
|
|
||||||
return ($returnRule) ? $pRule : $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -277,13 +277,13 @@ class Rule
|
||||||
/**
|
/**
|
||||||
* Set AutoFilter Rule Type.
|
* Set AutoFilter Rule Type.
|
||||||
*
|
*
|
||||||
* @param string $pRuleType
|
* @param string $pRuleType see self::AUTOFILTER_RULETYPE_*
|
||||||
*
|
*
|
||||||
* @throws \PhpOffice\PhpSpreadsheet\Exception
|
* @throws \PhpOffice\PhpSpreadsheet\Exception
|
||||||
*
|
*
|
||||||
* @return Rule
|
* @return Rule
|
||||||
*/
|
*/
|
||||||
public function setRuleType($pRuleType = self::AUTOFILTER_RULETYPE_FILTER)
|
public function setRuleType($pRuleType)
|
||||||
{
|
{
|
||||||
if (!in_array($pRuleType, self::$ruleTypes)) {
|
if (!in_array($pRuleType, self::$ruleTypes)) {
|
||||||
throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid rule type for column AutoFilter Rule.');
|
throw new \PhpOffice\PhpSpreadsheet\Exception('Invalid rule type for column AutoFilter Rule.');
|
||||||
|
@ -313,7 +313,7 @@ class Rule
|
||||||
*
|
*
|
||||||
* @return Rule
|
* @return Rule
|
||||||
*/
|
*/
|
||||||
public function setValue($pValue = '')
|
public function setValue($pValue)
|
||||||
{
|
{
|
||||||
if (is_array($pValue)) {
|
if (is_array($pValue)) {
|
||||||
$grouping = -1;
|
$grouping = -1;
|
||||||
|
@ -351,13 +351,13 @@ class Rule
|
||||||
/**
|
/**
|
||||||
* Set AutoFilter Rule Operator.
|
* Set AutoFilter Rule Operator.
|
||||||
*
|
*
|
||||||
* @param string $pOperator
|
* @param string $pOperator see self::AUTOFILTER_COLUMN_RULE_*
|
||||||
*
|
*
|
||||||
* @throws \PhpOffice\PhpSpreadsheet\Exception
|
* @throws \PhpOffice\PhpSpreadsheet\Exception
|
||||||
*
|
*
|
||||||
* @return Rule
|
* @return Rule
|
||||||
*/
|
*/
|
||||||
public function setOperator($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL)
|
public function setOperator($pOperator)
|
||||||
{
|
{
|
||||||
if (empty($pOperator)) {
|
if (empty($pOperator)) {
|
||||||
$pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL;
|
$pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL;
|
||||||
|
@ -390,7 +390,7 @@ class Rule
|
||||||
*
|
*
|
||||||
* @return Rule
|
* @return Rule
|
||||||
*/
|
*/
|
||||||
public function setGrouping($pGrouping = null)
|
public function setGrouping($pGrouping)
|
||||||
{
|
{
|
||||||
if (($pGrouping !== null) &&
|
if (($pGrouping !== null) &&
|
||||||
(!in_array($pGrouping, self::$dateTimeGroups)) &&
|
(!in_array($pGrouping, self::$dateTimeGroups)) &&
|
||||||
|
@ -406,7 +406,7 @@ class Rule
|
||||||
/**
|
/**
|
||||||
* Set AutoFilter Rule.
|
* Set AutoFilter Rule.
|
||||||
*
|
*
|
||||||
* @param string $pOperator
|
* @param string $pOperator see self::AUTOFILTER_COLUMN_RULE_*
|
||||||
* @param string|string[] $pValue
|
* @param string|string[] $pValue
|
||||||
* @param string $pGrouping
|
* @param string $pGrouping
|
||||||
*
|
*
|
||||||
|
@ -414,7 +414,7 @@ class Rule
|
||||||
*
|
*
|
||||||
* @return Rule
|
* @return Rule
|
||||||
*/
|
*/
|
||||||
public function setRule($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL, $pValue = '', $pGrouping = null)
|
public function setRule($pOperator, $pValue, $pGrouping = null)
|
||||||
{
|
{
|
||||||
$this->setOperator($pOperator);
|
$this->setOperator($pOperator);
|
||||||
$this->setValue($pValue);
|
$this->setValue($pValue);
|
||||||
|
|
|
@ -166,7 +166,7 @@ class BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return BaseDrawing
|
* @return BaseDrawing
|
||||||
*/
|
*/
|
||||||
public function setName($pValue = '')
|
public function setName($pValue)
|
||||||
{
|
{
|
||||||
$this->name = $pValue;
|
$this->name = $pValue;
|
||||||
|
|
||||||
|
@ -186,13 +186,13 @@ class BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
/**
|
/**
|
||||||
* Set Description.
|
* Set Description.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $description
|
||||||
*
|
*
|
||||||
* @return BaseDrawing
|
* @return BaseDrawing
|
||||||
*/
|
*/
|
||||||
public function setDescription($pValue = '')
|
public function setDescription($description)
|
||||||
{
|
{
|
||||||
$this->description = $pValue;
|
$this->description = $description;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -260,11 +260,11 @@ class BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
/**
|
/**
|
||||||
* Set Coordinates.
|
* Set Coordinates.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $pValue eg: 'A1'
|
||||||
*
|
*
|
||||||
* @return BaseDrawing
|
* @return BaseDrawing
|
||||||
*/
|
*/
|
||||||
public function setCoordinates($pValue = 'A1')
|
public function setCoordinates($pValue)
|
||||||
{
|
{
|
||||||
$this->coordinates = $pValue;
|
$this->coordinates = $pValue;
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ class BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return BaseDrawing
|
* @return BaseDrawing
|
||||||
*/
|
*/
|
||||||
public function setOffsetX($pValue = 0)
|
public function setOffsetX($pValue)
|
||||||
{
|
{
|
||||||
$this->offsetX = $pValue;
|
$this->offsetX = $pValue;
|
||||||
|
|
||||||
|
@ -312,7 +312,7 @@ class BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return BaseDrawing
|
* @return BaseDrawing
|
||||||
*/
|
*/
|
||||||
public function setOffsetY($pValue = 0)
|
public function setOffsetY($pValue)
|
||||||
{
|
{
|
||||||
$this->offsetY = $pValue;
|
$this->offsetY = $pValue;
|
||||||
|
|
||||||
|
@ -336,7 +336,7 @@ class BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return BaseDrawing
|
* @return BaseDrawing
|
||||||
*/
|
*/
|
||||||
public function setWidth($pValue = 0)
|
public function setWidth($pValue)
|
||||||
{
|
{
|
||||||
// Resize proportional?
|
// Resize proportional?
|
||||||
if ($this->resizeProportional && $pValue != 0) {
|
if ($this->resizeProportional && $pValue != 0) {
|
||||||
|
@ -367,7 +367,7 @@ class BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return BaseDrawing
|
* @return BaseDrawing
|
||||||
*/
|
*/
|
||||||
public function setHeight($pValue = 0)
|
public function setHeight($pValue)
|
||||||
{
|
{
|
||||||
// Resize proportional?
|
// Resize proportional?
|
||||||
if ($this->resizeProportional && $pValue != 0) {
|
if ($this->resizeProportional && $pValue != 0) {
|
||||||
|
@ -396,7 +396,7 @@ class BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return BaseDrawing
|
* @return BaseDrawing
|
||||||
*/
|
*/
|
||||||
public function setWidthAndHeight($width = 0, $height = 0)
|
public function setWidthAndHeight($width, $height)
|
||||||
{
|
{
|
||||||
$xratio = $width / ($this->width != 0 ? $this->width : 1);
|
$xratio = $width / ($this->width != 0 ? $this->width : 1);
|
||||||
$yratio = $height / ($this->height != 0 ? $this->height : 1);
|
$yratio = $height / ($this->height != 0 ? $this->height : 1);
|
||||||
|
@ -433,7 +433,7 @@ class BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return BaseDrawing
|
* @return BaseDrawing
|
||||||
*/
|
*/
|
||||||
public function setResizeProportional($pValue = true)
|
public function setResizeProportional($pValue)
|
||||||
{
|
{
|
||||||
$this->resizeProportional = $pValue;
|
$this->resizeProportional = $pValue;
|
||||||
|
|
||||||
|
@ -457,7 +457,7 @@ class BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return BaseDrawing
|
* @return BaseDrawing
|
||||||
*/
|
*/
|
||||||
public function setRotation($pValue = 0)
|
public function setRotation($pValue)
|
||||||
{
|
{
|
||||||
$this->rotation = $pValue;
|
$this->rotation = $pValue;
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ abstract class CellIterator
|
||||||
*
|
*
|
||||||
* @throws \PhpOffice\PhpSpreadsheet\Exception
|
* @throws \PhpOffice\PhpSpreadsheet\Exception
|
||||||
*/
|
*/
|
||||||
public function setIterateOnlyExistingCells($value = true)
|
public function setIterateOnlyExistingCells($value)
|
||||||
{
|
{
|
||||||
$this->onlyExistingCells = (bool) $value;
|
$this->onlyExistingCells = (bool) $value;
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ class ColumnDimension extends Dimension
|
||||||
*
|
*
|
||||||
* @return ColumnDimension
|
* @return ColumnDimension
|
||||||
*/
|
*/
|
||||||
public function setWidth($pValue = -1)
|
public function setWidth($pValue)
|
||||||
{
|
{
|
||||||
$this->width = $pValue;
|
$this->width = $pValue;
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ class ColumnDimension extends Dimension
|
||||||
*
|
*
|
||||||
* @return ColumnDimension
|
* @return ColumnDimension
|
||||||
*/
|
*/
|
||||||
public function setAutoSize($pValue = false)
|
public function setAutoSize($pValue)
|
||||||
{
|
{
|
||||||
$this->autoSize = $pValue;
|
$this->autoSize = $pValue;
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ abstract class Dimension
|
||||||
*
|
*
|
||||||
* @return Dimension
|
* @return Dimension
|
||||||
*/
|
*/
|
||||||
public function setVisible($pValue = true)
|
public function setVisible($pValue)
|
||||||
{
|
{
|
||||||
$this->visible = $pValue;
|
$this->visible = $pValue;
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ abstract class Dimension
|
||||||
*
|
*
|
||||||
* @return Dimension
|
* @return Dimension
|
||||||
*/
|
*/
|
||||||
public function setCollapsed($pValue = true)
|
public function setCollapsed($pValue)
|
||||||
{
|
{
|
||||||
$this->collapsed = $pValue;
|
$this->collapsed = $pValue;
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ abstract class Dimension
|
||||||
*
|
*
|
||||||
* @return Dimension
|
* @return Dimension
|
||||||
*/
|
*/
|
||||||
public function setXfIndex($pValue = 0)
|
public function setXfIndex($pValue)
|
||||||
{
|
{
|
||||||
$this->xfIndex = $pValue;
|
$this->xfIndex = $pValue;
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ class Drawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\IComparab
|
||||||
*
|
*
|
||||||
* @return Drawing
|
* @return Drawing
|
||||||
*/
|
*/
|
||||||
public function setPath($pValue = '', $pVerifyFile = true)
|
public function setPath($pValue, $pVerifyFile = true)
|
||||||
{
|
{
|
||||||
if ($pVerifyFile) {
|
if ($pVerifyFile) {
|
||||||
if (file_exists($pValue)) {
|
if (file_exists($pValue)) {
|
||||||
|
|
|
@ -121,7 +121,7 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Shadow
|
* @return Shadow
|
||||||
*/
|
*/
|
||||||
public function setVisible($pValue = false)
|
public function setVisible($pValue)
|
||||||
{
|
{
|
||||||
$this->visible = $pValue;
|
$this->visible = $pValue;
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Shadow
|
* @return Shadow
|
||||||
*/
|
*/
|
||||||
public function setBlurRadius($pValue = 6)
|
public function setBlurRadius($pValue)
|
||||||
{
|
{
|
||||||
$this->blurRadius = $pValue;
|
$this->blurRadius = $pValue;
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Shadow
|
* @return Shadow
|
||||||
*/
|
*/
|
||||||
public function setDistance($pValue = 2)
|
public function setDistance($pValue)
|
||||||
{
|
{
|
||||||
$this->distance = $pValue;
|
$this->distance = $pValue;
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Shadow
|
* @return Shadow
|
||||||
*/
|
*/
|
||||||
public function setDirection($pValue = 0)
|
public function setDirection($pValue)
|
||||||
{
|
{
|
||||||
$this->direction = $pValue;
|
$this->direction = $pValue;
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Shadow
|
* @return Shadow
|
||||||
*/
|
*/
|
||||||
public function setAlignment($pValue = 0)
|
public function setAlignment($pValue)
|
||||||
{
|
{
|
||||||
$this->alignment = $pValue;
|
$this->alignment = $pValue;
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ class Shadow implements \PhpOffice\PhpSpreadsheet\IComparable
|
||||||
*
|
*
|
||||||
* @return Shadow
|
* @return Shadow
|
||||||
*/
|
*/
|
||||||
public function setAlpha($pValue = 0)
|
public function setAlpha($pValue)
|
||||||
{
|
{
|
||||||
$this->alpha = $pValue;
|
$this->alpha = $pValue;
|
||||||
|
|
||||||
|
|
|
@ -339,7 +339,7 @@ class HeaderFooter
|
||||||
*
|
*
|
||||||
* @return HeaderFooter
|
* @return HeaderFooter
|
||||||
*/
|
*/
|
||||||
public function setDifferentOddEven($pValue = false)
|
public function setDifferentOddEven($pValue)
|
||||||
{
|
{
|
||||||
$this->differentOddEven = $pValue;
|
$this->differentOddEven = $pValue;
|
||||||
|
|
||||||
|
@ -363,7 +363,7 @@ class HeaderFooter
|
||||||
*
|
*
|
||||||
* @return HeaderFooter
|
* @return HeaderFooter
|
||||||
*/
|
*/
|
||||||
public function setDifferentFirst($pValue = false)
|
public function setDifferentFirst($pValue)
|
||||||
{
|
{
|
||||||
$this->differentFirst = $pValue;
|
$this->differentFirst = $pValue;
|
||||||
|
|
||||||
|
@ -387,7 +387,7 @@ class HeaderFooter
|
||||||
*
|
*
|
||||||
* @return HeaderFooter
|
* @return HeaderFooter
|
||||||
*/
|
*/
|
||||||
public function setScaleWithDocument($pValue = true)
|
public function setScaleWithDocument($pValue)
|
||||||
{
|
{
|
||||||
$this->scaleWithDocument = $pValue;
|
$this->scaleWithDocument = $pValue;
|
||||||
|
|
||||||
|
@ -411,7 +411,7 @@ class HeaderFooter
|
||||||
*
|
*
|
||||||
* @return HeaderFooter
|
* @return HeaderFooter
|
||||||
*/
|
*/
|
||||||
public function setAlignWithMargins($pValue = true)
|
public function setAlignWithMargins($pValue)
|
||||||
{
|
{
|
||||||
$this->alignWithMargins = $pValue;
|
$this->alignWithMargins = $pValue;
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
|
||||||
*
|
*
|
||||||
* @return HeaderFooterDrawing
|
* @return HeaderFooterDrawing
|
||||||
*/
|
*/
|
||||||
public function setName($pValue = '')
|
public function setName($pValue)
|
||||||
{
|
{
|
||||||
$this->name = $pValue;
|
$this->name = $pValue;
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
|
||||||
*
|
*
|
||||||
* @return HeaderFooterDrawing
|
* @return HeaderFooterDrawing
|
||||||
*/
|
*/
|
||||||
public function setOffsetX($pValue = 0)
|
public function setOffsetX($pValue)
|
||||||
{
|
{
|
||||||
$this->offsetX = $pValue;
|
$this->offsetX = $pValue;
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
|
||||||
*
|
*
|
||||||
* @return HeaderFooterDrawing
|
* @return HeaderFooterDrawing
|
||||||
*/
|
*/
|
||||||
public function setOffsetY($pValue = 0)
|
public function setOffsetY($pValue)
|
||||||
{
|
{
|
||||||
$this->offsetY = $pValue;
|
$this->offsetY = $pValue;
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
|
||||||
*
|
*
|
||||||
* @return HeaderFooterDrawing
|
* @return HeaderFooterDrawing
|
||||||
*/
|
*/
|
||||||
public function setWidth($pValue = 0)
|
public function setWidth($pValue)
|
||||||
{
|
{
|
||||||
// Resize proportional?
|
// Resize proportional?
|
||||||
if ($this->resizeProportional && $pValue != 0) {
|
if ($this->resizeProportional && $pValue != 0) {
|
||||||
|
@ -210,7 +210,7 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
|
||||||
*
|
*
|
||||||
* @return HeaderFooterDrawing
|
* @return HeaderFooterDrawing
|
||||||
*/
|
*/
|
||||||
public function setHeight($pValue = 0)
|
public function setHeight($pValue)
|
||||||
{
|
{
|
||||||
// Resize proportional?
|
// Resize proportional?
|
||||||
if ($this->resizeProportional && $pValue != 0) {
|
if ($this->resizeProportional && $pValue != 0) {
|
||||||
|
@ -239,7 +239,7 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
|
||||||
*
|
*
|
||||||
* @return HeaderFooterDrawing
|
* @return HeaderFooterDrawing
|
||||||
*/
|
*/
|
||||||
public function setWidthAndHeight($width = 0, $height = 0)
|
public function setWidthAndHeight($width, $height)
|
||||||
{
|
{
|
||||||
$xratio = $width / $this->width;
|
$xratio = $width / $this->width;
|
||||||
$yratio = $height / $this->height;
|
$yratio = $height / $this->height;
|
||||||
|
@ -273,7 +273,7 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
|
||||||
*
|
*
|
||||||
* @return HeaderFooterDrawing
|
* @return HeaderFooterDrawing
|
||||||
*/
|
*/
|
||||||
public function setResizeProportional($pValue = true)
|
public function setResizeProportional($pValue)
|
||||||
{
|
{
|
||||||
$this->resizeProportional = $pValue;
|
$this->resizeProportional = $pValue;
|
||||||
|
|
||||||
|
@ -322,7 +322,7 @@ class HeaderFooterDrawing extends Drawing implements \PhpOffice\PhpSpreadsheet\I
|
||||||
*
|
*
|
||||||
* @return HeaderFooterDrawing
|
* @return HeaderFooterDrawing
|
||||||
*/
|
*/
|
||||||
public function setPath($pValue = '', $pVerifyFile = true)
|
public function setPath($pValue, $pVerifyFile = true)
|
||||||
{
|
{
|
||||||
if ($pVerifyFile) {
|
if ($pVerifyFile) {
|
||||||
if (file_exists($pValue)) {
|
if (file_exists($pValue)) {
|
||||||
|
|
|
@ -94,11 +94,11 @@ class MemoryDrawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\ICo
|
||||||
/**
|
/**
|
||||||
* Set image resource.
|
* Set image resource.
|
||||||
*
|
*
|
||||||
* @param $value resource
|
* @param resource $value
|
||||||
*
|
*
|
||||||
* @return MemoryDrawing
|
* @return MemoryDrawing
|
||||||
*/
|
*/
|
||||||
public function setImageResource($value = null)
|
public function setImageResource($value)
|
||||||
{
|
{
|
||||||
$this->imageResource = $value;
|
$this->imageResource = $value;
|
||||||
|
|
||||||
|
@ -124,11 +124,11 @@ class MemoryDrawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\ICo
|
||||||
/**
|
/**
|
||||||
* Set rendering function.
|
* Set rendering function.
|
||||||
*
|
*
|
||||||
* @param string $value
|
* @param string $value see self::RENDERING_*
|
||||||
*
|
*
|
||||||
* @return MemoryDrawing
|
* @return MemoryDrawing
|
||||||
*/
|
*/
|
||||||
public function setRenderingFunction($value = self::RENDERING_DEFAULT)
|
public function setRenderingFunction($value)
|
||||||
{
|
{
|
||||||
$this->renderingFunction = $value;
|
$this->renderingFunction = $value;
|
||||||
|
|
||||||
|
@ -148,11 +148,11 @@ class MemoryDrawing extends BaseDrawing implements \PhpOffice\PhpSpreadsheet\ICo
|
||||||
/**
|
/**
|
||||||
* Set mime type.
|
* Set mime type.
|
||||||
*
|
*
|
||||||
* @param string $value
|
* @param string $value see self::MIMETYPE_*
|
||||||
*
|
*
|
||||||
* @return MemoryDrawing
|
* @return MemoryDrawing
|
||||||
*/
|
*/
|
||||||
public function setMimeType($value = self::MIMETYPE_DEFAULT)
|
public function setMimeType($value)
|
||||||
{
|
{
|
||||||
$this->mimeType = $value;
|
$this->mimeType = $value;
|
||||||
|
|
||||||
|
|
|
@ -288,11 +288,11 @@ class PageSetup
|
||||||
/**
|
/**
|
||||||
* Set Paper Size.
|
* Set Paper Size.
|
||||||
*
|
*
|
||||||
* @param int $pValue
|
* @param int $pValue see self::PAPERSIZE_*
|
||||||
*
|
*
|
||||||
* @return PageSetup
|
* @return PageSetup
|
||||||
*/
|
*/
|
||||||
public function setPaperSize($pValue = self::PAPERSIZE_LETTER)
|
public function setPaperSize($pValue)
|
||||||
{
|
{
|
||||||
$this->paperSize = $pValue;
|
$this->paperSize = $pValue;
|
||||||
|
|
||||||
|
@ -312,11 +312,11 @@ class PageSetup
|
||||||
/**
|
/**
|
||||||
* Set Orientation.
|
* Set Orientation.
|
||||||
*
|
*
|
||||||
* @param string $pValue
|
* @param string $pValue see self::ORIENTATION_*
|
||||||
*
|
*
|
||||||
* @return PageSetup
|
* @return PageSetup
|
||||||
*/
|
*/
|
||||||
public function setOrientation($pValue = self::ORIENTATION_DEFAULT)
|
public function setOrientation($pValue)
|
||||||
{
|
{
|
||||||
$this->orientation = $pValue;
|
$this->orientation = $pValue;
|
||||||
|
|
||||||
|
@ -339,14 +339,14 @@ class PageSetup
|
||||||
* Print scaling. Valid values range from 10 to 400
|
* Print scaling. Valid values range from 10 to 400
|
||||||
* This setting is overridden when fitToWidth and/or fitToHeight are in use
|
* This setting is overridden when fitToWidth and/or fitToHeight are in use
|
||||||
*
|
*
|
||||||
* @param int? $pValue
|
* @param int|null $pValue
|
||||||
* @param bool $pUpdate Update fitToPage so scaling applies rather than fitToHeight / fitToWidth
|
* @param bool $pUpdate Update fitToPage so scaling applies rather than fitToHeight / fitToWidth
|
||||||
*
|
*
|
||||||
* @throws \PhpOffice\PhpSpreadsheet\Exception
|
* @throws \PhpOffice\PhpSpreadsheet\Exception
|
||||||
*
|
*
|
||||||
* @return PageSetup
|
* @return PageSetup
|
||||||
*/
|
*/
|
||||||
public function setScale($pValue = 100, $pUpdate = true)
|
public function setScale($pValue, $pUpdate = true)
|
||||||
{
|
{
|
||||||
// Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
|
// Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
|
||||||
// but it is apparently still able to handle any scale >= 0, where 0 results in 100
|
// but it is apparently still able to handle any scale >= 0, where 0 results in 100
|
||||||
|
@ -379,7 +379,7 @@ class PageSetup
|
||||||
*
|
*
|
||||||
* @return PageSetup
|
* @return PageSetup
|
||||||
*/
|
*/
|
||||||
public function setFitToPage($pValue = true)
|
public function setFitToPage($pValue)
|
||||||
{
|
{
|
||||||
$this->fitToPage = $pValue;
|
$this->fitToPage = $pValue;
|
||||||
|
|
||||||
|
@ -399,12 +399,12 @@ class PageSetup
|
||||||
/**
|
/**
|
||||||
* Set Fit To Height.
|
* Set Fit To Height.
|
||||||
*
|
*
|
||||||
* @param int? $pValue
|
* @param int|null $pValue
|
||||||
* @param bool $pUpdate Update fitToPage so it applies rather than scaling
|
* @param bool $pUpdate Update fitToPage so it applies rather than scaling
|
||||||
*
|
*
|
||||||
* @return PageSetup
|
* @return PageSetup
|
||||||
*/
|
*/
|
||||||
public function setFitToHeight($pValue = 1, $pUpdate = true)
|
public function setFitToHeight($pValue, $pUpdate = true)
|
||||||
{
|
{
|
||||||
$this->fitToHeight = $pValue;
|
$this->fitToHeight = $pValue;
|
||||||
if ($pUpdate) {
|
if ($pUpdate) {
|
||||||
|
@ -427,12 +427,12 @@ class PageSetup
|
||||||
/**
|
/**
|
||||||
* Set Fit To Width.
|
* Set Fit To Width.
|
||||||
*
|
*
|
||||||
* @param int? $pValue
|
* @param int|null $pValue
|
||||||
* @param bool $pUpdate Update fitToPage so it applies rather than scaling
|
* @param bool $pUpdate Update fitToPage so it applies rather than scaling
|
||||||
*
|
*
|
||||||
* @return PageSetup
|
* @return PageSetup
|
||||||
*/
|
*/
|
||||||
public function setFitToWidth($pValue = 1, $pUpdate = true)
|
public function setFitToWidth($pValue, $pUpdate = true)
|
||||||
{
|
{
|
||||||
$this->fitToWidth = $pValue;
|
$this->fitToWidth = $pValue;
|
||||||
if ($pUpdate) {
|
if ($pUpdate) {
|
||||||
|
@ -475,11 +475,9 @@ class PageSetup
|
||||||
*
|
*
|
||||||
* @return PageSetup
|
* @return PageSetup
|
||||||
*/
|
*/
|
||||||
public function setColumnsToRepeatAtLeft($pValue = null)
|
public function setColumnsToRepeatAtLeft(array $pValue)
|
||||||
{
|
{
|
||||||
if (is_array($pValue)) {
|
|
||||||
$this->columnsToRepeatAtLeft = $pValue;
|
$this->columnsToRepeatAtLeft = $pValue;
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -487,12 +485,12 @@ class PageSetup
|
||||||
/**
|
/**
|
||||||
* Set Columns to repeat at left by start and end.
|
* Set Columns to repeat at left by start and end.
|
||||||
*
|
*
|
||||||
* @param string $pStart
|
* @param string $pStart eg: 'A'
|
||||||
* @param string $pEnd
|
* @param string $pEnd eg: 'B'
|
||||||
*
|
*
|
||||||
* @return PageSetup
|
* @return PageSetup
|
||||||
*/
|
*/
|
||||||
public function setColumnsToRepeatAtLeftByStartAndEnd($pStart = 'A', $pEnd = 'A')
|
public function setColumnsToRepeatAtLeftByStartAndEnd($pStart, $pEnd)
|
||||||
{
|
{
|
||||||
$this->columnsToRepeatAtLeft = [$pStart, $pEnd];
|
$this->columnsToRepeatAtLeft = [$pStart, $pEnd];
|
||||||
|
|
||||||
|
@ -532,11 +530,9 @@ class PageSetup
|
||||||
*
|
*
|
||||||
* @return PageSetup
|
* @return PageSetup
|
||||||
*/
|
*/
|
||||||
public function setRowsToRepeatAtTop($pValue = null)
|
public function setRowsToRepeatAtTop(array $pValue)
|
||||||
{
|
{
|
||||||
if (is_array($pValue)) {
|
|
||||||
$this->rowsToRepeatAtTop = $pValue;
|
$this->rowsToRepeatAtTop = $pValue;
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -544,12 +540,12 @@ class PageSetup
|
||||||
/**
|
/**
|
||||||
* Set Rows to repeat at top by start and end.
|
* Set Rows to repeat at top by start and end.
|
||||||
*
|
*
|
||||||
* @param int $pStart
|
* @param int $pStart eg: 1
|
||||||
* @param int $pEnd
|
* @param int $pEnd eg: 1
|
||||||
*
|
*
|
||||||
* @return PageSetup
|
* @return PageSetup
|
||||||
*/
|
*/
|
||||||
public function setRowsToRepeatAtTopByStartAndEnd($pStart = 1, $pEnd = 1)
|
public function setRowsToRepeatAtTopByStartAndEnd($pStart, $pEnd)
|
||||||
{
|
{
|
||||||
$this->rowsToRepeatAtTop = [$pStart, $pEnd];
|
$this->rowsToRepeatAtTop = [$pStart, $pEnd];
|
||||||
|
|
||||||
|
@ -573,7 +569,7 @@ class PageSetup
|
||||||
*
|
*
|
||||||
* @return PageSetup
|
* @return PageSetup
|
||||||
*/
|
*/
|
||||||
public function setHorizontalCentered($value = false)
|
public function setHorizontalCentered($value)
|
||||||
{
|
{
|
||||||
$this->horizontalCentered = $value;
|
$this->horizontalCentered = $value;
|
||||||
|
|
||||||
|
@ -597,7 +593,7 @@ class PageSetup
|
||||||
*
|
*
|
||||||
* @return PageSetup
|
* @return PageSetup
|
||||||
*/
|
*/
|
||||||
public function setVerticalCentered($value = false)
|
public function setVerticalCentered($value)
|
||||||
{
|
{
|
||||||
$this->verticalCentered = $value;
|
$this->verticalCentered = $value;
|
||||||
|
|
||||||
|
@ -839,7 +835,7 @@ class PageSetup
|
||||||
*
|
*
|
||||||
* @return PageSetup
|
* @return PageSetup
|
||||||
*/
|
*/
|
||||||
public function setFirstPageNumber($value = null)
|
public function setFirstPageNumber($value)
|
||||||
{
|
{
|
||||||
$this->firstPageNumber = $value;
|
$this->firstPageNumber = $value;
|
||||||
|
|
||||||
|
|
|
@ -194,7 +194,7 @@ class Protection
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setSheet($pValue = false)
|
public function setSheet($pValue)
|
||||||
{
|
{
|
||||||
$this->sheet = $pValue;
|
$this->sheet = $pValue;
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ class Protection
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setObjects($pValue = false)
|
public function setObjects($pValue)
|
||||||
{
|
{
|
||||||
$this->objects = $pValue;
|
$this->objects = $pValue;
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ class Protection
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setScenarios($pValue = false)
|
public function setScenarios($pValue)
|
||||||
{
|
{
|
||||||
$this->scenarios = $pValue;
|
$this->scenarios = $pValue;
|
||||||
|
|
||||||
|
@ -266,7 +266,7 @@ class Protection
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setFormatCells($pValue = false)
|
public function setFormatCells($pValue)
|
||||||
{
|
{
|
||||||
$this->formatCells = $pValue;
|
$this->formatCells = $pValue;
|
||||||
|
|
||||||
|
@ -290,7 +290,7 @@ class Protection
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setFormatColumns($pValue = false)
|
public function setFormatColumns($pValue)
|
||||||
{
|
{
|
||||||
$this->formatColumns = $pValue;
|
$this->formatColumns = $pValue;
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ class Protection
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setFormatRows($pValue = false)
|
public function setFormatRows($pValue)
|
||||||
{
|
{
|
||||||
$this->formatRows = $pValue;
|
$this->formatRows = $pValue;
|
||||||
|
|
||||||
|
@ -338,7 +338,7 @@ class Protection
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setInsertColumns($pValue = false)
|
public function setInsertColumns($pValue)
|
||||||
{
|
{
|
||||||
$this->insertColumns = $pValue;
|
$this->insertColumns = $pValue;
|
||||||
|
|
||||||
|
@ -362,7 +362,7 @@ class Protection
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setInsertRows($pValue = false)
|
public function setInsertRows($pValue)
|
||||||
{
|
{
|
||||||
$this->insertRows = $pValue;
|
$this->insertRows = $pValue;
|
||||||
|
|
||||||
|
@ -386,7 +386,7 @@ class Protection
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setInsertHyperlinks($pValue = false)
|
public function setInsertHyperlinks($pValue)
|
||||||
{
|
{
|
||||||
$this->insertHyperlinks = $pValue;
|
$this->insertHyperlinks = $pValue;
|
||||||
|
|
||||||
|
@ -410,7 +410,7 @@ class Protection
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setDeleteColumns($pValue = false)
|
public function setDeleteColumns($pValue)
|
||||||
{
|
{
|
||||||
$this->deleteColumns = $pValue;
|
$this->deleteColumns = $pValue;
|
||||||
|
|
||||||
|
@ -434,7 +434,7 @@ class Protection
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setDeleteRows($pValue = false)
|
public function setDeleteRows($pValue)
|
||||||
{
|
{
|
||||||
$this->deleteRows = $pValue;
|
$this->deleteRows = $pValue;
|
||||||
|
|
||||||
|
@ -458,7 +458,7 @@ class Protection
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setSelectLockedCells($pValue = false)
|
public function setSelectLockedCells($pValue)
|
||||||
{
|
{
|
||||||
$this->selectLockedCells = $pValue;
|
$this->selectLockedCells = $pValue;
|
||||||
|
|
||||||
|
@ -482,7 +482,7 @@ class Protection
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setSort($pValue = false)
|
public function setSort($pValue)
|
||||||
{
|
{
|
||||||
$this->sort = $pValue;
|
$this->sort = $pValue;
|
||||||
|
|
||||||
|
@ -506,7 +506,7 @@ class Protection
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setAutoFilter($pValue = false)
|
public function setAutoFilter($pValue)
|
||||||
{
|
{
|
||||||
$this->autoFilter = $pValue;
|
$this->autoFilter = $pValue;
|
||||||
|
|
||||||
|
@ -530,7 +530,7 @@ class Protection
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setPivotTables($pValue = false)
|
public function setPivotTables($pValue)
|
||||||
{
|
{
|
||||||
$this->pivotTables = $pValue;
|
$this->pivotTables = $pValue;
|
||||||
|
|
||||||
|
@ -554,7 +554,7 @@ class Protection
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setSelectUnlockedCells($pValue = false)
|
public function setSelectUnlockedCells($pValue)
|
||||||
{
|
{
|
||||||
$this->selectUnlockedCells = $pValue;
|
$this->selectUnlockedCells = $pValue;
|
||||||
|
|
||||||
|
@ -579,7 +579,7 @@ class Protection
|
||||||
*
|
*
|
||||||
* @return Protection
|
* @return Protection
|
||||||
*/
|
*/
|
||||||
public function setPassword($pValue = '', $pAlreadyHashed = false)
|
public function setPassword($pValue, $pAlreadyHashed = false)
|
||||||
{
|
{
|
||||||
if (!$pAlreadyHashed) {
|
if (!$pAlreadyHashed) {
|
||||||
$pValue = \PhpOffice\PhpSpreadsheet\Shared\PasswordHasher::hashPassword($pValue);
|
$pValue = \PhpOffice\PhpSpreadsheet\Shared\PasswordHasher::hashPassword($pValue);
|
||||||
|
|
|
@ -104,7 +104,7 @@ class RowDimension extends Dimension
|
||||||
*
|
*
|
||||||
* @return RowDimension
|
* @return RowDimension
|
||||||
*/
|
*/
|
||||||
public function setRowHeight($pValue = -1)
|
public function setRowHeight($pValue)
|
||||||
{
|
{
|
||||||
$this->height = $pValue;
|
$this->height = $pValue;
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ class RowDimension extends Dimension
|
||||||
*
|
*
|
||||||
* @return RowDimension
|
* @return RowDimension
|
||||||
*/
|
*/
|
||||||
public function setZeroHeight($pValue = false)
|
public function setZeroHeight($pValue)
|
||||||
{
|
{
|
||||||
$this->zeroHeight = $pValue;
|
$this->zeroHeight = $pValue;
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ class SheetView
|
||||||
*
|
*
|
||||||
* @return SheetView
|
* @return SheetView
|
||||||
*/
|
*/
|
||||||
public function setZoomScale($pValue = 100)
|
public function setZoomScale($pValue)
|
||||||
{
|
{
|
||||||
// Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
|
// Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
|
||||||
// but it is apparently still able to handle any scale >= 1
|
// but it is apparently still able to handle any scale >= 1
|
||||||
|
@ -126,7 +126,7 @@ class SheetView
|
||||||
*
|
*
|
||||||
* @return SheetView
|
* @return SheetView
|
||||||
*/
|
*/
|
||||||
public function setZoomScaleNormal($pValue = 100)
|
public function setZoomScaleNormal($pValue)
|
||||||
{
|
{
|
||||||
if (($pValue >= 1) || is_null($pValue)) {
|
if (($pValue >= 1) || is_null($pValue)) {
|
||||||
$this->zoomScaleNormal = $pValue;
|
$this->zoomScaleNormal = $pValue;
|
||||||
|
@ -161,7 +161,7 @@ class SheetView
|
||||||
*
|
*
|
||||||
* @return SheetView
|
* @return SheetView
|
||||||
*/
|
*/
|
||||||
public function setView($pValue = null)
|
public function setView($pValue)
|
||||||
{
|
{
|
||||||
// MS Excel 2007 allows setting the view to 'normal', 'pageLayout' or 'pageBreakPreview' via the user interface
|
// MS Excel 2007 allows setting the view to 'normal', 'pageLayout' or 'pageBreakPreview' via the user interface
|
||||||
if ($pValue === null) {
|
if ($pValue === null) {
|
||||||
|
|
|
@ -48,14 +48,14 @@ abstract class BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $_useDiskCaching = false;
|
private $useDiskCaching = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disk caching directory.
|
* Disk caching directory.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $_diskCachingDirectory = './';
|
private $diskCachingDirectory = './';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write charts in workbook?
|
* Write charts in workbook?
|
||||||
|
@ -78,7 +78,7 @@ abstract class BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @return IWriter
|
* @return IWriter
|
||||||
*/
|
*/
|
||||||
public function setIncludeCharts($pValue = false)
|
public function setIncludeCharts($pValue)
|
||||||
{
|
{
|
||||||
$this->includeCharts = (bool) $pValue;
|
$this->includeCharts = (bool) $pValue;
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ abstract class BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @return IWriter
|
* @return IWriter
|
||||||
*/
|
*/
|
||||||
public function setPreCalculateFormulas($pValue = true)
|
public function setPreCalculateFormulas($pValue)
|
||||||
{
|
{
|
||||||
$this->preCalculateFormulas = (bool) $pValue;
|
$this->preCalculateFormulas = (bool) $pValue;
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ abstract class BaseWriter implements IWriter
|
||||||
*/
|
*/
|
||||||
public function getUseDiskCaching()
|
public function getUseDiskCaching()
|
||||||
{
|
{
|
||||||
return $this->_useDiskCaching;
|
return $this->useDiskCaching;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -136,13 +136,13 @@ abstract class BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @return IWriter
|
* @return IWriter
|
||||||
*/
|
*/
|
||||||
public function setUseDiskCaching($pValue = false, $pDirectory = null)
|
public function setUseDiskCaching($pValue, $pDirectory = null)
|
||||||
{
|
{
|
||||||
$this->_useDiskCaching = $pValue;
|
$this->useDiskCaching = $pValue;
|
||||||
|
|
||||||
if ($pDirectory !== null) {
|
if ($pDirectory !== null) {
|
||||||
if (is_dir($pDirectory)) {
|
if (is_dir($pDirectory)) {
|
||||||
$this->_diskCachingDirectory = $pDirectory;
|
$this->diskCachingDirectory = $pDirectory;
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("Directory does not exist: $pDirectory");
|
throw new Exception("Directory does not exist: $pDirectory");
|
||||||
}
|
}
|
||||||
|
@ -158,6 +158,6 @@ abstract class BaseWriter implements IWriter
|
||||||
*/
|
*/
|
||||||
public function getDiskCachingDirectory()
|
public function getDiskCachingDirectory()
|
||||||
{
|
{
|
||||||
return $this->_diskCachingDirectory;
|
return $this->diskCachingDirectory;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,7 @@ class Csv extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function save($pFilename = null)
|
public function save($pFilename)
|
||||||
{
|
{
|
||||||
// Fetch sheet
|
// Fetch sheet
|
||||||
$sheet = $this->spreadsheet->getSheet($this->sheetIndex);
|
$sheet = $this->spreadsheet->getSheet($this->sheetIndex);
|
||||||
|
@ -164,11 +164,11 @@ class Csv extends BaseWriter implements IWriter
|
||||||
/**
|
/**
|
||||||
* Set delimiter.
|
* Set delimiter.
|
||||||
*
|
*
|
||||||
* @param string $pValue Delimiter, defaults to ,
|
* @param string $pValue Delimiter, defaults to ','
|
||||||
*
|
*
|
||||||
* @return CSV
|
* @return CSV
|
||||||
*/
|
*/
|
||||||
public function setDelimiter($pValue = ',')
|
public function setDelimiter($pValue)
|
||||||
{
|
{
|
||||||
$this->delimiter = $pValue;
|
$this->delimiter = $pValue;
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ class Csv extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @return CSV
|
* @return CSV
|
||||||
*/
|
*/
|
||||||
public function setEnclosure($pValue = '"')
|
public function setEnclosure($pValue)
|
||||||
{
|
{
|
||||||
if ($pValue == '') {
|
if ($pValue == '') {
|
||||||
$pValue = null;
|
$pValue = null;
|
||||||
|
@ -219,7 +219,7 @@ class Csv extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @return CSV
|
* @return CSV
|
||||||
*/
|
*/
|
||||||
public function setLineEnding($pValue = PHP_EOL)
|
public function setLineEnding($pValue)
|
||||||
{
|
{
|
||||||
$this->lineEnding = $pValue;
|
$this->lineEnding = $pValue;
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ class Csv extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @return CSV
|
* @return CSV
|
||||||
*/
|
*/
|
||||||
public function setUseBOM($pValue = false)
|
public function setUseBOM($pValue)
|
||||||
{
|
{
|
||||||
$this->useBOM = $pValue;
|
$this->useBOM = $pValue;
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ class Csv extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @return CSV
|
* @return CSV
|
||||||
*/
|
*/
|
||||||
public function setIncludeSeparatorLine($pValue = false)
|
public function setIncludeSeparatorLine($pValue)
|
||||||
{
|
{
|
||||||
$this->includeSeparatorLine = $pValue;
|
$this->includeSeparatorLine = $pValue;
|
||||||
|
|
||||||
|
@ -292,7 +292,7 @@ class Csv extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @return CSV
|
* @return CSV
|
||||||
*/
|
*/
|
||||||
public function setExcelCompatibility($pValue = false)
|
public function setExcelCompatibility($pValue)
|
||||||
{
|
{
|
||||||
$this->excelCompatibility = $pValue;
|
$this->excelCompatibility = $pValue;
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ class Csv extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @return CSV
|
* @return CSV
|
||||||
*/
|
*/
|
||||||
public function setSheetIndex($pValue = 0)
|
public function setSheetIndex($pValue)
|
||||||
{
|
{
|
||||||
$this->sheetIndex = $pValue;
|
$this->sheetIndex = $pValue;
|
||||||
|
|
||||||
|
@ -331,9 +331,8 @@ class Csv extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private function writeLine($pFileHandle = null, $pValues = null)
|
private function writeLine($pFileHandle, array $pValues)
|
||||||
{
|
{
|
||||||
if (is_array($pValues)) {
|
|
||||||
// No leading delimiter
|
// No leading delimiter
|
||||||
$writeDelimiter = false;
|
$writeDelimiter = false;
|
||||||
|
|
||||||
|
@ -360,8 +359,5 @@ class Csv extends BaseWriter implements IWriter
|
||||||
|
|
||||||
// Write to file
|
// Write to file
|
||||||
fwrite($pFileHandle, $line);
|
fwrite($pFileHandle, $line);
|
||||||
} else {
|
|
||||||
throw new Exception('Invalid data row passed to CSV writer.');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,7 @@ class Html extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function save($pFilename = null)
|
public function save($pFilename)
|
||||||
{
|
{
|
||||||
// garbage collect
|
// garbage collect
|
||||||
$this->spreadsheet->garbageCollect();
|
$this->spreadsheet->garbageCollect();
|
||||||
|
@ -296,7 +296,7 @@ class Html extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @return HTML
|
* @return HTML
|
||||||
*/
|
*/
|
||||||
public function setSheetIndex($pValue = 0)
|
public function setSheetIndex($pValue)
|
||||||
{
|
{
|
||||||
$this->sheetIndex = $pValue;
|
$this->sheetIndex = $pValue;
|
||||||
|
|
||||||
|
@ -320,7 +320,7 @@ class Html extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @return HTML
|
* @return HTML
|
||||||
*/
|
*/
|
||||||
public function setGenerateSheetNavigationBlock($pValue = true)
|
public function setGenerateSheetNavigationBlock($pValue)
|
||||||
{
|
{
|
||||||
$this->generateSheetNavigationBlock = (bool) $pValue;
|
$this->generateSheetNavigationBlock = (bool) $pValue;
|
||||||
|
|
||||||
|
@ -1457,7 +1457,7 @@ class Html extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @return HTML
|
* @return HTML
|
||||||
*/
|
*/
|
||||||
public function setImagesRoot($pValue = '.')
|
public function setImagesRoot($pValue)
|
||||||
{
|
{
|
||||||
$this->imagesRoot = $pValue;
|
$this->imagesRoot = $pValue;
|
||||||
|
|
||||||
|
@ -1481,7 +1481,7 @@ class Html extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @return HTML
|
* @return HTML
|
||||||
*/
|
*/
|
||||||
public function setEmbedImages($pValue = true)
|
public function setEmbedImages($pValue)
|
||||||
{
|
{
|
||||||
$this->embedImages = $pValue;
|
$this->embedImages = $pValue;
|
||||||
|
|
||||||
|
@ -1505,7 +1505,7 @@ class Html extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @return HTML
|
* @return HTML
|
||||||
*/
|
*/
|
||||||
public function setUseInlineCss($pValue = false)
|
public function setUseInlineCss($pValue)
|
||||||
{
|
{
|
||||||
$this->useInlineCss = $pValue;
|
$this->useInlineCss = $pValue;
|
||||||
|
|
||||||
|
|
|
@ -33,5 +33,5 @@ interface IWriter
|
||||||
*
|
*
|
||||||
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function save($pFilename = null);
|
public function save($pFilename);
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ class Ods extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @return Ods\WriterPart|null
|
* @return Ods\WriterPart|null
|
||||||
*/
|
*/
|
||||||
public function getWriterPart($pPartName = '')
|
public function getWriterPart($pPartName)
|
||||||
{
|
{
|
||||||
if ($pPartName != '' && isset($this->writerParts[strtolower($pPartName)])) {
|
if ($pPartName != '' && isset($this->writerParts[strtolower($pPartName)])) {
|
||||||
return $this->writerParts[strtolower($pPartName)];
|
return $this->writerParts[strtolower($pPartName)];
|
||||||
|
@ -90,7 +90,7 @@ class Ods extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function save($pFilename = null)
|
public function save($pFilename)
|
||||||
{
|
{
|
||||||
if (!$this->spreadSheet) {
|
if (!$this->spreadSheet) {
|
||||||
throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('PhpSpreadsheet object unassigned.');
|
throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('PhpSpreadsheet object unassigned.');
|
||||||
|
|
|
@ -73,7 +73,7 @@ class Pdf implements IWriter
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function save($pFilename = null)
|
public function save($pFilename)
|
||||||
{
|
{
|
||||||
$this->renderer->save($pFilename);
|
$this->renderer->save($pFilename);
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,11 +186,11 @@ abstract class Core extends \PhpOffice\PhpSpreadsheet\Writer\Html
|
||||||
/**
|
/**
|
||||||
* Set Paper Size.
|
* Set Paper Size.
|
||||||
*
|
*
|
||||||
* @param string $pValue Paper size
|
* @param string $pValue Paper size see \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_*
|
||||||
*
|
*
|
||||||
* @return self
|
* @return self
|
||||||
*/
|
*/
|
||||||
public function setPaperSize($pValue = \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_LETTER)
|
public function setPaperSize($pValue)
|
||||||
{
|
{
|
||||||
$this->paperSize = $pValue;
|
$this->paperSize = $pValue;
|
||||||
|
|
||||||
|
@ -210,11 +210,11 @@ abstract class Core extends \PhpOffice\PhpSpreadsheet\Writer\Html
|
||||||
/**
|
/**
|
||||||
* Set Orientation.
|
* Set Orientation.
|
||||||
*
|
*
|
||||||
* @param string $pValue Page orientation
|
* @param string $pValue Page orientation see \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_*
|
||||||
*
|
*
|
||||||
* @return self
|
* @return self
|
||||||
*/
|
*/
|
||||||
public function setOrientation($pValue = \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_DEFAULT)
|
public function setOrientation($pValue)
|
||||||
{
|
{
|
||||||
$this->orientation = $pValue;
|
$this->orientation = $pValue;
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ abstract class Core extends \PhpOffice\PhpSpreadsheet\Writer\Html
|
||||||
*
|
*
|
||||||
* @return self
|
* @return self
|
||||||
*/
|
*/
|
||||||
public function setTempDir($pValue = '')
|
public function setTempDir($pValue)
|
||||||
{
|
{
|
||||||
if (is_dir($pValue)) {
|
if (is_dir($pValue)) {
|
||||||
$this->tempDir = $pValue;
|
$this->tempDir = $pValue;
|
||||||
|
@ -258,7 +258,7 @@ abstract class Core extends \PhpOffice\PhpSpreadsheet\Writer\Html
|
||||||
*
|
*
|
||||||
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
*/
|
*/
|
||||||
protected function prepareForSave($pFilename = null)
|
protected function prepareForSave($pFilename)
|
||||||
{
|
{
|
||||||
// garbage collect
|
// garbage collect
|
||||||
$this->spreadsheet->garbageCollect();
|
$this->spreadsheet->garbageCollect();
|
||||||
|
|
|
@ -33,7 +33,7 @@ class DomPDF extends Core implements \PhpOffice\PhpSpreadsheet\Writer\IWriter
|
||||||
*
|
*
|
||||||
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function save($pFilename = null)
|
public function save($pFilename)
|
||||||
{
|
{
|
||||||
$fileHandle = parent::prepareForSave($pFilename);
|
$fileHandle = parent::prepareForSave($pFilename);
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ class MPDF extends Core implements \PhpOffice\PhpSpreadsheet\Writer\IWriter
|
||||||
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
* @throws \PhpOffice\PhpSpreadsheet\Exception
|
* @throws \PhpOffice\PhpSpreadsheet\Exception
|
||||||
*/
|
*/
|
||||||
public function save($pFilename = null)
|
public function save($pFilename)
|
||||||
{
|
{
|
||||||
$fileHandle = parent::prepareForSave($pFilename);
|
$fileHandle = parent::prepareForSave($pFilename);
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ class TcPDF extends Core implements \PhpOffice\PhpSpreadsheet\Writer\IWriter
|
||||||
*
|
*
|
||||||
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function save($pFilename = null)
|
public function save($pFilename)
|
||||||
{
|
{
|
||||||
$fileHandle = parent::prepareForSave($pFilename);
|
$fileHandle = parent::prepareForSave($pFilename);
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ class Xls extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function save($pFilename = null)
|
public function save($pFilename)
|
||||||
{
|
{
|
||||||
// garbage collect
|
// garbage collect
|
||||||
$this->spreadsheet->garbageCollect();
|
$this->spreadsheet->garbageCollect();
|
||||||
|
|
|
@ -422,7 +422,7 @@ class Workbook extends BIFFwriter
|
||||||
*
|
*
|
||||||
* @return string Binary data for workbook stream
|
* @return string Binary data for workbook stream
|
||||||
*/
|
*/
|
||||||
public function writeWorkbook($pWorksheetSizes = null)
|
public function writeWorkbook(array $pWorksheetSizes)
|
||||||
{
|
{
|
||||||
$this->worksheetSizes = $pWorksheetSizes;
|
$this->worksheetSizes = $pWorksheetSizes;
|
||||||
|
|
||||||
|
|
|
@ -539,7 +539,7 @@ class Worksheet extends BIFFwriter
|
||||||
*
|
*
|
||||||
* @return string Binary data
|
* @return string Binary data
|
||||||
*/
|
*/
|
||||||
private function writeBIFF8CellRangeAddressFixed($range = 'A1')
|
private function writeBIFF8CellRangeAddressFixed($range)
|
||||||
{
|
{
|
||||||
$explodes = explode(':', $range);
|
$explodes = explode(':', $range);
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,7 @@ class Xlsx extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @return \PhpOffice\PhpSpreadsheet\Writer\Xlsx\WriterPart
|
* @return \PhpOffice\PhpSpreadsheet\Writer\Xlsx\WriterPart
|
||||||
*/
|
*/
|
||||||
public function getWriterPart($pPartName = '')
|
public function getWriterPart($pPartName)
|
||||||
{
|
{
|
||||||
if ($pPartName != '' && isset($this->writerParts[strtolower($pPartName)])) {
|
if ($pPartName != '' && isset($this->writerParts[strtolower($pPartName)])) {
|
||||||
return $this->writerParts[strtolower($pPartName)];
|
return $this->writerParts[strtolower($pPartName)];
|
||||||
|
@ -172,7 +172,7 @@ class Xlsx extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
*/
|
*/
|
||||||
public function save($pFilename = null)
|
public function save($pFilename)
|
||||||
{
|
{
|
||||||
if ($this->spreadSheet !== null) {
|
if ($this->spreadSheet !== null) {
|
||||||
// garbage collect
|
// garbage collect
|
||||||
|
@ -515,7 +515,7 @@ class Xlsx extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @return Xlsx
|
* @return Xlsx
|
||||||
*/
|
*/
|
||||||
public function setOffice2003Compatibility($pValue = false)
|
public function setOffice2003Compatibility($pValue)
|
||||||
{
|
{
|
||||||
$this->office2003compatibility = $pValue;
|
$this->office2003compatibility = $pValue;
|
||||||
|
|
||||||
|
|
|
@ -165,8 +165,8 @@ class ContentTypes extends WriterPart
|
||||||
}
|
}
|
||||||
$sheetCount = $spreadsheet->getSheetCount();
|
$sheetCount = $spreadsheet->getSheetCount();
|
||||||
for ($i = 0; $i < $sheetCount; ++$i) {
|
for ($i = 0; $i < $sheetCount; ++$i) {
|
||||||
if (count($spreadsheet->getSheet()->getHeaderFooter()->getImages()) > 0) {
|
if (count($spreadsheet->getSheet($i)->getHeaderFooter()->getImages()) > 0) {
|
||||||
foreach ($spreadsheet->getSheet()->getHeaderFooter()->getImages() as $image) {
|
foreach ($spreadsheet->getSheet($i)->getHeaderFooter()->getImages() as $image) {
|
||||||
if (!isset($aMediaContentTypes[strtolower($image->getExtension())])) {
|
if (!isset($aMediaContentTypes[strtolower($image->getExtension())])) {
|
||||||
$aMediaContentTypes[strtolower($image->getExtension())] = $this->getImageMimeType($image->getPath());
|
$aMediaContentTypes[strtolower($image->getExtension())] = $this->getImageMimeType($image->getPath());
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ class ContentTypes extends WriterPart
|
||||||
*
|
*
|
||||||
* @return string Mime Type
|
* @return string Mime Type
|
||||||
*/
|
*/
|
||||||
private function getImageMimeType($pFile = '')
|
private function getImageMimeType($pFile)
|
||||||
{
|
{
|
||||||
if (\PhpOffice\PhpSpreadsheet\Shared\File::fileExists($pFile)) {
|
if (\PhpOffice\PhpSpreadsheet\Shared\File::fileExists($pFile)) {
|
||||||
$image = getimagesize($pFile);
|
$image = getimagesize($pFile);
|
||||||
|
|
|
@ -85,7 +85,7 @@ class StringTable extends WriterPart
|
||||||
*
|
*
|
||||||
* @return string XML Output
|
* @return string XML Output
|
||||||
*/
|
*/
|
||||||
public function writeStringTable($pStringTable = null)
|
public function writeStringTable(array $pStringTable = null)
|
||||||
{
|
{
|
||||||
if ($pStringTable !== null) {
|
if ($pStringTable !== null) {
|
||||||
// Create XML writer
|
// Create XML writer
|
||||||
|
@ -286,7 +286,7 @@ class StringTable extends WriterPart
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function flipStringTable($stringTable = [])
|
public function flipStringTable(array $stringTable)
|
||||||
{
|
{
|
||||||
// Return value
|
// Return value
|
||||||
$returnValue = [];
|
$returnValue = [];
|
||||||
|
|
|
@ -83,7 +83,7 @@ class AutoFilterTest extends \PHPUnit_Framework_TestCase
|
||||||
$expectedResult = '';
|
$expectedResult = '';
|
||||||
|
|
||||||
// Setters return the instance to implement the fluent interface
|
// Setters return the instance to implement the fluent interface
|
||||||
$result = $this->testAutoFilterObject->setRange();
|
$result = $this->testAutoFilterObject->setRange('');
|
||||||
$this->assertInstanceOf(AutoFilter::class, $result);
|
$this->assertInstanceOf(AutoFilter::class, $result);
|
||||||
|
|
||||||
// Result should be a clear range
|
// Result should be a clear range
|
||||||
|
@ -268,7 +268,7 @@ class AutoFilterTest extends \PHPUnit_Framework_TestCase
|
||||||
public function testGetColumnWithoutRangeSet()
|
public function testGetColumnWithoutRangeSet()
|
||||||
{
|
{
|
||||||
// Clear the range
|
// Clear the range
|
||||||
$result = $this->testAutoFilterObject->setRange();
|
$result = $this->testAutoFilterObject->setRange('');
|
||||||
$result = $this->testAutoFilterObject->getColumn('A');
|
$result = $this->testAutoFilterObject->getColumn('A');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,7 +282,7 @@ class AutoFilterTest extends \PHPUnit_Framework_TestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setters return the instance to implement the fluent interface
|
// Setters return the instance to implement the fluent interface
|
||||||
$result = $this->testAutoFilterObject->setRange();
|
$result = $this->testAutoFilterObject->setRange('');
|
||||||
$this->assertInstanceOf(AutoFilter::class, $result);
|
$this->assertInstanceOf(AutoFilter::class, $result);
|
||||||
|
|
||||||
// Range should be cleared
|
// Range should be cleared
|
||||||
|
|
Loading…
Reference in New Issue