Rename more parameters

This commit is contained in:
Adrien Crivelli 2021-11-07 15:47:06 +09:00
parent 9d701d48ed
commit 1b877abe54
28 changed files with 446 additions and 446 deletions

View File

@ -2893,11 +2893,11 @@ class Calculation
/** /**
* Enable/disable calculation cache. * Enable/disable calculation cache.
* *
* @param bool $pValue * @param bool $calculationCacheEnabled
*/ */
public function setCalculationCacheEnabled($pValue): void public function setCalculationCacheEnabled($calculationCacheEnabled): void
{ {
$this->calculationCacheEnabled = $pValue; $this->calculationCacheEnabled = $calculationCacheEnabled;
$this->clearCalculationCache(); $this->clearCalculationCache();
} }
@ -5241,13 +5241,13 @@ class Calculation
/** /**
* Extract range values. * Extract range values.
* *
* @param string $pRange String based range representation * @param string $range String based range representation
* @param Worksheet $worksheet Worksheet * @param Worksheet $worksheet Worksheet
* @param bool $resetLog Flag indicating whether calculation log should be reset or not * @param bool $resetLog Flag indicating whether calculation log should be reset or not
* *
* @return mixed Array of values in range if range contains more than one element. Otherwise, a single value is returned. * @return mixed Array of values in range if range contains more than one element. Otherwise, a single value is returned.
*/ */
public function extractCellRange(&$pRange = 'A1', ?Worksheet $worksheet = null, $resetLog = true) public function extractCellRange(&$range = 'A1', ?Worksheet $worksheet = null, $resetLog = true)
{ {
// Return value // Return value
$returnValue = []; $returnValue = [];
@ -5255,14 +5255,14 @@ class Calculation
if ($worksheet !== null) { if ($worksheet !== null) {
$worksheetName = $worksheet->getTitle(); $worksheetName = $worksheet->getTitle();
if (strpos($pRange, '!') !== false) { if (strpos($range, '!') !== false) {
[$worksheetName, $pRange] = Worksheet::extractSheetTitle($pRange, true); [$worksheetName, $range] = Worksheet::extractSheetTitle($range, true);
$worksheet = $this->spreadsheet->getSheetByName($worksheetName); $worksheet = $this->spreadsheet->getSheetByName($worksheetName);
} }
// Extract range // Extract range
$aReferences = Coordinate::extractAllCellReferencesInRange($pRange); $aReferences = Coordinate::extractAllCellReferencesInRange($range);
$pRange = "'" . $worksheetName . "'" . '!' . $pRange; $range = "'" . $worksheetName . "'" . '!' . $range;
if (!isset($aReferences[1])) { if (!isset($aReferences[1])) {
$currentCol = ''; $currentCol = '';
$currentRow = 0; $currentRow = 0;
@ -5358,14 +5358,14 @@ class Calculation
/** /**
* Is a specific function implemented? * Is a specific function implemented?
* *
* @param string $pFunction Function Name * @param string $function Function Name
* *
* @return bool * @return bool
*/ */
public function isImplemented($pFunction) public function isImplemented($function)
{ {
$pFunction = strtoupper($pFunction); $function = strtoupper($function);
$notImplemented = !isset(self::$phpSpreadsheetFunctions[$pFunction]) || (is_array(self::$phpSpreadsheetFunctions[$pFunction]['functionCall']) && self::$phpSpreadsheetFunctions[$pFunction]['functionCall'][1] === 'DUMMY'); $notImplemented = !isset(self::$phpSpreadsheetFunctions[$function]) || (is_array(self::$phpSpreadsheetFunctions[$function]['functionCall']) && self::$phpSpreadsheetFunctions[$function]['functionCall'][1] === 'DUMMY');
return !$notImplemented; return !$notImplemented;
} }

View File

@ -48,11 +48,11 @@ class Logger
/** /**
* Enable/Disable Calculation engine logging. * Enable/Disable Calculation engine logging.
* *
* @param bool $pValue * @param bool $writeDebugLog
*/ */
public function setWriteDebugLog($pValue): void public function setWriteDebugLog($writeDebugLog): void
{ {
$this->writeDebugLog = $pValue; $this->writeDebugLog = $writeDebugLog;
} }
/** /**
@ -68,11 +68,11 @@ class Logger
/** /**
* Enable/Disable echoing of debug log information. * Enable/Disable echoing of debug log information.
* *
* @param bool $pValue * @param bool $echoDebugLog
*/ */
public function setEchoDebugLog($pValue): void public function setEchoDebugLog($echoDebugLog): void
{ {
$this->echoDebugLog = $pValue; $this->echoDebugLog = $echoDebugLog;
} }
/** /**

View File

@ -61,17 +61,17 @@ class FormulaParser
/** /**
* Create a new FormulaParser. * Create a new FormulaParser.
* *
* @param string $pFormula Formula to parse * @param string $formula Formula to parse
*/ */
public function __construct($pFormula = '') public function __construct($formula = '')
{ {
// Check parameters // Check parameters
if ($pFormula === null) { if ($formula === null) {
throw new Exception('Invalid parameter passed: formula'); throw new Exception('Invalid parameter passed: formula');
} }
// Initialise values // Initialise values
$this->formula = trim($pFormula); $this->formula = trim($formula);
// Parse! // Parse!
$this->parseToTokens(); $this->parseToTokens();
} }
@ -89,15 +89,15 @@ class FormulaParser
/** /**
* Get Token. * Get Token.
* *
* @param int $pId Token id * @param int $id Token id
*/ */
public function getToken(int $pId = 0): FormulaToken public function getToken(int $id = 0): FormulaToken
{ {
if (isset($this->tokens[$pId])) { if (isset($this->tokens[$id])) {
return $this->tokens[$pId]; return $this->tokens[$id];
} }
throw new Exception("Token with id $pId does not exist."); throw new Exception("Token with id $id does not exist.");
} }
/** /**

View File

@ -76,16 +76,16 @@ class FormulaToken
/** /**
* Create a new FormulaToken. * Create a new FormulaToken.
* *
* @param string $pValue * @param string $value
* @param string $pTokenType Token type (represented by TOKEN_TYPE_*) * @param string $tokenType Token type (represented by TOKEN_TYPE_*)
* @param string $pTokenSubType Token Subtype (represented by TOKEN_SUBTYPE_*) * @param string $tokenSubType Token Subtype (represented by TOKEN_SUBTYPE_*)
*/ */
public function __construct($pValue, $pTokenType = self::TOKEN_TYPE_UNKNOWN, $pTokenSubType = self::TOKEN_SUBTYPE_NOTHING) public function __construct($value, $tokenType = self::TOKEN_TYPE_UNKNOWN, $tokenSubType = self::TOKEN_SUBTYPE_NOTHING)
{ {
// Initialise values // Initialise values
$this->value = $pValue; $this->value = $value;
$this->tokenType = $pTokenType; $this->tokenType = $tokenType;
$this->tokenSubType = $pTokenSubType; $this->tokenSubType = $tokenSubType;
} }
/** /**

View File

@ -685,27 +685,27 @@ class Functions
return $worksheet->getCell($cellReference)->isFormula(); return $worksheet->getCell($cellReference)->isFormula();
} }
public static function expandDefinedName(string $pCoordinate, Cell $cell): string public static function expandDefinedName(string $coordinate, Cell $cell): string
{ {
$worksheet = $cell->getWorksheet(); $worksheet = $cell->getWorksheet();
$spreadsheet = $worksheet->getParent(); $spreadsheet = $worksheet->getParent();
// Uppercase coordinate // Uppercase coordinate
$pCoordinatex = strtoupper($pCoordinate); $pCoordinatex = strtoupper($coordinate);
// Eliminate leading equal sign // Eliminate leading equal sign
$pCoordinatex = Worksheet::pregReplace('/^=/', '', $pCoordinatex); $pCoordinatex = Worksheet::pregReplace('/^=/', '', $pCoordinatex);
$defined = $spreadsheet->getDefinedName($pCoordinatex, $worksheet); $defined = $spreadsheet->getDefinedName($pCoordinatex, $worksheet);
if ($defined !== null) { if ($defined !== null) {
$worksheet2 = $defined->getWorkSheet(); $worksheet2 = $defined->getWorkSheet();
if (!$defined->isFormula() && $worksheet2 !== null) { if (!$defined->isFormula() && $worksheet2 !== null) {
$pCoordinate = "'" . $worksheet2->getTitle() . "'!" . Worksheet::pregReplace('/^=/', '', $defined->getValue()); $coordinate = "'" . $worksheet2->getTitle() . "'!" . Worksheet::pregReplace('/^=/', '', $defined->getValue());
} }
} }
return $pCoordinate; return $coordinate;
} }
public static function trimTrailingRange(string $pCoordinate): string public static function trimTrailingRange(string $coordinate): string
{ {
return Worksheet::pregReplace('/:[\\w\$]+$/', '', $pCoordinate); return Worksheet::pregReplace('/:[\\w\$]+$/', '', $coordinate);
} }
} }

View File

@ -123,9 +123,9 @@ class Csv extends BaseReader
return $this->inputEncoding; return $this->inputEncoding;
} }
public function setFallbackEncoding(string $pValue): self public function setFallbackEncoding(string $fallbackEncoding): self
{ {
$this->fallbackEncoding = $pValue; $this->fallbackEncoding = $fallbackEncoding;
return $this; return $this;
} }

View File

@ -103,16 +103,16 @@ class Gnumeric extends BaseReader
/** /**
* Reads names of the worksheets from a file, without parsing the whole file to a Spreadsheet object. * Reads names of the worksheets from a file, without parsing the whole file to a Spreadsheet object.
* *
* @param string $pFilename * @param string $filename
* *
* @return array * @return array
*/ */
public function listWorksheetNames($pFilename) public function listWorksheetNames($filename)
{ {
File::assertFile($pFilename); File::assertFile($filename);
$xml = new XMLReader(); $xml = new XMLReader();
$xml->xml($this->securityScanner->scanFile('compress.zlib://' . realpath($pFilename)), null, Settings::getLibXmlLoaderOptions()); $xml->xml($this->securityScanner->scanFile('compress.zlib://' . realpath($filename)), null, Settings::getLibXmlLoaderOptions());
$xml->setParserProperty(2, true); $xml->setParserProperty(2, true);
$worksheetNames = []; $worksheetNames = [];
@ -132,16 +132,16 @@ class Gnumeric extends BaseReader
/** /**
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns). * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
* *
* @param string $pFilename * @param string $filename
* *
* @return array * @return array
*/ */
public function listWorksheetInfo($pFilename) public function listWorksheetInfo($filename)
{ {
File::assertFile($pFilename); File::assertFile($filename);
$xml = new XMLReader(); $xml = new XMLReader();
$xml->xml($this->securityScanner->scanFile('compress.zlib://' . realpath($pFilename)), null, Settings::getLibXmlLoaderOptions()); $xml->xml($this->securityScanner->scanFile('compress.zlib://' . realpath($filename)), null, Settings::getLibXmlLoaderOptions());
$xml->setParserProperty(2, true); $xml->setParserProperty(2, true);
$worksheetInfo = []; $worksheetInfo = [];
@ -245,12 +245,12 @@ class Gnumeric extends BaseReader
/** /**
* Loads from file into Spreadsheet instance. * Loads from file into Spreadsheet instance.
*/ */
public function loadIntoExisting(string $pFilename, Spreadsheet $spreadsheet): Spreadsheet public function loadIntoExisting(string $filename, Spreadsheet $spreadsheet): Spreadsheet
{ {
$this->spreadsheet = $spreadsheet; $this->spreadsheet = $spreadsheet;
File::assertFile($pFilename); File::assertFile($filename);
$gFileData = $this->gzfileGetContents($pFilename); $gFileData = $this->gzfileGetContents($filename);
$xml2 = simplexml_load_string($this->securityScanner->scan($gFileData), 'SimpleXMLElement', Settings::getLibXmlLoaderOptions()); $xml2 = simplexml_load_string($this->securityScanner->scan($gFileData), 'SimpleXMLElement', Settings::getLibXmlLoaderOptions());
$xml = self::testSimpleXml($xml2); $xml = self::testSimpleXml($xml2);

View File

@ -218,7 +218,7 @@ class Html extends BaseReader
/** /**
* Set input encoding. * Set input encoding.
* *
* @param string $pValue Input encoding, eg: 'ANSI' * @param string $inputEncoding Input encoding, eg: 'ANSI'
* *
* @return $this * @return $this
* *
@ -226,9 +226,9 @@ class Html extends BaseReader
* *
* @deprecated no use is made of this property * @deprecated no use is made of this property
*/ */
public function setInputEncoding($pValue) public function setInputEncoding($inputEncoding)
{ {
$this->inputEncoding = $pValue; $this->inputEncoding = $inputEncoding;
return $this; return $this;
} }
@ -650,28 +650,28 @@ class Html extends BaseReader
/** /**
* Loads PhpSpreadsheet from file into PhpSpreadsheet instance. * Loads PhpSpreadsheet from file into PhpSpreadsheet instance.
* *
* @param string $pFilename * @param string $filename
* *
* @return Spreadsheet * @return Spreadsheet
*/ */
public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet) public function loadIntoExisting($filename, Spreadsheet $spreadsheet)
{ {
// Validate // Validate
if (!$this->canRead($pFilename)) { if (!$this->canRead($filename)) {
throw new Exception($pFilename . ' is an Invalid HTML file.'); throw new Exception($filename . ' is an Invalid HTML file.');
} }
// Create a new DOM object // Create a new DOM object
$dom = new DOMDocument(); $dom = new DOMDocument();
// Reload the HTML file into the DOM object // Reload the HTML file into the DOM object
try { try {
$convert = mb_convert_encoding($this->securityScanner->scanFile($pFilename), 'HTML-ENTITIES', 'UTF-8'); $convert = mb_convert_encoding($this->securityScanner->scanFile($filename), 'HTML-ENTITIES', 'UTF-8');
$loaded = $dom->loadHTML(self::ensureString($convert)); $loaded = $dom->loadHTML(self::ensureString($convert));
} catch (Throwable $e) { } catch (Throwable $e) {
$loaded = false; $loaded = false;
} }
if ($loaded === false) { if ($loaded === false) {
throw new Exception('Failed to load ' . $pFilename . ' as a DOM Document', 0, $e ?? null); throw new Exception('Failed to load ' . $filename . ' as a DOM Document', 0, $e ?? null);
} }
return $this->loadDocument($dom, $spreadsheet); return $this->loadDocument($dom, $spreadsheet);
@ -736,13 +736,13 @@ class Html extends BaseReader
/** /**
* Set sheet index. * Set sheet index.
* *
* @param int $pValue Sheet index * @param int $sheetIndex Sheet index
* *
* @return $this * @return $this
*/ */
public function setSheetIndex($pValue) public function setSheetIndex($sheetIndex)
{ {
$this->sheetIndex = $pValue; $this->sheetIndex = $sheetIndex;
return $this; return $this;
} }

View File

@ -30,11 +30,11 @@ interface IReader
* Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information. * Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information.
* Set to false (the default) to advise the Reader to read both data and formatting for cells. * Set to false (the default) to advise the Reader to read both data and formatting for cells.
* *
* @param bool $pValue * @param bool $readDataOnly
* *
* @return IReader * @return IReader
*/ */
public function setReadDataOnly($pValue); public function setReadDataOnly($readDataOnly);
/** /**
* Read empty cells? * Read empty cells?
@ -50,11 +50,11 @@ interface IReader
* Set to true (the default) to advise the Reader read data values for all cells, irrespective of value. * Set to true (the default) to advise the Reader read data values for all cells, irrespective of value.
* Set to false to advise the Reader to ignore cells containing a null value or an empty string. * Set to false to advise the Reader to ignore cells containing a null value or an empty string.
* *
* @param bool $pValue * @param bool $readEmptyCells
* *
* @return IReader * @return IReader
*/ */
public function setReadEmptyCells($pValue); public function setReadEmptyCells($readEmptyCells);
/** /**
* Read charts in workbook? * Read charts in workbook?
@ -72,11 +72,11 @@ interface IReader
* Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. * Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value.
* Set to false (the default) to discard charts. * Set to false (the default) to discard charts.
* *
* @param bool $pValue * @param bool $includeCharts
* *
* @return IReader * @return IReader
*/ */
public function setIncludeCharts($pValue); public function setIncludeCharts($includeCharts);
/** /**
* Get which sheets to load * Get which sheets to load
@ -118,7 +118,7 @@ interface IReader
* *
* @return IReader * @return IReader
*/ */
public function setReadFilter(IReadFilter $pValue); public function setReadFilter(IReadFilter $readFilter);
/** /**
* Loads PhpSpreadsheet from file. * Loads PhpSpreadsheet from file.

View File

@ -84,19 +84,19 @@ class Ods extends BaseReader
/** /**
* Reads names of the worksheets from a file, without parsing the whole file to a PhpSpreadsheet object. * Reads names of the worksheets from a file, without parsing the whole file to a PhpSpreadsheet object.
* *
* @param string $pFilename * @param string $filename
* *
* @return string[] * @return string[]
*/ */
public function listWorksheetNames($pFilename) public function listWorksheetNames($filename)
{ {
File::assertFile($pFilename, self::INITIAL_FILE); File::assertFile($filename, self::INITIAL_FILE);
$worksheetNames = []; $worksheetNames = [];
$xml = new XMLReader(); $xml = new XMLReader();
$xml->xml( $xml->xml(
$this->securityScanner->scanFile('zip://' . realpath($pFilename) . '#' . self::INITIAL_FILE), $this->securityScanner->scanFile('zip://' . realpath($filename) . '#' . self::INITIAL_FILE),
null, null,
Settings::getLibXmlLoaderOptions() Settings::getLibXmlLoaderOptions()
); );
@ -131,19 +131,19 @@ class Ods extends BaseReader
/** /**
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns). * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
* *
* @param string $pFilename * @param string $filename
* *
* @return array * @return array
*/ */
public function listWorksheetInfo($pFilename) public function listWorksheetInfo($filename)
{ {
File::assertFile($pFilename, self::INITIAL_FILE); File::assertFile($filename, self::INITIAL_FILE);
$worksheetInfo = []; $worksheetInfo = [];
$xml = new XMLReader(); $xml = new XMLReader();
$xml->xml( $xml->xml(
$this->securityScanner->scanFile('zip://' . realpath($pFilename) . '#' . self::INITIAL_FILE), $this->securityScanner->scanFile('zip://' . realpath($filename) . '#' . self::INITIAL_FILE),
null, null,
Settings::getLibXmlLoaderOptions() Settings::getLibXmlLoaderOptions()
); );
@ -234,16 +234,16 @@ class Ods extends BaseReader
/** /**
* Loads PhpSpreadsheet from file into PhpSpreadsheet instance. * Loads PhpSpreadsheet from file into PhpSpreadsheet instance.
* *
* @param string $pFilename * @param string $filename
* *
* @return Spreadsheet * @return Spreadsheet
*/ */
public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet) public function loadIntoExisting($filename, Spreadsheet $spreadsheet)
{ {
File::assertFile($pFilename, self::INITIAL_FILE); File::assertFile($filename, self::INITIAL_FILE);
$zip = new ZipArchive(); $zip = new ZipArchive();
$zip->open($pFilename); $zip->open($filename);
// Meta // Meta

View File

@ -89,12 +89,12 @@ class Slk extends BaseReader
return $hasDelimiter && $hasId; return $hasDelimiter && $hasId;
} }
private function canReadOrBust(string $pFilename): void private function canReadOrBust(string $filename): void
{ {
if (!$this->canRead($pFilename)) { if (!$this->canRead($filename)) {
throw new ReaderException($pFilename . ' is an Invalid SYLK file.'); throw new ReaderException($filename . ' is an Invalid SYLK file.');
} }
$this->openFile($pFilename); $this->openFile($filename);
} }
/** /**
@ -102,15 +102,15 @@ class Slk extends BaseReader
* *
* @deprecated no use is made of this property * @deprecated no use is made of this property
* *
* @param string $pValue Input encoding, eg: 'ANSI' * @param string $inputEncoding Input encoding, eg: 'ANSI'
* *
* @return $this * @return $this
* *
* @codeCoverageIgnore * @codeCoverageIgnore
*/ */
public function setInputEncoding($pValue) public function setInputEncoding($inputEncoding)
{ {
$this->inputEncoding = $pValue; $this->inputEncoding = $inputEncoding;
return $this; return $this;
} }
@ -132,19 +132,19 @@ class Slk extends BaseReader
/** /**
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns). * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
* *
* @param string $pFilename * @param string $filename
* *
* @return array * @return array
*/ */
public function listWorksheetInfo($pFilename) public function listWorksheetInfo($filename)
{ {
// Open file // Open file
$this->canReadOrBust($pFilename); $this->canReadOrBust($filename);
$fileHandle = $this->fileHandle; $fileHandle = $this->fileHandle;
rewind($fileHandle); rewind($fileHandle);
$worksheetInfo = []; $worksheetInfo = [];
$worksheetInfo[0]['worksheetName'] = basename($pFilename, '.slk'); $worksheetInfo[0]['worksheetName'] = basename($filename, '.slk');
// loop through one row (line) at a time in the file // loop through one row (line) at a time in the file
$rowIndex = 0; $rowIndex = 0;
@ -506,14 +506,14 @@ class Slk extends BaseReader
/** /**
* Loads PhpSpreadsheet from file into PhpSpreadsheet instance. * Loads PhpSpreadsheet from file into PhpSpreadsheet instance.
* *
* @param string $pFilename * @param string $filename
* *
* @return Spreadsheet * @return Spreadsheet
*/ */
public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet) public function loadIntoExisting($filename, Spreadsheet $spreadsheet)
{ {
// Open file // Open file
$this->canReadOrBust($pFilename); $this->canReadOrBust($filename);
$fileHandle = $this->fileHandle; $fileHandle = $this->fileHandle;
rewind($fileHandle); rewind($fileHandle);
@ -522,7 +522,7 @@ class Slk extends BaseReader
$spreadsheet->createSheet(); $spreadsheet->createSheet();
} }
$spreadsheet->setActiveSheetIndex($this->sheetIndex); $spreadsheet->setActiveSheetIndex($this->sheetIndex);
$spreadsheet->getActiveSheet()->setTitle(substr(basename($pFilename, '.slk'), 0, Worksheet::SHEET_TITLE_MAXIMUM_LENGTH)); $spreadsheet->getActiveSheet()->setTitle(substr(basename($filename, '.slk'), 0, Worksheet::SHEET_TITLE_MAXIMUM_LENGTH));
// Loop through file // Loop through file
$column = $row = ''; $column = $row = '';
@ -583,13 +583,13 @@ class Slk extends BaseReader
/** /**
* Set sheet index. * Set sheet index.
* *
* @param int $pValue Sheet index * @param int $sheetIndex Sheet index
* *
* @return $this * @return $this
*/ */
public function setSheetIndex($pValue) public function setSheetIndex($sheetIndex)
{ {
$this->sheetIndex = $pValue; $this->sheetIndex = $sheetIndex;
return $this; return $this;
} }

View File

@ -451,18 +451,18 @@ class Xls extends BaseReader
/** /**
* Reads names of the worksheets from a file, without parsing the whole file to a PhpSpreadsheet object. * Reads names of the worksheets from a file, without parsing the whole file to a PhpSpreadsheet object.
* *
* @param string $pFilename * @param string $filename
* *
* @return array * @return array
*/ */
public function listWorksheetNames($pFilename) public function listWorksheetNames($filename)
{ {
File::assertFile($pFilename); File::assertFile($filename);
$worksheetNames = []; $worksheetNames = [];
// Read the OLE file // Read the OLE file
$this->loadOLE($pFilename); $this->loadOLE($filename);
// total byte size of Excel data (workbook global substream + sheet substreams) // total byte size of Excel data (workbook global substream + sheet substreams)
$this->dataSize = strlen($this->data); $this->dataSize = strlen($this->data);
@ -509,18 +509,18 @@ class Xls extends BaseReader
/** /**
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns). * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
* *
* @param string $pFilename * @param string $filename
* *
* @return array * @return array
*/ */
public function listWorksheetInfo($pFilename) public function listWorksheetInfo($filename)
{ {
File::assertFile($pFilename); File::assertFile($filename);
$worksheetInfo = []; $worksheetInfo = [];
// Read the OLE file // Read the OLE file
$this->loadOLE($pFilename); $this->loadOLE($filename);
// total byte size of Excel data (workbook global substream + sheet substreams) // total byte size of Excel data (workbook global substream + sheet substreams)
$this->dataSize = strlen($this->data); $this->dataSize = strlen($this->data);
@ -1364,14 +1364,14 @@ class Xls extends BaseReader
/** /**
* Use OLE reader to extract the relevant data streams from the OLE file. * Use OLE reader to extract the relevant data streams from the OLE file.
* *
* @param string $pFilename * @param string $filename
*/ */
private function loadOLE($pFilename): void private function loadOLE($filename): void
{ {
// OLE reader // OLE reader
$ole = new OLERead(); $ole = new OLERead();
// get excel data, // get excel data,
$ole->read($pFilename); $ole->read($filename);
// Get workbook data: workbook stream + sheet streams // Get workbook data: workbook stream + sheet streams
$this->data = $ole->getStream($ole->wrkbook); $this->data = $ole->getStream($ole->wrkbook);
// Get summary information data // Get summary information data

View File

@ -103,20 +103,20 @@ class Xml extends BaseReader
/** /**
* Check if the file is a valid SimpleXML. * Check if the file is a valid SimpleXML.
* *
* @param string $pFilename * @param string $filename
* *
* @return false|SimpleXMLElement * @return false|SimpleXMLElement
*/ */
public function trySimpleXMLLoadString($pFilename) public function trySimpleXMLLoadString($filename)
{ {
try { try {
$xml = simplexml_load_string( $xml = simplexml_load_string(
$this->securityScanner->scan($this->fileContents ?: file_get_contents($pFilename)), $this->securityScanner->scan($this->fileContents ?: file_get_contents($filename)),
'SimpleXMLElement', 'SimpleXMLElement',
Settings::getLibXmlLoaderOptions() Settings::getLibXmlLoaderOptions()
); );
} catch (\Exception $e) { } catch (\Exception $e) {
throw new Exception('Cannot load invalid XML file: ' . $pFilename, 0, $e); throw new Exception('Cannot load invalid XML file: ' . $filename, 0, $e);
} }
$this->fileContents = ''; $this->fileContents = '';

View File

@ -67,15 +67,15 @@ class Drawing
* Convert column width from (intrinsic) Excel units to pixels. * Convert column width from (intrinsic) Excel units to pixels.
* *
* @param float $cellWidth Value in cell dimension * @param float $cellWidth Value in cell dimension
* @param \PhpOffice\PhpSpreadsheet\Style\Font $pDefaultFont Default font of the workbook * @param \PhpOffice\PhpSpreadsheet\Style\Font $defaultFont Default font of the workbook
* *
* @return int Value in pixels * @return int Value in pixels
*/ */
public static function cellDimensionToPixels($cellWidth, \PhpOffice\PhpSpreadsheet\Style\Font $pDefaultFont) public static function cellDimensionToPixels($cellWidth, \PhpOffice\PhpSpreadsheet\Style\Font $defaultFont)
{ {
// Font name and size // Font name and size
$name = $pDefaultFont->getName(); $name = $defaultFont->getName();
$size = $pDefaultFont->getSize(); $size = $defaultFont->getSize();
if (isset(Font::$defaultColumnWidths[$name][$size])) { if (isset(Font::$defaultColumnWidths[$name][$size])) {
// Exact width can be determined // Exact width can be determined

View File

@ -166,10 +166,10 @@ class DggContainer
/** /**
* Set identifier clusters. [<drawingId> => <max shape id>, ...]. * Set identifier clusters. [<drawingId> => <max shape id>, ...].
* *
* @param array $pValue * @param array $IDCLs
*/ */
public function setIDCLs($pValue): void public function setIDCLs($IDCLs): void
{ {
$this->IDCLs = $pValue; $this->IDCLs = $IDCLs;
} }
} }

View File

@ -38,12 +38,12 @@ class AutoFilter
/** /**
* Create a new AutoFilter. * Create a new AutoFilter.
* *
* @param string $pRange Cell range (i.e. A1:E10) * @param string $range Cell range (i.e. A1:E10)
* @param Worksheet $worksheet * @param Worksheet $worksheet
*/ */
public function __construct($pRange = '', ?Worksheet $worksheet = null) public function __construct($range = '', ?Worksheet $worksheet = null)
{ {
$this->range = $pRange; $this->range = $range;
$this->workSheet = $worksheet; $this->workSheet = $worksheet;
} }
@ -84,15 +84,15 @@ class AutoFilter
/** /**
* Set AutoFilter Range. * Set AutoFilter Range.
* *
* @param string $pRange Cell range (i.e. A1:E10) * @param string $range Cell range (i.e. A1:E10)
* *
* @return $this * @return $this
*/ */
public function setRange($pRange) public function setRange($range)
{ {
// extract coordinate // extract coordinate
[$worksheet, $pRange] = Worksheet::extractSheetTitle($pRange, true); [$worksheet, $range] = Worksheet::extractSheetTitle($range, true);
if (empty($pRange)) { if (empty($range)) {
// Discard all column rules // Discard all column rules
$this->columns = []; $this->columns = [];
$this->range = ''; $this->range = '';
@ -100,11 +100,11 @@ class AutoFilter
return $this; return $this;
} }
if (strpos($pRange, ':') === false) { if (strpos($range, ':') === false) {
throw new PhpSpreadsheetException('Autofilter must be set on a range of cells.'); throw new PhpSpreadsheetException('Autofilter must be set on a range of cells.');
} }
$this->range = $pRange; $this->range = $range;
// Discard any column rules that are no longer valid within this range // Discard any column rules that are no longer valid within this range
[$rangeStart, $rangeEnd] = Coordinate::rangeBoundaries($this->range); [$rangeStart, $rangeEnd] = Coordinate::rangeBoundaries($this->range);
foreach ($this->columns as $key => $value) { foreach ($this->columns as $key => $value) {
@ -152,44 +152,44 @@ class AutoFilter
/** /**
* Get a specified AutoFilter Column Offset within the defined AutoFilter range. * Get a specified AutoFilter Column Offset within the defined AutoFilter range.
* *
* @param string $pColumn Column name (e.g. A) * @param string $column Column name (e.g. A)
* *
* @return int The offset of the specified column within the autofilter range * @return int The offset of the specified column within the autofilter range
*/ */
public function getColumnOffset($pColumn) public function getColumnOffset($column)
{ {
return $this->testColumnInRange($pColumn); return $this->testColumnInRange($column);
} }
/** /**
* Get a specified AutoFilter Column. * Get a specified AutoFilter Column.
* *
* @param string $pColumn Column name (e.g. A) * @param string $column Column name (e.g. A)
* *
* @return AutoFilter\Column * @return AutoFilter\Column
*/ */
public function getColumn($pColumn) public function getColumn($column)
{ {
$this->testColumnInRange($pColumn); $this->testColumnInRange($column);
if (!isset($this->columns[$pColumn])) { if (!isset($this->columns[$column])) {
$this->columns[$pColumn] = new AutoFilter\Column($pColumn, $this); $this->columns[$column] = new AutoFilter\Column($column, $this);
} }
return $this->columns[$pColumn]; return $this->columns[$column];
} }
/** /**
* Get a specified AutoFilter Column by it's offset. * Get a specified AutoFilter Column by it's offset.
* *
* @param int $pColumnOffset Column offset within range (starting from 0) * @param int $columnOffset Column offset within range (starting from 0)
* *
* @return AutoFilter\Column * @return AutoFilter\Column
*/ */
public function getColumnByOffset($pColumnOffset) public function getColumnByOffset($columnOffset)
{ {
[$rangeStart, $rangeEnd] = Coordinate::rangeBoundaries($this->range); [$rangeStart, $rangeEnd] = Coordinate::rangeBoundaries($this->range);
$pColumn = Coordinate::stringFromColumnIndex($rangeStart[0] + $pColumnOffset); $pColumn = Coordinate::stringFromColumnIndex($rangeStart[0] + $columnOffset);
return $this->getColumn($pColumn); return $this->getColumn($pColumn);
} }
@ -227,16 +227,16 @@ class AutoFilter
/** /**
* Clear a specified AutoFilter Column. * Clear a specified AutoFilter Column.
* *
* @param string $pColumn Column name (e.g. A) * @param string $column Column name (e.g. A)
* *
* @return $this * @return $this
*/ */
public function clearColumn($pColumn) public function clearColumn($column)
{ {
$this->testColumnInRange($pColumn); $this->testColumnInRange($column);
if (isset($this->columns[$pColumn])) { if (isset($this->columns[$column])) {
unset($this->columns[$pColumn]); unset($this->columns[$column]);
} }
return $this; return $this;

View File

@ -91,13 +91,13 @@ class Column
/** /**
* Create a new Column. * Create a new Column.
* *
* @param string $pColumn Column (e.g. A) * @param string $column Column (e.g. A)
* @param AutoFilter $pParent Autofilter for this column * @param AutoFilter $parent Autofilter for this column
*/ */
public function __construct($pColumn, ?AutoFilter $pParent = null) public function __construct($column, ?AutoFilter $parent = null)
{ {
$this->columnIndex = $pColumn; $this->columnIndex = $column;
$this->parent = $pParent; $this->parent = $parent;
} }
/** /**
@ -113,19 +113,19 @@ class Column
/** /**
* Set AutoFilter column index as string eg: 'A'. * Set AutoFilter column index as string eg: 'A'.
* *
* @param string $pColumn Column (e.g. A) * @param string $column Column (e.g. A)
* *
* @return $this * @return $this
*/ */
public function setColumnIndex($pColumn) public function setColumnIndex($column)
{ {
// Uppercase coordinate // Uppercase coordinate
$pColumn = strtoupper($pColumn); $column = strtoupper($column);
if ($this->parent !== null) { if ($this->parent !== null) {
$this->parent->testColumnInRange($pColumn); $this->parent->testColumnInRange($column);
} }
$this->columnIndex = $pColumn; $this->columnIndex = $column;
return $this; return $this;
} }
@ -143,13 +143,13 @@ class Column
/** /**
* Set this Column's AutoFilter Parent. * Set this Column's AutoFilter Parent.
* *
* @param AutoFilter $pParent * @param AutoFilter $parent
* *
* @return $this * @return $this
*/ */
public function setParent(?AutoFilter $pParent = null) public function setParent(?AutoFilter $parent = null)
{ {
$this->parent = $pParent; $this->parent = $parent;
return $this; return $this;
} }
@ -167,17 +167,17 @@ class Column
/** /**
* Set AutoFilter Type. * Set AutoFilter Type.
* *
* @param string $pFilterType * @param string $filterType
* *
* @return $this * @return $this
*/ */
public function setFilterType($pFilterType) public function setFilterType($filterType)
{ {
if (!in_array($pFilterType, self::$filterTypes)) { if (!in_array($filterType, self::$filterTypes)) {
throw new PhpSpreadsheetException('Invalid filter type for column AutoFilter.'); throw new PhpSpreadsheetException('Invalid filter type for column AutoFilter.');
} }
$this->filterType = $pFilterType; $this->filterType = $filterType;
return $this; return $this;
} }
@ -195,19 +195,19 @@ class Column
/** /**
* Set AutoFilter Multiple Rules And/Or. * Set AutoFilter Multiple Rules And/Or.
* *
* @param string $pJoin And/Or * @param string $join And/Or
* *
* @return $this * @return $this
*/ */
public function setJoin($pJoin) public function setJoin($join)
{ {
// Lowercase And/Or // Lowercase And/Or
$pJoin = strtolower($pJoin); $join = strtolower($join);
if (!in_array($pJoin, self::$ruleJoins)) { if (!in_array($join, self::$ruleJoins)) {
throw new PhpSpreadsheetException('Invalid rule connection for column AutoFilter.'); throw new PhpSpreadsheetException('Invalid rule connection for column AutoFilter.');
} }
$this->join = $pJoin; $this->join = $join;
return $this; return $this;
} }
@ -229,14 +229,14 @@ class Column
/** /**
* Set An AutoFilter Attribute. * Set An AutoFilter Attribute.
* *
* @param string $pName Attribute Name * @param string $name Attribute Name
* @param string $pValue Attribute Value * @param string $value Attribute Value
* *
* @return $this * @return $this
*/ */
public function setAttribute($pName, $pValue) public function setAttribute($name, $value)
{ {
$this->attributes[$pName] = $pValue; $this->attributes[$name] = $value;
return $this; return $this;
} }
@ -254,14 +254,14 @@ class Column
/** /**
* Get specific AutoFilter Column Attribute. * Get specific AutoFilter Column Attribute.
* *
* @param string $pName Attribute Name * @param string $name Attribute Name
* *
* @return null|int|string * @return null|int|string
*/ */
public function getAttribute($pName) public function getAttribute($name)
{ {
if (isset($this->attributes[$pName])) { if (isset($this->attributes[$name])) {
return $this->attributes[$pName]; return $this->attributes[$name];
} }
return null; return null;
@ -285,17 +285,17 @@ class Column
/** /**
* Get a specified AutoFilter Column Rule. * Get a specified AutoFilter Column Rule.
* *
* @param int $pIndex Rule index in the ruleset array * @param int $index Rule index in the ruleset array
* *
* @return Column\Rule * @return Column\Rule
*/ */
public function getRule($pIndex) public function getRule($index)
{ {
if (!isset($this->ruleset[$pIndex])) { if (!isset($this->ruleset[$index])) {
$this->ruleset[$pIndex] = new Column\Rule($this); $this->ruleset[$index] = new Column\Rule($this);
} }
return $this->ruleset[$pIndex]; return $this->ruleset[$index];
} }
/** /**
@ -315,10 +315,10 @@ class Column
* *
* @return $this * @return $this
*/ */
public function addRule(Column\Rule $pRule) public function addRule(Column\Rule $rule)
{ {
$pRule->setParent($this); $rule->setParent($this);
$this->ruleset[] = $pRule; $this->ruleset[] = $rule;
return $this; return $this;
} }
@ -327,14 +327,14 @@ class Column
* Delete a specified AutoFilter Column Rule * Delete a specified AutoFilter Column Rule
* If the number of rules is reduced to 1, then we reset And/Or logic to Or. * If the number of rules is reduced to 1, then we reset And/Or logic to Or.
* *
* @param int $pIndex Rule index in the ruleset array * @param int $index Rule index in the ruleset array
* *
* @return $this * @return $this
*/ */
public function deleteRule($pIndex) public function deleteRule($index)
{ {
if (isset($this->ruleset[$pIndex])) { if (isset($this->ruleset[$index])) {
unset($this->ruleset[$pIndex]); unset($this->ruleset[$index]);
// If we've just deleted down to a single rule, then reset And/Or joining to Or // If we've just deleted down to a single rule, then reset And/Or joining to Or
if (count($this->ruleset) <= 1) { if (count($this->ruleset) <= 1) {
$this->setJoin(self::AUTOFILTER_COLUMN_JOIN_OR); $this->setJoin(self::AUTOFILTER_COLUMN_JOIN_OR);

View File

@ -238,9 +238,9 @@ class Rule
/** /**
* Create a new Rule. * Create a new Rule.
*/ */
public function __construct(?Column $pParent = null) public function __construct(?Column $parent = null)
{ {
$this->parent = $pParent; $this->parent = $parent;
} }
/** /**
@ -256,17 +256,17 @@ class Rule
/** /**
* Set AutoFilter Rule Type. * Set AutoFilter Rule Type.
* *
* @param string $pRuleType see self::AUTOFILTER_RULETYPE_* * @param string $ruleType see self::AUTOFILTER_RULETYPE_*
* *
* @return $this * @return $this
*/ */
public function setRuleType($pRuleType) public function setRuleType($ruleType)
{ {
if (!in_array($pRuleType, self::RULE_TYPES)) { if (!in_array($ruleType, self::RULE_TYPES)) {
throw new PhpSpreadsheetException('Invalid rule type for column AutoFilter Rule.'); throw new PhpSpreadsheetException('Invalid rule type for column AutoFilter Rule.');
} }
$this->ruleType = $pRuleType; $this->ruleType = $ruleType;
return $this; return $this;
} }
@ -326,22 +326,22 @@ class Rule
/** /**
* Set AutoFilter Rule Operator. * Set AutoFilter Rule Operator.
* *
* @param string $pOperator see self::AUTOFILTER_COLUMN_RULE_* * @param string $operator see self::AUTOFILTER_COLUMN_RULE_*
* *
* @return $this * @return $this
*/ */
public function setOperator($pOperator) public function setOperator($operator)
{ {
if (empty($pOperator)) { if (empty($operator)) {
$pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL; $operator = self::AUTOFILTER_COLUMN_RULE_EQUAL;
} }
if ( if (
(!in_array($pOperator, self::OPERATORS)) && (!in_array($operator, self::OPERATORS)) &&
(!in_array($pOperator, self::TOP_TEN_VALUE)) (!in_array($operator, self::TOP_TEN_VALUE))
) { ) {
throw new PhpSpreadsheetException('Invalid operator for column AutoFilter Rule.'); throw new PhpSpreadsheetException('Invalid operator for column AutoFilter Rule.');
} }
$this->operator = $pOperator; $this->operator = $operator;
return $this; return $this;
} }
@ -359,21 +359,21 @@ class Rule
/** /**
* Set AutoFilter Rule Grouping. * Set AutoFilter Rule Grouping.
* *
* @param string $pGrouping * @param string $grouping
* *
* @return $this * @return $this
*/ */
public function setGrouping($pGrouping) public function setGrouping($grouping)
{ {
if ( if (
($pGrouping !== null) && ($grouping !== null) &&
(!in_array($pGrouping, self::DATE_TIME_GROUPS)) && (!in_array($grouping, self::DATE_TIME_GROUPS)) &&
(!in_array($pGrouping, self::DYNAMIC_TYPES)) && (!in_array($grouping, self::DYNAMIC_TYPES)) &&
(!in_array($pGrouping, self::TOP_TEN_TYPE)) (!in_array($grouping, self::TOP_TEN_TYPE))
) { ) {
throw new PhpSpreadsheetException('Invalid grouping for column AutoFilter Rule.'); throw new PhpSpreadsheetException('Invalid grouping for column AutoFilter Rule.');
} }
$this->grouping = $pGrouping; $this->grouping = $grouping;
return $this; return $this;
} }
@ -381,21 +381,21 @@ class Rule
/** /**
* Set AutoFilter Rule. * Set AutoFilter Rule.
* *
* @param string $pOperator see self::AUTOFILTER_COLUMN_RULE_* * @param string $operator see self::AUTOFILTER_COLUMN_RULE_*
* @param int|int[]|string|string[] $pValue * @param int|int[]|string|string[] $value
* @param string $pGrouping * @param string $grouping
* *
* @return $this * @return $this
*/ */
public function setRule($pOperator, $pValue, $pGrouping = null) public function setRule($operator, $value, $grouping = null)
{ {
$this->setOperator($pOperator); $this->setOperator($operator);
$this->setValue($pValue); $this->setValue($value);
// Only set grouping if it's been passed in as a user-supplied argument, // Only set grouping if it's been passed in as a user-supplied argument,
// otherwise we're calculating it when we setValue() and don't want to overwrite that // otherwise we're calculating it when we setValue() and don't want to overwrite that
// If the user supplies an argumnet for grouping, then on their own head be it // If the user supplies an argumnet for grouping, then on their own head be it
if ($pGrouping !== null) { if ($grouping !== null) {
$this->setGrouping($pGrouping); $this->setGrouping($grouping);
} }
return $this; return $this;
@ -416,9 +416,9 @@ class Rule
* *
* @return $this * @return $this
*/ */
public function setParent(?Column $pParent = null) public function setParent(?Column $parent = null)
{ {
$this->parent = $pParent; $this->parent = $parent;
return $this; return $this;
} }

View File

@ -152,13 +152,13 @@ class BaseDrawing implements IComparable
/** /**
* Set Name. * Set Name.
* *
* @param string $pValue * @param string $name
* *
* @return $this * @return $this
*/ */
public function setName($pValue) public function setName($name)
{ {
$this->name = $pValue; $this->name = $name;
return $this; return $this;
} }
@ -200,20 +200,20 @@ class BaseDrawing implements IComparable
/** /**
* Set Worksheet. * Set Worksheet.
* *
* @param Worksheet $pValue * @param Worksheet $worksheet
* @param bool $pOverrideOld If a Worksheet has already been assigned, overwrite it and remove image from old Worksheet? * @param bool $overrideOld If a Worksheet has already been assigned, overwrite it and remove image from old Worksheet?
* *
* @return $this * @return $this
*/ */
public function setWorksheet(?Worksheet $pValue = null, $pOverrideOld = false) public function setWorksheet(?Worksheet $worksheet = null, $overrideOld = false)
{ {
if ($this->worksheet === null) { if ($this->worksheet === null) {
// Add drawing to \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet // Add drawing to \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
$this->worksheet = $pValue; $this->worksheet = $worksheet;
$this->worksheet->getCell($this->coordinates); $this->worksheet->getCell($this->coordinates);
$this->worksheet->getDrawingCollection()->append($this); $this->worksheet->getDrawingCollection()->append($this);
} else { } else {
if ($pOverrideOld) { if ($overrideOld) {
// Remove drawing from old \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet // Remove drawing from old \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
$iterator = $this->worksheet->getDrawingCollection()->getIterator(); $iterator = $this->worksheet->getDrawingCollection()->getIterator();
@ -227,7 +227,7 @@ class BaseDrawing implements IComparable
} }
// Set new \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet // Set new \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
$this->setWorksheet($pValue); $this->setWorksheet($worksheet);
} else { } else {
throw new PhpSpreadsheetException('A Worksheet has already been assigned. Drawings can only exist on one \\PhpOffice\\PhpSpreadsheet\\Worksheet.'); throw new PhpSpreadsheetException('A Worksheet has already been assigned. Drawings can only exist on one \\PhpOffice\\PhpSpreadsheet\\Worksheet.');
} }
@ -249,13 +249,13 @@ class BaseDrawing implements IComparable
/** /**
* Set Coordinates. * Set Coordinates.
* *
* @param string $pValue eg: 'A1' * @param string $coordinates eg: 'A1'
* *
* @return $this * @return $this
*/ */
public function setCoordinates($pValue) public function setCoordinates($coordinates)
{ {
$this->coordinates = $pValue; $this->coordinates = $coordinates;
return $this; return $this;
} }
@ -273,13 +273,13 @@ class BaseDrawing implements IComparable
/** /**
* Set OffsetX. * Set OffsetX.
* *
* @param int $pValue * @param int $offsetX
* *
* @return $this * @return $this
*/ */
public function setOffsetX($pValue) public function setOffsetX($offsetX)
{ {
$this->offsetX = $pValue; $this->offsetX = $offsetX;
return $this; return $this;
} }
@ -297,13 +297,13 @@ class BaseDrawing implements IComparable
/** /**
* Set OffsetY. * Set OffsetY.
* *
* @param int $pValue * @param int $offsetY
* *
* @return $this * @return $this
*/ */
public function setOffsetY($pValue) public function setOffsetY($offsetY)
{ {
$this->offsetY = $pValue; $this->offsetY = $offsetY;
return $this; return $this;
} }
@ -321,20 +321,20 @@ class BaseDrawing implements IComparable
/** /**
* Set Width. * Set Width.
* *
* @param int $pValue * @param int $width
* *
* @return $this * @return $this
*/ */
public function setWidth($pValue) public function setWidth($width)
{ {
// Resize proportional? // Resize proportional?
if ($this->resizeProportional && $pValue != 0) { if ($this->resizeProportional && $width != 0) {
$ratio = $this->height / ($this->width != 0 ? $this->width : 1); $ratio = $this->height / ($this->width != 0 ? $this->width : 1);
$this->height = (int) round($ratio * $pValue); $this->height = (int) round($ratio * $width);
} }
// Set width // Set width
$this->width = $pValue; $this->width = $width;
return $this; return $this;
} }
@ -352,20 +352,20 @@ class BaseDrawing implements IComparable
/** /**
* Set Height. * Set Height.
* *
* @param int $pValue * @param int $height
* *
* @return $this * @return $this
*/ */
public function setHeight($pValue) public function setHeight($height)
{ {
// Resize proportional? // Resize proportional?
if ($this->resizeProportional && $pValue != 0) { if ($this->resizeProportional && $height != 0) {
$ratio = $this->width / ($this->height != 0 ? $this->height : 1); $ratio = $this->width / ($this->height != 0 ? $this->height : 1);
$this->width = (int) round($ratio * $pValue); $this->width = (int) round($ratio * $height);
} }
// Set height // Set height
$this->height = $pValue; $this->height = $height;
return $this; return $this;
} }
@ -419,13 +419,13 @@ class BaseDrawing implements IComparable
/** /**
* Set ResizeProportional. * Set ResizeProportional.
* *
* @param bool $pValue * @param bool $resizeProportional
* *
* @return $this * @return $this
*/ */
public function setResizeProportional($pValue) public function setResizeProportional($resizeProportional)
{ {
$this->resizeProportional = $pValue; $this->resizeProportional = $resizeProportional;
return $this; return $this;
} }
@ -443,13 +443,13 @@ class BaseDrawing implements IComparable
/** /**
* Set Rotation. * Set Rotation.
* *
* @param int $pValue * @param int $rotation
* *
* @return $this * @return $this
*/ */
public function setRotation($pValue) public function setRotation($rotation)
{ {
$this->rotation = $pValue; $this->rotation = $rotation;
return $this; return $this;
} }
@ -467,13 +467,13 @@ class BaseDrawing implements IComparable
/** /**
* Set Shadow. * Set Shadow.
* *
* @param Drawing\Shadow $pValue * @param Drawing\Shadow $shadow
* *
* @return $this * @return $this
*/ */
public function setShadow(?Drawing\Shadow $pValue = null) public function setShadow(?Drawing\Shadow $shadow = null)
{ {
$this->shadow = $pValue; $this->shadow = $shadow;
return $this; return $this;
} }
@ -517,9 +517,9 @@ class BaseDrawing implements IComparable
} }
} }
public function setHyperlink(?Hyperlink $pHyperlink = null): void public function setHyperlink(?Hyperlink $hyperlink = null): void
{ {
$this->hyperlink = $pHyperlink; $this->hyperlink = $hyperlink;
} }
/** /**

View File

@ -32,12 +32,12 @@ class ColumnDimension extends Dimension
/** /**
* Create a new ColumnDimension. * Create a new ColumnDimension.
* *
* @param string $pIndex Character column index * @param string $index Character column index
*/ */
public function __construct($pIndex = 'A') public function __construct($index = 'A')
{ {
// Initialise values // Initialise values
$this->columnIndex = $pIndex; $this->columnIndex = $index;
// set dimension as unformatted by default // set dimension as unformatted by default
parent::__construct(0); parent::__construct(0);

View File

@ -125,9 +125,9 @@ abstract class Dimension
* *
* @return $this * @return $this
*/ */
public function setXfIndex(int $pValue) public function setXfIndex(int $XfIndex)
{ {
$this->xfIndex = $pValue; $this->xfIndex = $XfIndex;
return $this; return $this;
} }

View File

@ -81,20 +81,20 @@ class Drawing extends BaseDrawing
/** /**
* Set Path. * Set Path.
* *
* @param string $pValue File path * @param string $path File path
* @param bool $pVerifyFile Verify file * @param bool $verifyFile Verify file
* *
* @return $this * @return $this
*/ */
public function setPath($pValue, $pVerifyFile = true) public function setPath($path, $verifyFile = true)
{ {
if ($pVerifyFile) { if ($verifyFile) {
// Check if a URL has been passed. https://stackoverflow.com/a/2058596/1252979 // Check if a URL has been passed. https://stackoverflow.com/a/2058596/1252979
if (filter_var($pValue, FILTER_VALIDATE_URL)) { if (filter_var($path, FILTER_VALIDATE_URL)) {
$this->path = $pValue; $this->path = $path;
// Implicit that it is a URL, rather store info than running check above on value in other places. // Implicit that it is a URL, rather store info than running check above on value in other places.
$this->isUrl = true; $this->isUrl = true;
$imageContents = file_get_contents($pValue); $imageContents = file_get_contents($path);
$filePath = tempnam(sys_get_temp_dir(), 'Drawing'); $filePath = tempnam(sys_get_temp_dir(), 'Drawing');
if ($filePath) { if ($filePath) {
file_put_contents($filePath, $imageContents); file_put_contents($filePath, $imageContents);
@ -106,17 +106,17 @@ class Drawing extends BaseDrawing
unlink($filePath); unlink($filePath);
} }
} }
} elseif (file_exists($pValue)) { } elseif (file_exists($path)) {
$this->path = $pValue; $this->path = $path;
if ($this->width == 0 && $this->height == 0) { if ($this->width == 0 && $this->height == 0) {
// Get width/height // Get width/height
[$this->width, $this->height] = getimagesize($pValue); [$this->width, $this->height] = getimagesize($path);
} }
} else { } else {
throw new PhpSpreadsheetException("File $pValue not found!"); throw new PhpSpreadsheetException("File $path not found!");
} }
} else { } else {
$this->path = $pValue; $this->path = $path;
} }
return $this; return $this;

View File

@ -98,13 +98,13 @@ class Shadow implements IComparable
/** /**
* Set Visible. * Set Visible.
* *
* @param bool $pValue * @param bool $visible
* *
* @return $this * @return $this
*/ */
public function setVisible($pValue) public function setVisible($visible)
{ {
$this->visible = $pValue; $this->visible = $visible;
return $this; return $this;
} }
@ -122,13 +122,13 @@ class Shadow implements IComparable
/** /**
* Set Blur radius. * Set Blur radius.
* *
* @param int $pValue * @param int $blurRadius
* *
* @return $this * @return $this
*/ */
public function setBlurRadius($pValue) public function setBlurRadius($blurRadius)
{ {
$this->blurRadius = $pValue; $this->blurRadius = $blurRadius;
return $this; return $this;
} }
@ -146,13 +146,13 @@ class Shadow implements IComparable
/** /**
* Set Shadow distance. * Set Shadow distance.
* *
* @param int $pValue * @param int $distance
* *
* @return $this * @return $this
*/ */
public function setDistance($pValue) public function setDistance($distance)
{ {
$this->distance = $pValue; $this->distance = $distance;
return $this; return $this;
} }
@ -170,13 +170,13 @@ class Shadow implements IComparable
/** /**
* Set Shadow direction (in degrees). * Set Shadow direction (in degrees).
* *
* @param int $pValue * @param int $direction
* *
* @return $this * @return $this
*/ */
public function setDirection($pValue) public function setDirection($direction)
{ {
$this->direction = $pValue; $this->direction = $direction;
return $this; return $this;
} }
@ -194,13 +194,13 @@ class Shadow implements IComparable
/** /**
* Set Shadow alignment. * Set Shadow alignment.
* *
* @param string $pValue * @param string $alignment
* *
* @return $this * @return $this
*/ */
public function setAlignment($pValue) public function setAlignment($alignment)
{ {
$this->alignment = $pValue; $this->alignment = $alignment;
return $this; return $this;
} }
@ -218,13 +218,13 @@ class Shadow implements IComparable
/** /**
* Set Color. * Set Color.
* *
* @param Color $pValue * @param Color $color
* *
* @return $this * @return $this
*/ */
public function setColor(?Color $pValue = null) public function setColor(?Color $color = null)
{ {
$this->color = $pValue; $this->color = $color;
return $this; return $this;
} }
@ -242,13 +242,13 @@ class Shadow implements IComparable
/** /**
* Set Alpha. * Set Alpha.
* *
* @param int $pValue * @param int $alpha
* *
* @return $this * @return $this
*/ */
public function setAlpha($pValue) public function setAlpha($alpha)
{ {
$this->alpha = $pValue; $this->alpha = $alpha;
return $this; return $this;
} }

View File

@ -170,13 +170,13 @@ class HeaderFooter
/** /**
* Set OddHeader. * Set OddHeader.
* *
* @param string $pValue * @param string $oddHeader
* *
* @return $this * @return $this
*/ */
public function setOddHeader($pValue) public function setOddHeader($oddHeader)
{ {
$this->oddHeader = $pValue; $this->oddHeader = $oddHeader;
return $this; return $this;
} }
@ -194,13 +194,13 @@ class HeaderFooter
/** /**
* Set OddFooter. * Set OddFooter.
* *
* @param string $pValue * @param string $oddFooter
* *
* @return $this * @return $this
*/ */
public function setOddFooter($pValue) public function setOddFooter($oddFooter)
{ {
$this->oddFooter = $pValue; $this->oddFooter = $oddFooter;
return $this; return $this;
} }
@ -218,13 +218,13 @@ class HeaderFooter
/** /**
* Set EvenHeader. * Set EvenHeader.
* *
* @param string $pValue * @param string $eventHeader
* *
* @return $this * @return $this
*/ */
public function setEvenHeader($pValue) public function setEvenHeader($eventHeader)
{ {
$this->evenHeader = $pValue; $this->evenHeader = $eventHeader;
return $this; return $this;
} }
@ -242,13 +242,13 @@ class HeaderFooter
/** /**
* Set EvenFooter. * Set EvenFooter.
* *
* @param string $pValue * @param string $evenFooter
* *
* @return $this * @return $this
*/ */
public function setEvenFooter($pValue) public function setEvenFooter($evenFooter)
{ {
$this->evenFooter = $pValue; $this->evenFooter = $evenFooter;
return $this; return $this;
} }
@ -266,13 +266,13 @@ class HeaderFooter
/** /**
* Set FirstHeader. * Set FirstHeader.
* *
* @param string $pValue * @param string $firstHeader
* *
* @return $this * @return $this
*/ */
public function setFirstHeader($pValue) public function setFirstHeader($firstHeader)
{ {
$this->firstHeader = $pValue; $this->firstHeader = $firstHeader;
return $this; return $this;
} }
@ -290,13 +290,13 @@ class HeaderFooter
/** /**
* Set FirstFooter. * Set FirstFooter.
* *
* @param string $pValue * @param string $firstFooter
* *
* @return $this * @return $this
*/ */
public function setFirstFooter($pValue) public function setFirstFooter($firstFooter)
{ {
$this->firstFooter = $pValue; $this->firstFooter = $firstFooter;
return $this; return $this;
} }
@ -314,13 +314,13 @@ class HeaderFooter
/** /**
* Set DifferentOddEven. * Set DifferentOddEven.
* *
* @param bool $pValue * @param bool $differentOddEvent
* *
* @return $this * @return $this
*/ */
public function setDifferentOddEven($pValue) public function setDifferentOddEven($differentOddEvent)
{ {
$this->differentOddEven = $pValue; $this->differentOddEven = $differentOddEvent;
return $this; return $this;
} }
@ -338,13 +338,13 @@ class HeaderFooter
/** /**
* Set DifferentFirst. * Set DifferentFirst.
* *
* @param bool $pValue * @param bool $differentFirst
* *
* @return $this * @return $this
*/ */
public function setDifferentFirst($pValue) public function setDifferentFirst($differentFirst)
{ {
$this->differentFirst = $pValue; $this->differentFirst = $differentFirst;
return $this; return $this;
} }
@ -362,13 +362,13 @@ class HeaderFooter
/** /**
* Set ScaleWithDocument. * Set ScaleWithDocument.
* *
* @param bool $pValue * @param bool $scaleWithDocument
* *
* @return $this * @return $this
*/ */
public function setScaleWithDocument($pValue) public function setScaleWithDocument($scaleWithDocument)
{ {
$this->scaleWithDocument = $pValue; $this->scaleWithDocument = $scaleWithDocument;
return $this; return $this;
} }
@ -386,13 +386,13 @@ class HeaderFooter
/** /**
* Set AlignWithMargins. * Set AlignWithMargins.
* *
* @param bool $pValue * @param bool $alignWithMargins
* *
* @return $this * @return $this
*/ */
public function setAlignWithMargins($pValue) public function setAlignWithMargins($alignWithMargins)
{ {
$this->alignWithMargins = $pValue; $this->alignWithMargins = $alignWithMargins;
return $this; return $this;
} }

View File

@ -66,13 +66,13 @@ class PageMargins
/** /**
* Set Left. * Set Left.
* *
* @param float $pValue * @param float $left
* *
* @return $this * @return $this
*/ */
public function setLeft($pValue) public function setLeft($left)
{ {
$this->left = $pValue; $this->left = $left;
return $this; return $this;
} }
@ -90,13 +90,13 @@ class PageMargins
/** /**
* Set Right. * Set Right.
* *
* @param float $pValue * @param float $right
* *
* @return $this * @return $this
*/ */
public function setRight($pValue) public function setRight($right)
{ {
$this->right = $pValue; $this->right = $right;
return $this; return $this;
} }
@ -114,13 +114,13 @@ class PageMargins
/** /**
* Set Top. * Set Top.
* *
* @param float $pValue * @param float $top
* *
* @return $this * @return $this
*/ */
public function setTop($pValue) public function setTop($top)
{ {
$this->top = $pValue; $this->top = $top;
return $this; return $this;
} }
@ -138,13 +138,13 @@ class PageMargins
/** /**
* Set Bottom. * Set Bottom.
* *
* @param float $pValue * @param float $bottom
* *
* @return $this * @return $this
*/ */
public function setBottom($pValue) public function setBottom($bottom)
{ {
$this->bottom = $pValue; $this->bottom = $bottom;
return $this; return $this;
} }
@ -162,13 +162,13 @@ class PageMargins
/** /**
* Set Header. * Set Header.
* *
* @param float $pValue * @param float $header
* *
* @return $this * @return $this
*/ */
public function setHeader($pValue) public function setHeader($header)
{ {
$this->header = $pValue; $this->header = $header;
return $this; return $this;
} }
@ -186,13 +186,13 @@ class PageMargins
/** /**
* Set Footer. * Set Footer.
* *
* @param float $pValue * @param float $footer
* *
* @return $this * @return $this
*/ */
public function setFooter($pValue) public function setFooter($footer)
{ {
$this->footer = $pValue; $this->footer = $footer;
return $this; return $this;
} }

View File

@ -271,13 +271,13 @@ class PageSetup
/** /**
* Set Paper Size. * Set Paper Size.
* *
* @param int $pValue see self::PAPERSIZE_* * @param int $paperSize see self::PAPERSIZE_*
* *
* @return $this * @return $this
*/ */
public function setPaperSize($pValue) public function setPaperSize($paperSize)
{ {
$this->paperSize = $pValue; $this->paperSize = $paperSize;
return $this; return $this;
} }
@ -295,13 +295,13 @@ class PageSetup
/** /**
* Set Orientation. * Set Orientation.
* *
* @param string $pValue see self::ORIENTATION_* * @param string $orientation see self::ORIENTATION_*
* *
* @return $this * @return $this
*/ */
public function setOrientation($pValue) public function setOrientation($orientation)
{ {
$this->orientation = $pValue; $this->orientation = $orientation;
return $this; return $this;
} }
@ -321,18 +321,18 @@ 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 null|int $pValue * @param null|int $scale
* @param bool $pUpdate Update fitToPage so scaling applies rather than fitToHeight / fitToWidth * @param bool $update Update fitToPage so scaling applies rather than fitToHeight / fitToWidth
* *
* @return $this * @return $this
*/ */
public function setScale($pValue, $pUpdate = true) public function setScale($scale, $update = 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
if (($pValue >= 0) || $pValue === null) { if (($scale >= 0) || $scale === null) {
$this->scale = $pValue; $this->scale = $scale;
if ($pUpdate) { if ($update) {
$this->fitToPage = false; $this->fitToPage = false;
} }
} else { } else {
@ -355,13 +355,13 @@ class PageSetup
/** /**
* Set Fit To Page. * Set Fit To Page.
* *
* @param bool $pValue * @param bool $fitToPage
* *
* @return $this * @return $this
*/ */
public function setFitToPage($pValue) public function setFitToPage($fitToPage)
{ {
$this->fitToPage = $pValue; $this->fitToPage = $fitToPage;
return $this; return $this;
} }
@ -379,15 +379,15 @@ class PageSetup
/** /**
* Set Fit To Height. * Set Fit To Height.
* *
* @param null|int $pValue * @param null|int $fitToHeight
* @param bool $pUpdate Update fitToPage so it applies rather than scaling * @param bool $update Update fitToPage so it applies rather than scaling
* *
* @return $this * @return $this
*/ */
public function setFitToHeight($pValue, $pUpdate = true) public function setFitToHeight($fitToHeight, $update = true)
{ {
$this->fitToHeight = $pValue; $this->fitToHeight = $fitToHeight;
if ($pUpdate) { if ($update) {
$this->fitToPage = true; $this->fitToPage = true;
} }
@ -407,15 +407,15 @@ class PageSetup
/** /**
* Set Fit To Width. * Set Fit To Width.
* *
* @param null|int $pValue * @param null|int $value
* @param bool $pUpdate Update fitToPage so it applies rather than scaling * @param bool $update Update fitToPage so it applies rather than scaling
* *
* @return $this * @return $this
*/ */
public function setFitToWidth($pValue, $pUpdate = true) public function setFitToWidth($value, $update = true)
{ {
$this->fitToWidth = $pValue; $this->fitToWidth = $value;
if ($pUpdate) { if ($update) {
$this->fitToPage = true; $this->fitToPage = true;
} }
@ -451,13 +451,13 @@ class PageSetup
/** /**
* Set Columns to repeat at left. * Set Columns to repeat at left.
* *
* @param array $pValue Containing start column and end column, empty array if option unset * @param array $columnsToRepeatAtLeft Containing start column and end column, empty array if option unset
* *
* @return $this * @return $this
*/ */
public function setColumnsToRepeatAtLeft(array $pValue) public function setColumnsToRepeatAtLeft(array $columnsToRepeatAtLeft)
{ {
$this->columnsToRepeatAtLeft = $pValue; $this->columnsToRepeatAtLeft = $columnsToRepeatAtLeft;
return $this; return $this;
} }
@ -465,14 +465,14 @@ 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 eg: 'A' * @param string $start eg: 'A'
* @param string $pEnd eg: 'B' * @param string $end eg: 'B'
* *
* @return $this * @return $this
*/ */
public function setColumnsToRepeatAtLeftByStartAndEnd($pStart, $pEnd) public function setColumnsToRepeatAtLeftByStartAndEnd($start, $end)
{ {
$this->columnsToRepeatAtLeft = [$pStart, $pEnd]; $this->columnsToRepeatAtLeft = [$start, $end];
return $this; return $this;
} }
@ -506,13 +506,13 @@ class PageSetup
/** /**
* Set Rows to repeat at top. * Set Rows to repeat at top.
* *
* @param array $pValue Containing start column and end column, empty array if option unset * @param array $rowsToRepeatAtTop Containing start column and end column, empty array if option unset
* *
* @return $this * @return $this
*/ */
public function setRowsToRepeatAtTop(array $pValue) public function setRowsToRepeatAtTop(array $rowsToRepeatAtTop)
{ {
$this->rowsToRepeatAtTop = $pValue; $this->rowsToRepeatAtTop = $rowsToRepeatAtTop;
return $this; return $this;
} }
@ -520,14 +520,14 @@ 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 eg: 1 * @param int $start eg: 1
* @param int $pEnd eg: 1 * @param int $end eg: 1
* *
* @return $this * @return $this
*/ */
public function setRowsToRepeatAtTopByStartAndEnd($pStart, $pEnd) public function setRowsToRepeatAtTopByStartAndEnd($start, $end)
{ {
$this->rowsToRepeatAtTop = [$pStart, $pEnd]; $this->rowsToRepeatAtTop = [$start, $end];
return $this; return $this;
} }

View File

@ -202,13 +202,13 @@ class Protection
/** /**
* Set Sheet. * Set Sheet.
* *
* @param bool $pValue * @param bool $sheet
* *
* @return $this * @return $this
*/ */
public function setSheet($pValue) public function setSheet($sheet)
{ {
$this->sheet = $pValue; $this->sheet = $sheet;
return $this; return $this;
} }
@ -226,13 +226,13 @@ class Protection
/** /**
* Set Objects. * Set Objects.
* *
* @param bool $pValue * @param bool $objects
* *
* @return $this * @return $this
*/ */
public function setObjects($pValue) public function setObjects($objects)
{ {
$this->objects = $pValue; $this->objects = $objects;
return $this; return $this;
} }
@ -250,13 +250,13 @@ class Protection
/** /**
* Set Scenarios. * Set Scenarios.
* *
* @param bool $pValue * @param bool $scenarios
* *
* @return $this * @return $this
*/ */
public function setScenarios($pValue) public function setScenarios($scenarios)
{ {
$this->scenarios = $pValue; $this->scenarios = $scenarios;
return $this; return $this;
} }
@ -274,13 +274,13 @@ class Protection
/** /**
* Set FormatCells. * Set FormatCells.
* *
* @param bool $pValue * @param bool $formatCells
* *
* @return $this * @return $this
*/ */
public function setFormatCells($pValue) public function setFormatCells($formatCells)
{ {
$this->formatCells = $pValue; $this->formatCells = $formatCells;
return $this; return $this;
} }
@ -298,13 +298,13 @@ class Protection
/** /**
* Set FormatColumns. * Set FormatColumns.
* *
* @param bool $pValue * @param bool $formatColumns
* *
* @return $this * @return $this
*/ */
public function setFormatColumns($pValue) public function setFormatColumns($formatColumns)
{ {
$this->formatColumns = $pValue; $this->formatColumns = $formatColumns;
return $this; return $this;
} }
@ -322,13 +322,13 @@ class Protection
/** /**
* Set FormatRows. * Set FormatRows.
* *
* @param bool $pValue * @param bool $formatRows
* *
* @return $this * @return $this
*/ */
public function setFormatRows($pValue) public function setFormatRows($formatRows)
{ {
$this->formatRows = $pValue; $this->formatRows = $formatRows;
return $this; return $this;
} }
@ -346,13 +346,13 @@ class Protection
/** /**
* Set InsertColumns. * Set InsertColumns.
* *
* @param bool $pValue * @param bool $insertColumns
* *
* @return $this * @return $this
*/ */
public function setInsertColumns($pValue) public function setInsertColumns($insertColumns)
{ {
$this->insertColumns = $pValue; $this->insertColumns = $insertColumns;
return $this; return $this;
} }
@ -370,13 +370,13 @@ class Protection
/** /**
* Set InsertRows. * Set InsertRows.
* *
* @param bool $pValue * @param bool $insertRows
* *
* @return $this * @return $this
*/ */
public function setInsertRows($pValue) public function setInsertRows($insertRows)
{ {
$this->insertRows = $pValue; $this->insertRows = $insertRows;
return $this; return $this;
} }
@ -394,13 +394,13 @@ class Protection
/** /**
* Set InsertHyperlinks. * Set InsertHyperlinks.
* *
* @param bool $pValue * @param bool $insertHyperLinks
* *
* @return $this * @return $this
*/ */
public function setInsertHyperlinks($pValue) public function setInsertHyperlinks($insertHyperLinks)
{ {
$this->insertHyperlinks = $pValue; $this->insertHyperlinks = $insertHyperLinks;
return $this; return $this;
} }
@ -418,13 +418,13 @@ class Protection
/** /**
* Set DeleteColumns. * Set DeleteColumns.
* *
* @param bool $pValue * @param bool $deleteColumns
* *
* @return $this * @return $this
*/ */
public function setDeleteColumns($pValue) public function setDeleteColumns($deleteColumns)
{ {
$this->deleteColumns = $pValue; $this->deleteColumns = $deleteColumns;
return $this; return $this;
} }
@ -442,13 +442,13 @@ class Protection
/** /**
* Set DeleteRows. * Set DeleteRows.
* *
* @param bool $pValue * @param bool $deleteRows
* *
* @return $this * @return $this
*/ */
public function setDeleteRows($pValue) public function setDeleteRows($deleteRows)
{ {
$this->deleteRows = $pValue; $this->deleteRows = $deleteRows;
return $this; return $this;
} }
@ -466,13 +466,13 @@ class Protection
/** /**
* Set SelectLockedCells. * Set SelectLockedCells.
* *
* @param bool $pValue * @param bool $selectLockedCells
* *
* @return $this * @return $this
*/ */
public function setSelectLockedCells($pValue) public function setSelectLockedCells($selectLockedCells)
{ {
$this->selectLockedCells = $pValue; $this->selectLockedCells = $selectLockedCells;
return $this; return $this;
} }
@ -490,13 +490,13 @@ class Protection
/** /**
* Set Sort. * Set Sort.
* *
* @param bool $pValue * @param bool $sort
* *
* @return $this * @return $this
*/ */
public function setSort($pValue) public function setSort($sort)
{ {
$this->sort = $pValue; $this->sort = $sort;
return $this; return $this;
} }
@ -514,13 +514,13 @@ class Protection
/** /**
* Set AutoFilter. * Set AutoFilter.
* *
* @param bool $pValue * @param bool $autoFilter
* *
* @return $this * @return $this
*/ */
public function setAutoFilter($pValue) public function setAutoFilter($autoFilter)
{ {
$this->autoFilter = $pValue; $this->autoFilter = $autoFilter;
return $this; return $this;
} }
@ -538,13 +538,13 @@ class Protection
/** /**
* Set PivotTables. * Set PivotTables.
* *
* @param bool $pValue * @param bool $pivotTables
* *
* @return $this * @return $this
*/ */
public function setPivotTables($pValue) public function setPivotTables($pivotTables)
{ {
$this->pivotTables = $pValue; $this->pivotTables = $pivotTables;
return $this; return $this;
} }
@ -562,13 +562,13 @@ class Protection
/** /**
* Set SelectUnlockedCells. * Set SelectUnlockedCells.
* *
* @param bool $pValue * @param bool $selectUnlockedCells
* *
* @return $this * @return $this
*/ */
public function setSelectUnlockedCells($pValue) public function setSelectUnlockedCells($selectUnlockedCells)
{ {
$this->selectUnlockedCells = $pValue; $this->selectUnlockedCells = $selectUnlockedCells;
return $this; return $this;
} }
@ -586,20 +586,20 @@ class Protection
/** /**
* Set Password. * Set Password.
* *
* @param string $pValue * @param string $password
* @param bool $pAlreadyHashed If the password has already been hashed, set this to true * @param bool $alreadyHashed If the password has already been hashed, set this to true
* *
* @return $this * @return $this
*/ */
public function setPassword($pValue, $pAlreadyHashed = false) public function setPassword($password, $alreadyHashed = false)
{ {
if (!$pAlreadyHashed) { if (!$alreadyHashed) {
$salt = $this->generateSalt(); $salt = $this->generateSalt();
$this->setSalt($salt); $this->setSalt($salt);
$pValue = PasswordHasher::hashPassword($pValue, $this->getAlgorithm(), $this->getSalt(), $this->getSpinCount()); $password = PasswordHasher::hashPassword($password, $this->getAlgorithm(), $this->getSalt(), $this->getSpinCount());
} }
$this->password = $pValue; $this->password = $password;
return $this; return $this;
} }

View File

@ -32,12 +32,12 @@ class RowDimension extends Dimension
/** /**
* Create a new RowDimension. * Create a new RowDimension.
* *
* @param int $pIndex Numeric row index * @param int $index Numeric row index
*/ */
public function __construct($pIndex = 0) public function __construct($index = 0)
{ {
// Initialise values // Initialise values
$this->rowIndex = $pIndex; $this->rowIndex = $index;
// set dimension as unformatted by default // set dimension as unformatted by default
parent::__construct(null); parent::__construct(null);
@ -108,9 +108,9 @@ class RowDimension extends Dimension
* *
* @return $this * @return $this
*/ */
public function setZeroHeight(bool $pValue) public function setZeroHeight(bool $zeroHeight)
{ {
$this->zeroHeight = $pValue; $this->zeroHeight = $zeroHeight;
return $this; return $this;
} }