From 1b877abe54f29568298e2d05c570d31828e7a26e Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Sun, 7 Nov 2021 15:47:06 +0900 Subject: [PATCH] Rename more parameters --- .../Calculation/Calculation.php | 26 ++--- .../Calculation/Engine/Logger.php | 12 +- .../Calculation/FormulaParser.php | 18 +-- .../Calculation/FormulaToken.php | 14 +-- src/PhpSpreadsheet/Calculation/Functions.php | 12 +- src/PhpSpreadsheet/Reader/Csv.php | 4 +- src/PhpSpreadsheet/Reader/Gnumeric.php | 22 ++-- src/PhpSpreadsheet/Reader/Html.php | 24 ++-- src/PhpSpreadsheet/Reader/IReader.php | 14 +-- src/PhpSpreadsheet/Reader/Ods.php | 24 ++-- src/PhpSpreadsheet/Reader/Slk.php | 36 +++--- src/PhpSpreadsheet/Reader/Xls.php | 22 ++-- src/PhpSpreadsheet/Reader/Xml.php | 8 +- src/PhpSpreadsheet/Shared/Drawing.php | 8 +- .../Shared/Escher/DggContainer.php | 6 +- src/PhpSpreadsheet/Worksheet/AutoFilter.php | 52 ++++----- .../Worksheet/AutoFilter/Column.php | 84 +++++++------- .../Worksheet/AutoFilter/Column/Rule.php | 60 +++++----- src/PhpSpreadsheet/Worksheet/BaseDrawing.php | 78 ++++++------- .../Worksheet/ColumnDimension.php | 6 +- src/PhpSpreadsheet/Worksheet/Dimension.php | 4 +- src/PhpSpreadsheet/Worksheet/Drawing.php | 24 ++-- .../Worksheet/Drawing/Shadow.php | 42 +++---- src/PhpSpreadsheet/Worksheet/HeaderFooter.php | 60 +++++----- src/PhpSpreadsheet/Worksheet/PageMargins.php | 36 +++--- src/PhpSpreadsheet/Worksheet/PageSetup.php | 78 ++++++------- src/PhpSpreadsheet/Worksheet/Protection.php | 108 +++++++++--------- src/PhpSpreadsheet/Worksheet/RowDimension.php | 10 +- 28 files changed, 446 insertions(+), 446 deletions(-) diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php index 429c35cd..c4dfa3eb 100644 --- a/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/src/PhpSpreadsheet/Calculation/Calculation.php @@ -2893,11 +2893,11 @@ class Calculation /** * 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(); } @@ -5241,13 +5241,13 @@ class Calculation /** * Extract range values. * - * @param string $pRange String based range representation + * @param string $range String based range representation * @param Worksheet $worksheet Worksheet * @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. */ - public function extractCellRange(&$pRange = 'A1', ?Worksheet $worksheet = null, $resetLog = true) + public function extractCellRange(&$range = 'A1', ?Worksheet $worksheet = null, $resetLog = true) { // Return value $returnValue = []; @@ -5255,14 +5255,14 @@ class Calculation if ($worksheet !== null) { $worksheetName = $worksheet->getTitle(); - if (strpos($pRange, '!') !== false) { - [$worksheetName, $pRange] = Worksheet::extractSheetTitle($pRange, true); + if (strpos($range, '!') !== false) { + [$worksheetName, $range] = Worksheet::extractSheetTitle($range, true); $worksheet = $this->spreadsheet->getSheetByName($worksheetName); } // Extract range - $aReferences = Coordinate::extractAllCellReferencesInRange($pRange); - $pRange = "'" . $worksheetName . "'" . '!' . $pRange; + $aReferences = Coordinate::extractAllCellReferencesInRange($range); + $range = "'" . $worksheetName . "'" . '!' . $range; if (!isset($aReferences[1])) { $currentCol = ''; $currentRow = 0; @@ -5358,14 +5358,14 @@ class Calculation /** * Is a specific function implemented? * - * @param string $pFunction Function Name + * @param string $function Function Name * * @return bool */ - public function isImplemented($pFunction) + public function isImplemented($function) { - $pFunction = strtoupper($pFunction); - $notImplemented = !isset(self::$phpSpreadsheetFunctions[$pFunction]) || (is_array(self::$phpSpreadsheetFunctions[$pFunction]['functionCall']) && self::$phpSpreadsheetFunctions[$pFunction]['functionCall'][1] === 'DUMMY'); + $function = strtoupper($function); + $notImplemented = !isset(self::$phpSpreadsheetFunctions[$function]) || (is_array(self::$phpSpreadsheetFunctions[$function]['functionCall']) && self::$phpSpreadsheetFunctions[$function]['functionCall'][1] === 'DUMMY'); return !$notImplemented; } diff --git a/src/PhpSpreadsheet/Calculation/Engine/Logger.php b/src/PhpSpreadsheet/Calculation/Engine/Logger.php index 3c0f2377..7f4657c4 100644 --- a/src/PhpSpreadsheet/Calculation/Engine/Logger.php +++ b/src/PhpSpreadsheet/Calculation/Engine/Logger.php @@ -48,11 +48,11 @@ class Logger /** * 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. * - * @param bool $pValue + * @param bool $echoDebugLog */ - public function setEchoDebugLog($pValue): void + public function setEchoDebugLog($echoDebugLog): void { - $this->echoDebugLog = $pValue; + $this->echoDebugLog = $echoDebugLog; } /** diff --git a/src/PhpSpreadsheet/Calculation/FormulaParser.php b/src/PhpSpreadsheet/Calculation/FormulaParser.php index cd1402fd..fdb88909 100644 --- a/src/PhpSpreadsheet/Calculation/FormulaParser.php +++ b/src/PhpSpreadsheet/Calculation/FormulaParser.php @@ -61,17 +61,17 @@ class 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 - if ($pFormula === null) { + if ($formula === null) { throw new Exception('Invalid parameter passed: formula'); } // Initialise values - $this->formula = trim($pFormula); + $this->formula = trim($formula); // Parse! $this->parseToTokens(); } @@ -89,15 +89,15 @@ class FormulaParser /** * 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])) { - return $this->tokens[$pId]; + if (isset($this->tokens[$id])) { + return $this->tokens[$id]; } - throw new Exception("Token with id $pId does not exist."); + throw new Exception("Token with id $id does not exist."); } /** diff --git a/src/PhpSpreadsheet/Calculation/FormulaToken.php b/src/PhpSpreadsheet/Calculation/FormulaToken.php index 4d225de2..68e5eead 100644 --- a/src/PhpSpreadsheet/Calculation/FormulaToken.php +++ b/src/PhpSpreadsheet/Calculation/FormulaToken.php @@ -76,16 +76,16 @@ class FormulaToken /** * Create a new FormulaToken. * - * @param string $pValue - * @param string $pTokenType Token type (represented by TOKEN_TYPE_*) - * @param string $pTokenSubType Token Subtype (represented by TOKEN_SUBTYPE_*) + * @param string $value + * @param string $tokenType Token type (represented by TOKEN_TYPE_*) + * @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 - $this->value = $pValue; - $this->tokenType = $pTokenType; - $this->tokenSubType = $pTokenSubType; + $this->value = $value; + $this->tokenType = $tokenType; + $this->tokenSubType = $tokenSubType; } /** diff --git a/src/PhpSpreadsheet/Calculation/Functions.php b/src/PhpSpreadsheet/Calculation/Functions.php index 4c1e2ee4..75d4582b 100644 --- a/src/PhpSpreadsheet/Calculation/Functions.php +++ b/src/PhpSpreadsheet/Calculation/Functions.php @@ -685,27 +685,27 @@ class Functions 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(); $spreadsheet = $worksheet->getParent(); // Uppercase coordinate - $pCoordinatex = strtoupper($pCoordinate); + $pCoordinatex = strtoupper($coordinate); // Eliminate leading equal sign $pCoordinatex = Worksheet::pregReplace('/^=/', '', $pCoordinatex); $defined = $spreadsheet->getDefinedName($pCoordinatex, $worksheet); if ($defined !== null) { $worksheet2 = $defined->getWorkSheet(); 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); } } diff --git a/src/PhpSpreadsheet/Reader/Csv.php b/src/PhpSpreadsheet/Reader/Csv.php index 50426c4f..6d99cb1d 100644 --- a/src/PhpSpreadsheet/Reader/Csv.php +++ b/src/PhpSpreadsheet/Reader/Csv.php @@ -123,9 +123,9 @@ class Csv extends BaseReader return $this->inputEncoding; } - public function setFallbackEncoding(string $pValue): self + public function setFallbackEncoding(string $fallbackEncoding): self { - $this->fallbackEncoding = $pValue; + $this->fallbackEncoding = $fallbackEncoding; return $this; } diff --git a/src/PhpSpreadsheet/Reader/Gnumeric.php b/src/PhpSpreadsheet/Reader/Gnumeric.php index 673a8a07..9b03cdc9 100644 --- a/src/PhpSpreadsheet/Reader/Gnumeric.php +++ b/src/PhpSpreadsheet/Reader/Gnumeric.php @@ -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. * - * @param string $pFilename + * @param string $filename * * @return array */ - public function listWorksheetNames($pFilename) + public function listWorksheetNames($filename) { - File::assertFile($pFilename); + File::assertFile($filename); $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); $worksheetNames = []; @@ -132,16 +132,16 @@ class Gnumeric extends BaseReader /** * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns). * - * @param string $pFilename + * @param string $filename * * @return array */ - public function listWorksheetInfo($pFilename) + public function listWorksheetInfo($filename) { - File::assertFile($pFilename); + File::assertFile($filename); $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); $worksheetInfo = []; @@ -245,12 +245,12 @@ class Gnumeric extends BaseReader /** * 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; - 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()); $xml = self::testSimpleXml($xml2); diff --git a/src/PhpSpreadsheet/Reader/Html.php b/src/PhpSpreadsheet/Reader/Html.php index ac763c92..cd28cbb6 100644 --- a/src/PhpSpreadsheet/Reader/Html.php +++ b/src/PhpSpreadsheet/Reader/Html.php @@ -218,7 +218,7 @@ class Html extends BaseReader /** * Set input encoding. * - * @param string $pValue Input encoding, eg: 'ANSI' + * @param string $inputEncoding Input encoding, eg: 'ANSI' * * @return $this * @@ -226,9 +226,9 @@ class Html extends BaseReader * * @deprecated no use is made of this property */ - public function setInputEncoding($pValue) + public function setInputEncoding($inputEncoding) { - $this->inputEncoding = $pValue; + $this->inputEncoding = $inputEncoding; return $this; } @@ -650,28 +650,28 @@ class Html extends BaseReader /** * Loads PhpSpreadsheet from file into PhpSpreadsheet instance. * - * @param string $pFilename + * @param string $filename * * @return Spreadsheet */ - public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet) + public function loadIntoExisting($filename, Spreadsheet $spreadsheet) { // Validate - if (!$this->canRead($pFilename)) { - throw new Exception($pFilename . ' is an Invalid HTML file.'); + if (!$this->canRead($filename)) { + throw new Exception($filename . ' is an Invalid HTML file.'); } // Create a new DOM object $dom = new DOMDocument(); // Reload the HTML file into the DOM object 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)); } catch (Throwable $e) { $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); @@ -736,13 +736,13 @@ class Html extends BaseReader /** * Set sheet index. * - * @param int $pValue Sheet index + * @param int $sheetIndex Sheet index * * @return $this */ - public function setSheetIndex($pValue) + public function setSheetIndex($sheetIndex) { - $this->sheetIndex = $pValue; + $this->sheetIndex = $sheetIndex; return $this; } diff --git a/src/PhpSpreadsheet/Reader/IReader.php b/src/PhpSpreadsheet/Reader/IReader.php index 63059693..d73662b4 100644 --- a/src/PhpSpreadsheet/Reader/IReader.php +++ b/src/PhpSpreadsheet/Reader/IReader.php @@ -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 false (the default) to advise the Reader to read both data and formatting for cells. * - * @param bool $pValue + * @param bool $readDataOnly * * @return IReader */ - public function setReadDataOnly($pValue); + public function setReadDataOnly($readDataOnly); /** * 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 false to advise the Reader to ignore cells containing a null value or an empty string. * - * @param bool $pValue + * @param bool $readEmptyCells * * @return IReader */ - public function setReadEmptyCells($pValue); + public function setReadEmptyCells($readEmptyCells); /** * 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. * Set to false (the default) to discard charts. * - * @param bool $pValue + * @param bool $includeCharts * * @return IReader */ - public function setIncludeCharts($pValue); + public function setIncludeCharts($includeCharts); /** * Get which sheets to load @@ -118,7 +118,7 @@ interface IReader * * @return IReader */ - public function setReadFilter(IReadFilter $pValue); + public function setReadFilter(IReadFilter $readFilter); /** * Loads PhpSpreadsheet from file. diff --git a/src/PhpSpreadsheet/Reader/Ods.php b/src/PhpSpreadsheet/Reader/Ods.php index 80ad43c6..908e8327 100644 --- a/src/PhpSpreadsheet/Reader/Ods.php +++ b/src/PhpSpreadsheet/Reader/Ods.php @@ -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. * - * @param string $pFilename + * @param string $filename * * @return string[] */ - public function listWorksheetNames($pFilename) + public function listWorksheetNames($filename) { - File::assertFile($pFilename, self::INITIAL_FILE); + File::assertFile($filename, self::INITIAL_FILE); $worksheetNames = []; $xml = new XMLReader(); $xml->xml( - $this->securityScanner->scanFile('zip://' . realpath($pFilename) . '#' . self::INITIAL_FILE), + $this->securityScanner->scanFile('zip://' . realpath($filename) . '#' . self::INITIAL_FILE), null, Settings::getLibXmlLoaderOptions() ); @@ -131,19 +131,19 @@ class Ods extends BaseReader /** * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns). * - * @param string $pFilename + * @param string $filename * * @return array */ - public function listWorksheetInfo($pFilename) + public function listWorksheetInfo($filename) { - File::assertFile($pFilename, self::INITIAL_FILE); + File::assertFile($filename, self::INITIAL_FILE); $worksheetInfo = []; $xml = new XMLReader(); $xml->xml( - $this->securityScanner->scanFile('zip://' . realpath($pFilename) . '#' . self::INITIAL_FILE), + $this->securityScanner->scanFile('zip://' . realpath($filename) . '#' . self::INITIAL_FILE), null, Settings::getLibXmlLoaderOptions() ); @@ -234,16 +234,16 @@ class Ods extends BaseReader /** * Loads PhpSpreadsheet from file into PhpSpreadsheet instance. * - * @param string $pFilename + * @param string $filename * * @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->open($pFilename); + $zip->open($filename); // Meta diff --git a/src/PhpSpreadsheet/Reader/Slk.php b/src/PhpSpreadsheet/Reader/Slk.php index 5e1525d6..de3c6ce5 100644 --- a/src/PhpSpreadsheet/Reader/Slk.php +++ b/src/PhpSpreadsheet/Reader/Slk.php @@ -89,12 +89,12 @@ class Slk extends BaseReader return $hasDelimiter && $hasId; } - private function canReadOrBust(string $pFilename): void + private function canReadOrBust(string $filename): void { - if (!$this->canRead($pFilename)) { - throw new ReaderException($pFilename . ' is an Invalid SYLK file.'); + if (!$this->canRead($filename)) { + 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 * - * @param string $pValue Input encoding, eg: 'ANSI' + * @param string $inputEncoding Input encoding, eg: 'ANSI' * * @return $this * * @codeCoverageIgnore */ - public function setInputEncoding($pValue) + public function setInputEncoding($inputEncoding) { - $this->inputEncoding = $pValue; + $this->inputEncoding = $inputEncoding; return $this; } @@ -132,19 +132,19 @@ class Slk extends BaseReader /** * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns). * - * @param string $pFilename + * @param string $filename * * @return array */ - public function listWorksheetInfo($pFilename) + public function listWorksheetInfo($filename) { // Open file - $this->canReadOrBust($pFilename); + $this->canReadOrBust($filename); $fileHandle = $this->fileHandle; rewind($fileHandle); $worksheetInfo = []; - $worksheetInfo[0]['worksheetName'] = basename($pFilename, '.slk'); + $worksheetInfo[0]['worksheetName'] = basename($filename, '.slk'); // loop through one row (line) at a time in the file $rowIndex = 0; @@ -506,14 +506,14 @@ class Slk extends BaseReader /** * Loads PhpSpreadsheet from file into PhpSpreadsheet instance. * - * @param string $pFilename + * @param string $filename * * @return Spreadsheet */ - public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet) + public function loadIntoExisting($filename, Spreadsheet $spreadsheet) { // Open file - $this->canReadOrBust($pFilename); + $this->canReadOrBust($filename); $fileHandle = $this->fileHandle; rewind($fileHandle); @@ -522,7 +522,7 @@ class Slk extends BaseReader $spreadsheet->createSheet(); } $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 $column = $row = ''; @@ -583,13 +583,13 @@ class Slk extends BaseReader /** * Set sheet index. * - * @param int $pValue Sheet index + * @param int $sheetIndex Sheet index * * @return $this */ - public function setSheetIndex($pValue) + public function setSheetIndex($sheetIndex) { - $this->sheetIndex = $pValue; + $this->sheetIndex = $sheetIndex; return $this; } diff --git a/src/PhpSpreadsheet/Reader/Xls.php b/src/PhpSpreadsheet/Reader/Xls.php index 8a40f70b..11d5874d 100644 --- a/src/PhpSpreadsheet/Reader/Xls.php +++ b/src/PhpSpreadsheet/Reader/Xls.php @@ -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. * - * @param string $pFilename + * @param string $filename * * @return array */ - public function listWorksheetNames($pFilename) + public function listWorksheetNames($filename) { - File::assertFile($pFilename); + File::assertFile($filename); $worksheetNames = []; // Read the OLE file - $this->loadOLE($pFilename); + $this->loadOLE($filename); // total byte size of Excel data (workbook global substream + sheet substreams) $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). * - * @param string $pFilename + * @param string $filename * * @return array */ - public function listWorksheetInfo($pFilename) + public function listWorksheetInfo($filename) { - File::assertFile($pFilename); + File::assertFile($filename); $worksheetInfo = []; // Read the OLE file - $this->loadOLE($pFilename); + $this->loadOLE($filename); // total byte size of Excel data (workbook global substream + sheet substreams) $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. * - * @param string $pFilename + * @param string $filename */ - private function loadOLE($pFilename): void + private function loadOLE($filename): void { // OLE reader $ole = new OLERead(); // get excel data, - $ole->read($pFilename); + $ole->read($filename); // Get workbook data: workbook stream + sheet streams $this->data = $ole->getStream($ole->wrkbook); // Get summary information data diff --git a/src/PhpSpreadsheet/Reader/Xml.php b/src/PhpSpreadsheet/Reader/Xml.php index 7d9188a9..8552509e 100644 --- a/src/PhpSpreadsheet/Reader/Xml.php +++ b/src/PhpSpreadsheet/Reader/Xml.php @@ -103,20 +103,20 @@ class Xml extends BaseReader /** * Check if the file is a valid SimpleXML. * - * @param string $pFilename + * @param string $filename * * @return false|SimpleXMLElement */ - public function trySimpleXMLLoadString($pFilename) + public function trySimpleXMLLoadString($filename) { try { $xml = simplexml_load_string( - $this->securityScanner->scan($this->fileContents ?: file_get_contents($pFilename)), + $this->securityScanner->scan($this->fileContents ?: file_get_contents($filename)), 'SimpleXMLElement', Settings::getLibXmlLoaderOptions() ); } 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 = ''; diff --git a/src/PhpSpreadsheet/Shared/Drawing.php b/src/PhpSpreadsheet/Shared/Drawing.php index 1d2a1537..0d8ad618 100644 --- a/src/PhpSpreadsheet/Shared/Drawing.php +++ b/src/PhpSpreadsheet/Shared/Drawing.php @@ -67,15 +67,15 @@ class Drawing * Convert column width from (intrinsic) Excel units to pixels. * * @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 */ - public static function cellDimensionToPixels($cellWidth, \PhpOffice\PhpSpreadsheet\Style\Font $pDefaultFont) + public static function cellDimensionToPixels($cellWidth, \PhpOffice\PhpSpreadsheet\Style\Font $defaultFont) { // Font name and size - $name = $pDefaultFont->getName(); - $size = $pDefaultFont->getSize(); + $name = $defaultFont->getName(); + $size = $defaultFont->getSize(); if (isset(Font::$defaultColumnWidths[$name][$size])) { // Exact width can be determined diff --git a/src/PhpSpreadsheet/Shared/Escher/DggContainer.php b/src/PhpSpreadsheet/Shared/Escher/DggContainer.php index 1bd15b9e..36806aa6 100644 --- a/src/PhpSpreadsheet/Shared/Escher/DggContainer.php +++ b/src/PhpSpreadsheet/Shared/Escher/DggContainer.php @@ -166,10 +166,10 @@ class DggContainer /** * Set identifier clusters. [ => , ...]. * - * @param array $pValue + * @param array $IDCLs */ - public function setIDCLs($pValue): void + public function setIDCLs($IDCLs): void { - $this->IDCLs = $pValue; + $this->IDCLs = $IDCLs; } } diff --git a/src/PhpSpreadsheet/Worksheet/AutoFilter.php b/src/PhpSpreadsheet/Worksheet/AutoFilter.php index f9b16437..c852e093 100644 --- a/src/PhpSpreadsheet/Worksheet/AutoFilter.php +++ b/src/PhpSpreadsheet/Worksheet/AutoFilter.php @@ -38,12 +38,12 @@ class 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 */ - public function __construct($pRange = '', ?Worksheet $worksheet = null) + public function __construct($range = '', ?Worksheet $worksheet = null) { - $this->range = $pRange; + $this->range = $range; $this->workSheet = $worksheet; } @@ -84,15 +84,15 @@ class AutoFilter /** * Set AutoFilter Range. * - * @param string $pRange Cell range (i.e. A1:E10) + * @param string $range Cell range (i.e. A1:E10) * * @return $this */ - public function setRange($pRange) + public function setRange($range) { // extract coordinate - [$worksheet, $pRange] = Worksheet::extractSheetTitle($pRange, true); - if (empty($pRange)) { + [$worksheet, $range] = Worksheet::extractSheetTitle($range, true); + if (empty($range)) { // Discard all column rules $this->columns = []; $this->range = ''; @@ -100,11 +100,11 @@ class AutoFilter return $this; } - if (strpos($pRange, ':') === false) { + if (strpos($range, ':') === false) { 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 [$rangeStart, $rangeEnd] = Coordinate::rangeBoundaries($this->range); foreach ($this->columns as $key => $value) { @@ -152,44 +152,44 @@ class AutoFilter /** * 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 */ - public function getColumnOffset($pColumn) + public function getColumnOffset($column) { - return $this->testColumnInRange($pColumn); + return $this->testColumnInRange($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 */ - public function getColumn($pColumn) + public function getColumn($column) { - $this->testColumnInRange($pColumn); + $this->testColumnInRange($column); - if (!isset($this->columns[$pColumn])) { - $this->columns[$pColumn] = new AutoFilter\Column($pColumn, $this); + if (!isset($this->columns[$column])) { + $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. * - * @param int $pColumnOffset Column offset within range (starting from 0) + * @param int $columnOffset Column offset within range (starting from 0) * * @return AutoFilter\Column */ - public function getColumnByOffset($pColumnOffset) + public function getColumnByOffset($columnOffset) { [$rangeStart, $rangeEnd] = Coordinate::rangeBoundaries($this->range); - $pColumn = Coordinate::stringFromColumnIndex($rangeStart[0] + $pColumnOffset); + $pColumn = Coordinate::stringFromColumnIndex($rangeStart[0] + $columnOffset); return $this->getColumn($pColumn); } @@ -227,16 +227,16 @@ class AutoFilter /** * Clear a specified AutoFilter Column. * - * @param string $pColumn Column name (e.g. A) + * @param string $column Column name (e.g. A) * * @return $this */ - public function clearColumn($pColumn) + public function clearColumn($column) { - $this->testColumnInRange($pColumn); + $this->testColumnInRange($column); - if (isset($this->columns[$pColumn])) { - unset($this->columns[$pColumn]); + if (isset($this->columns[$column])) { + unset($this->columns[$column]); } return $this; diff --git a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php index 3c4bee47..48aead7d 100644 --- a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php +++ b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php @@ -91,13 +91,13 @@ class Column /** * Create a new Column. * - * @param string $pColumn Column (e.g. A) - * @param AutoFilter $pParent Autofilter for this column + * @param string $column Column (e.g. A) + * @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->parent = $pParent; + $this->columnIndex = $column; + $this->parent = $parent; } /** @@ -113,19 +113,19 @@ class Column /** * Set AutoFilter column index as string eg: 'A'. * - * @param string $pColumn Column (e.g. A) + * @param string $column Column (e.g. A) * * @return $this */ - public function setColumnIndex($pColumn) + public function setColumnIndex($column) { // Uppercase coordinate - $pColumn = strtoupper($pColumn); + $column = strtoupper($column); if ($this->parent !== null) { - $this->parent->testColumnInRange($pColumn); + $this->parent->testColumnInRange($column); } - $this->columnIndex = $pColumn; + $this->columnIndex = $column; return $this; } @@ -143,13 +143,13 @@ class Column /** * Set this Column's AutoFilter Parent. * - * @param AutoFilter $pParent + * @param AutoFilter $parent * * @return $this */ - public function setParent(?AutoFilter $pParent = null) + public function setParent(?AutoFilter $parent = null) { - $this->parent = $pParent; + $this->parent = $parent; return $this; } @@ -167,17 +167,17 @@ class Column /** * Set AutoFilter Type. * - * @param string $pFilterType + * @param string $filterType * * @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.'); } - $this->filterType = $pFilterType; + $this->filterType = $filterType; return $this; } @@ -195,19 +195,19 @@ class Column /** * Set AutoFilter Multiple Rules And/Or. * - * @param string $pJoin And/Or + * @param string $join And/Or * * @return $this */ - public function setJoin($pJoin) + public function setJoin($join) { // Lowercase And/Or - $pJoin = strtolower($pJoin); - if (!in_array($pJoin, self::$ruleJoins)) { + $join = strtolower($join); + if (!in_array($join, self::$ruleJoins)) { throw new PhpSpreadsheetException('Invalid rule connection for column AutoFilter.'); } - $this->join = $pJoin; + $this->join = $join; return $this; } @@ -229,14 +229,14 @@ class Column /** * Set An AutoFilter Attribute. * - * @param string $pName Attribute Name - * @param string $pValue Attribute Value + * @param string $name Attribute Name + * @param string $value Attribute Value * * @return $this */ - public function setAttribute($pName, $pValue) + public function setAttribute($name, $value) { - $this->attributes[$pName] = $pValue; + $this->attributes[$name] = $value; return $this; } @@ -254,14 +254,14 @@ class Column /** * Get specific AutoFilter Column Attribute. * - * @param string $pName Attribute Name + * @param string $name Attribute Name * * @return null|int|string */ - public function getAttribute($pName) + public function getAttribute($name) { - if (isset($this->attributes[$pName])) { - return $this->attributes[$pName]; + if (isset($this->attributes[$name])) { + return $this->attributes[$name]; } return null; @@ -285,17 +285,17 @@ class Column /** * 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 */ - public function getRule($pIndex) + public function getRule($index) { - if (!isset($this->ruleset[$pIndex])) { - $this->ruleset[$pIndex] = new Column\Rule($this); + if (!isset($this->ruleset[$index])) { + $this->ruleset[$index] = new Column\Rule($this); } - return $this->ruleset[$pIndex]; + return $this->ruleset[$index]; } /** @@ -315,10 +315,10 @@ class Column * * @return $this */ - public function addRule(Column\Rule $pRule) + public function addRule(Column\Rule $rule) { - $pRule->setParent($this); - $this->ruleset[] = $pRule; + $rule->setParent($this); + $this->ruleset[] = $rule; return $this; } @@ -327,14 +327,14 @@ class Column * Delete a specified AutoFilter Column Rule * 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 */ - public function deleteRule($pIndex) + public function deleteRule($index) { - if (isset($this->ruleset[$pIndex])) { - unset($this->ruleset[$pIndex]); + if (isset($this->ruleset[$index])) { + unset($this->ruleset[$index]); // If we've just deleted down to a single rule, then reset And/Or joining to Or if (count($this->ruleset) <= 1) { $this->setJoin(self::AUTOFILTER_COLUMN_JOIN_OR); diff --git a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php index 37ea070b..543a221e 100644 --- a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php +++ b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php @@ -238,9 +238,9 @@ class 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. * - * @param string $pRuleType see self::AUTOFILTER_RULETYPE_* + * @param string $ruleType see self::AUTOFILTER_RULETYPE_* * * @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.'); } - $this->ruleType = $pRuleType; + $this->ruleType = $ruleType; return $this; } @@ -326,22 +326,22 @@ class Rule /** * Set AutoFilter Rule Operator. * - * @param string $pOperator see self::AUTOFILTER_COLUMN_RULE_* + * @param string $operator see self::AUTOFILTER_COLUMN_RULE_* * * @return $this */ - public function setOperator($pOperator) + public function setOperator($operator) { - if (empty($pOperator)) { - $pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL; + if (empty($operator)) { + $operator = self::AUTOFILTER_COLUMN_RULE_EQUAL; } if ( - (!in_array($pOperator, self::OPERATORS)) && - (!in_array($pOperator, self::TOP_TEN_VALUE)) + (!in_array($operator, self::OPERATORS)) && + (!in_array($operator, self::TOP_TEN_VALUE)) ) { throw new PhpSpreadsheetException('Invalid operator for column AutoFilter Rule.'); } - $this->operator = $pOperator; + $this->operator = $operator; return $this; } @@ -359,21 +359,21 @@ class Rule /** * Set AutoFilter Rule Grouping. * - * @param string $pGrouping + * @param string $grouping * * @return $this */ - public function setGrouping($pGrouping) + public function setGrouping($grouping) { if ( - ($pGrouping !== null) && - (!in_array($pGrouping, self::DATE_TIME_GROUPS)) && - (!in_array($pGrouping, self::DYNAMIC_TYPES)) && - (!in_array($pGrouping, self::TOP_TEN_TYPE)) + ($grouping !== null) && + (!in_array($grouping, self::DATE_TIME_GROUPS)) && + (!in_array($grouping, self::DYNAMIC_TYPES)) && + (!in_array($grouping, self::TOP_TEN_TYPE)) ) { throw new PhpSpreadsheetException('Invalid grouping for column AutoFilter Rule.'); } - $this->grouping = $pGrouping; + $this->grouping = $grouping; return $this; } @@ -381,21 +381,21 @@ class Rule /** * Set AutoFilter Rule. * - * @param string $pOperator see self::AUTOFILTER_COLUMN_RULE_* - * @param int|int[]|string|string[] $pValue - * @param string $pGrouping + * @param string $operator see self::AUTOFILTER_COLUMN_RULE_* + * @param int|int[]|string|string[] $value + * @param string $grouping * * @return $this */ - public function setRule($pOperator, $pValue, $pGrouping = null) + public function setRule($operator, $value, $grouping = null) { - $this->setOperator($pOperator); - $this->setValue($pValue); + $this->setOperator($operator); + $this->setValue($value); // 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 // If the user supplies an argumnet for grouping, then on their own head be it - if ($pGrouping !== null) { - $this->setGrouping($pGrouping); + if ($grouping !== null) { + $this->setGrouping($grouping); } return $this; @@ -416,9 +416,9 @@ class Rule * * @return $this */ - public function setParent(?Column $pParent = null) + public function setParent(?Column $parent = null) { - $this->parent = $pParent; + $this->parent = $parent; return $this; } diff --git a/src/PhpSpreadsheet/Worksheet/BaseDrawing.php b/src/PhpSpreadsheet/Worksheet/BaseDrawing.php index 5829671b..7da39a51 100644 --- a/src/PhpSpreadsheet/Worksheet/BaseDrawing.php +++ b/src/PhpSpreadsheet/Worksheet/BaseDrawing.php @@ -152,13 +152,13 @@ class BaseDrawing implements IComparable /** * Set Name. * - * @param string $pValue + * @param string $name * * @return $this */ - public function setName($pValue) + public function setName($name) { - $this->name = $pValue; + $this->name = $name; return $this; } @@ -200,20 +200,20 @@ class BaseDrawing implements IComparable /** * Set Worksheet. * - * @param Worksheet $pValue - * @param bool $pOverrideOld If a Worksheet has already been assigned, overwrite it and remove image from old Worksheet? + * @param Worksheet $worksheet + * @param bool $overrideOld If a Worksheet has already been assigned, overwrite it and remove image from old Worksheet? * * @return $this */ - public function setWorksheet(?Worksheet $pValue = null, $pOverrideOld = false) + public function setWorksheet(?Worksheet $worksheet = null, $overrideOld = false) { if ($this->worksheet === null) { // Add drawing to \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet - $this->worksheet = $pValue; + $this->worksheet = $worksheet; $this->worksheet->getCell($this->coordinates); $this->worksheet->getDrawingCollection()->append($this); } else { - if ($pOverrideOld) { + if ($overrideOld) { // Remove drawing from old \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $iterator = $this->worksheet->getDrawingCollection()->getIterator(); @@ -227,7 +227,7 @@ class BaseDrawing implements IComparable } // Set new \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet - $this->setWorksheet($pValue); + $this->setWorksheet($worksheet); } else { 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. * - * @param string $pValue eg: 'A1' + * @param string $coordinates eg: 'A1' * * @return $this */ - public function setCoordinates($pValue) + public function setCoordinates($coordinates) { - $this->coordinates = $pValue; + $this->coordinates = $coordinates; return $this; } @@ -273,13 +273,13 @@ class BaseDrawing implements IComparable /** * Set OffsetX. * - * @param int $pValue + * @param int $offsetX * * @return $this */ - public function setOffsetX($pValue) + public function setOffsetX($offsetX) { - $this->offsetX = $pValue; + $this->offsetX = $offsetX; return $this; } @@ -297,13 +297,13 @@ class BaseDrawing implements IComparable /** * Set OffsetY. * - * @param int $pValue + * @param int $offsetY * * @return $this */ - public function setOffsetY($pValue) + public function setOffsetY($offsetY) { - $this->offsetY = $pValue; + $this->offsetY = $offsetY; return $this; } @@ -321,20 +321,20 @@ class BaseDrawing implements IComparable /** * Set Width. * - * @param int $pValue + * @param int $width * * @return $this */ - public function setWidth($pValue) + public function setWidth($width) { // Resize proportional? - if ($this->resizeProportional && $pValue != 0) { + if ($this->resizeProportional && $width != 0) { $ratio = $this->height / ($this->width != 0 ? $this->width : 1); - $this->height = (int) round($ratio * $pValue); + $this->height = (int) round($ratio * $width); } // Set width - $this->width = $pValue; + $this->width = $width; return $this; } @@ -352,20 +352,20 @@ class BaseDrawing implements IComparable /** * Set Height. * - * @param int $pValue + * @param int $height * * @return $this */ - public function setHeight($pValue) + public function setHeight($height) { // Resize proportional? - if ($this->resizeProportional && $pValue != 0) { + if ($this->resizeProportional && $height != 0) { $ratio = $this->width / ($this->height != 0 ? $this->height : 1); - $this->width = (int) round($ratio * $pValue); + $this->width = (int) round($ratio * $height); } // Set height - $this->height = $pValue; + $this->height = $height; return $this; } @@ -419,13 +419,13 @@ class BaseDrawing implements IComparable /** * Set ResizeProportional. * - * @param bool $pValue + * @param bool $resizeProportional * * @return $this */ - public function setResizeProportional($pValue) + public function setResizeProportional($resizeProportional) { - $this->resizeProportional = $pValue; + $this->resizeProportional = $resizeProportional; return $this; } @@ -443,13 +443,13 @@ class BaseDrawing implements IComparable /** * Set Rotation. * - * @param int $pValue + * @param int $rotation * * @return $this */ - public function setRotation($pValue) + public function setRotation($rotation) { - $this->rotation = $pValue; + $this->rotation = $rotation; return $this; } @@ -467,13 +467,13 @@ class BaseDrawing implements IComparable /** * Set Shadow. * - * @param Drawing\Shadow $pValue + * @param Drawing\Shadow $shadow * * @return $this */ - public function setShadow(?Drawing\Shadow $pValue = null) + public function setShadow(?Drawing\Shadow $shadow = null) { - $this->shadow = $pValue; + $this->shadow = $shadow; 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; } /** diff --git a/src/PhpSpreadsheet/Worksheet/ColumnDimension.php b/src/PhpSpreadsheet/Worksheet/ColumnDimension.php index 4ea30c8f..8a48f470 100644 --- a/src/PhpSpreadsheet/Worksheet/ColumnDimension.php +++ b/src/PhpSpreadsheet/Worksheet/ColumnDimension.php @@ -32,12 +32,12 @@ class ColumnDimension extends Dimension /** * 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 - $this->columnIndex = $pIndex; + $this->columnIndex = $index; // set dimension as unformatted by default parent::__construct(0); diff --git a/src/PhpSpreadsheet/Worksheet/Dimension.php b/src/PhpSpreadsheet/Worksheet/Dimension.php index 4b3a0da8..894ac19e 100644 --- a/src/PhpSpreadsheet/Worksheet/Dimension.php +++ b/src/PhpSpreadsheet/Worksheet/Dimension.php @@ -125,9 +125,9 @@ abstract class Dimension * * @return $this */ - public function setXfIndex(int $pValue) + public function setXfIndex(int $XfIndex) { - $this->xfIndex = $pValue; + $this->xfIndex = $XfIndex; return $this; } diff --git a/src/PhpSpreadsheet/Worksheet/Drawing.php b/src/PhpSpreadsheet/Worksheet/Drawing.php index a8cbb79d..704e7015 100644 --- a/src/PhpSpreadsheet/Worksheet/Drawing.php +++ b/src/PhpSpreadsheet/Worksheet/Drawing.php @@ -81,20 +81,20 @@ class Drawing extends BaseDrawing /** * Set Path. * - * @param string $pValue File path - * @param bool $pVerifyFile Verify file + * @param string $path File path + * @param bool $verifyFile Verify file * * @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 - if (filter_var($pValue, FILTER_VALIDATE_URL)) { - $this->path = $pValue; + if (filter_var($path, FILTER_VALIDATE_URL)) { + $this->path = $path; // Implicit that it is a URL, rather store info than running check above on value in other places. $this->isUrl = true; - $imageContents = file_get_contents($pValue); + $imageContents = file_get_contents($path); $filePath = tempnam(sys_get_temp_dir(), 'Drawing'); if ($filePath) { file_put_contents($filePath, $imageContents); @@ -106,17 +106,17 @@ class Drawing extends BaseDrawing unlink($filePath); } } - } elseif (file_exists($pValue)) { - $this->path = $pValue; + } elseif (file_exists($path)) { + $this->path = $path; if ($this->width == 0 && $this->height == 0) { // Get width/height - [$this->width, $this->height] = getimagesize($pValue); + [$this->width, $this->height] = getimagesize($path); } } else { - throw new PhpSpreadsheetException("File $pValue not found!"); + throw new PhpSpreadsheetException("File $path not found!"); } } else { - $this->path = $pValue; + $this->path = $path; } return $this; diff --git a/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php b/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php index 0557c83c..805fc8d3 100644 --- a/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php +++ b/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php @@ -98,13 +98,13 @@ class Shadow implements IComparable /** * Set Visible. * - * @param bool $pValue + * @param bool $visible * * @return $this */ - public function setVisible($pValue) + public function setVisible($visible) { - $this->visible = $pValue; + $this->visible = $visible; return $this; } @@ -122,13 +122,13 @@ class Shadow implements IComparable /** * Set Blur radius. * - * @param int $pValue + * @param int $blurRadius * * @return $this */ - public function setBlurRadius($pValue) + public function setBlurRadius($blurRadius) { - $this->blurRadius = $pValue; + $this->blurRadius = $blurRadius; return $this; } @@ -146,13 +146,13 @@ class Shadow implements IComparable /** * Set Shadow distance. * - * @param int $pValue + * @param int $distance * * @return $this */ - public function setDistance($pValue) + public function setDistance($distance) { - $this->distance = $pValue; + $this->distance = $distance; return $this; } @@ -170,13 +170,13 @@ class Shadow implements IComparable /** * Set Shadow direction (in degrees). * - * @param int $pValue + * @param int $direction * * @return $this */ - public function setDirection($pValue) + public function setDirection($direction) { - $this->direction = $pValue; + $this->direction = $direction; return $this; } @@ -194,13 +194,13 @@ class Shadow implements IComparable /** * Set Shadow alignment. * - * @param string $pValue + * @param string $alignment * * @return $this */ - public function setAlignment($pValue) + public function setAlignment($alignment) { - $this->alignment = $pValue; + $this->alignment = $alignment; return $this; } @@ -218,13 +218,13 @@ class Shadow implements IComparable /** * Set Color. * - * @param Color $pValue + * @param Color $color * * @return $this */ - public function setColor(?Color $pValue = null) + public function setColor(?Color $color = null) { - $this->color = $pValue; + $this->color = $color; return $this; } @@ -242,13 +242,13 @@ class Shadow implements IComparable /** * Set Alpha. * - * @param int $pValue + * @param int $alpha * * @return $this */ - public function setAlpha($pValue) + public function setAlpha($alpha) { - $this->alpha = $pValue; + $this->alpha = $alpha; return $this; } diff --git a/src/PhpSpreadsheet/Worksheet/HeaderFooter.php b/src/PhpSpreadsheet/Worksheet/HeaderFooter.php index cc37e7f5..c3504d83 100644 --- a/src/PhpSpreadsheet/Worksheet/HeaderFooter.php +++ b/src/PhpSpreadsheet/Worksheet/HeaderFooter.php @@ -170,13 +170,13 @@ class HeaderFooter /** * Set OddHeader. * - * @param string $pValue + * @param string $oddHeader * * @return $this */ - public function setOddHeader($pValue) + public function setOddHeader($oddHeader) { - $this->oddHeader = $pValue; + $this->oddHeader = $oddHeader; return $this; } @@ -194,13 +194,13 @@ class HeaderFooter /** * Set OddFooter. * - * @param string $pValue + * @param string $oddFooter * * @return $this */ - public function setOddFooter($pValue) + public function setOddFooter($oddFooter) { - $this->oddFooter = $pValue; + $this->oddFooter = $oddFooter; return $this; } @@ -218,13 +218,13 @@ class HeaderFooter /** * Set EvenHeader. * - * @param string $pValue + * @param string $eventHeader * * @return $this */ - public function setEvenHeader($pValue) + public function setEvenHeader($eventHeader) { - $this->evenHeader = $pValue; + $this->evenHeader = $eventHeader; return $this; } @@ -242,13 +242,13 @@ class HeaderFooter /** * Set EvenFooter. * - * @param string $pValue + * @param string $evenFooter * * @return $this */ - public function setEvenFooter($pValue) + public function setEvenFooter($evenFooter) { - $this->evenFooter = $pValue; + $this->evenFooter = $evenFooter; return $this; } @@ -266,13 +266,13 @@ class HeaderFooter /** * Set FirstHeader. * - * @param string $pValue + * @param string $firstHeader * * @return $this */ - public function setFirstHeader($pValue) + public function setFirstHeader($firstHeader) { - $this->firstHeader = $pValue; + $this->firstHeader = $firstHeader; return $this; } @@ -290,13 +290,13 @@ class HeaderFooter /** * Set FirstFooter. * - * @param string $pValue + * @param string $firstFooter * * @return $this */ - public function setFirstFooter($pValue) + public function setFirstFooter($firstFooter) { - $this->firstFooter = $pValue; + $this->firstFooter = $firstFooter; return $this; } @@ -314,13 +314,13 @@ class HeaderFooter /** * Set DifferentOddEven. * - * @param bool $pValue + * @param bool $differentOddEvent * * @return $this */ - public function setDifferentOddEven($pValue) + public function setDifferentOddEven($differentOddEvent) { - $this->differentOddEven = $pValue; + $this->differentOddEven = $differentOddEvent; return $this; } @@ -338,13 +338,13 @@ class HeaderFooter /** * Set DifferentFirst. * - * @param bool $pValue + * @param bool $differentFirst * * @return $this */ - public function setDifferentFirst($pValue) + public function setDifferentFirst($differentFirst) { - $this->differentFirst = $pValue; + $this->differentFirst = $differentFirst; return $this; } @@ -362,13 +362,13 @@ class HeaderFooter /** * Set ScaleWithDocument. * - * @param bool $pValue + * @param bool $scaleWithDocument * * @return $this */ - public function setScaleWithDocument($pValue) + public function setScaleWithDocument($scaleWithDocument) { - $this->scaleWithDocument = $pValue; + $this->scaleWithDocument = $scaleWithDocument; return $this; } @@ -386,13 +386,13 @@ class HeaderFooter /** * Set AlignWithMargins. * - * @param bool $pValue + * @param bool $alignWithMargins * * @return $this */ - public function setAlignWithMargins($pValue) + public function setAlignWithMargins($alignWithMargins) { - $this->alignWithMargins = $pValue; + $this->alignWithMargins = $alignWithMargins; return $this; } diff --git a/src/PhpSpreadsheet/Worksheet/PageMargins.php b/src/PhpSpreadsheet/Worksheet/PageMargins.php index a8297933..34e1145e 100644 --- a/src/PhpSpreadsheet/Worksheet/PageMargins.php +++ b/src/PhpSpreadsheet/Worksheet/PageMargins.php @@ -66,13 +66,13 @@ class PageMargins /** * Set Left. * - * @param float $pValue + * @param float $left * * @return $this */ - public function setLeft($pValue) + public function setLeft($left) { - $this->left = $pValue; + $this->left = $left; return $this; } @@ -90,13 +90,13 @@ class PageMargins /** * Set Right. * - * @param float $pValue + * @param float $right * * @return $this */ - public function setRight($pValue) + public function setRight($right) { - $this->right = $pValue; + $this->right = $right; return $this; } @@ -114,13 +114,13 @@ class PageMargins /** * Set Top. * - * @param float $pValue + * @param float $top * * @return $this */ - public function setTop($pValue) + public function setTop($top) { - $this->top = $pValue; + $this->top = $top; return $this; } @@ -138,13 +138,13 @@ class PageMargins /** * Set Bottom. * - * @param float $pValue + * @param float $bottom * * @return $this */ - public function setBottom($pValue) + public function setBottom($bottom) { - $this->bottom = $pValue; + $this->bottom = $bottom; return $this; } @@ -162,13 +162,13 @@ class PageMargins /** * Set Header. * - * @param float $pValue + * @param float $header * * @return $this */ - public function setHeader($pValue) + public function setHeader($header) { - $this->header = $pValue; + $this->header = $header; return $this; } @@ -186,13 +186,13 @@ class PageMargins /** * Set Footer. * - * @param float $pValue + * @param float $footer * * @return $this */ - public function setFooter($pValue) + public function setFooter($footer) { - $this->footer = $pValue; + $this->footer = $footer; return $this; } diff --git a/src/PhpSpreadsheet/Worksheet/PageSetup.php b/src/PhpSpreadsheet/Worksheet/PageSetup.php index 7f3f71dc..ec276b64 100644 --- a/src/PhpSpreadsheet/Worksheet/PageSetup.php +++ b/src/PhpSpreadsheet/Worksheet/PageSetup.php @@ -271,13 +271,13 @@ class PageSetup /** * Set Paper Size. * - * @param int $pValue see self::PAPERSIZE_* + * @param int $paperSize see self::PAPERSIZE_* * * @return $this */ - public function setPaperSize($pValue) + public function setPaperSize($paperSize) { - $this->paperSize = $pValue; + $this->paperSize = $paperSize; return $this; } @@ -295,13 +295,13 @@ class PageSetup /** * Set Orientation. * - * @param string $pValue see self::ORIENTATION_* + * @param string $orientation see self::ORIENTATION_* * * @return $this */ - public function setOrientation($pValue) + public function setOrientation($orientation) { - $this->orientation = $pValue; + $this->orientation = $orientation; return $this; } @@ -321,18 +321,18 @@ class PageSetup * Print scaling. Valid values range from 10 to 400 * This setting is overridden when fitToWidth and/or fitToHeight are in use. * - * @param null|int $pValue - * @param bool $pUpdate Update fitToPage so scaling applies rather than fitToHeight / fitToWidth + * @param null|int $scale + * @param bool $update Update fitToPage so scaling applies rather than fitToHeight / fitToWidth * * @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, // but it is apparently still able to handle any scale >= 0, where 0 results in 100 - if (($pValue >= 0) || $pValue === null) { - $this->scale = $pValue; - if ($pUpdate) { + if (($scale >= 0) || $scale === null) { + $this->scale = $scale; + if ($update) { $this->fitToPage = false; } } else { @@ -355,13 +355,13 @@ class PageSetup /** * Set Fit To Page. * - * @param bool $pValue + * @param bool $fitToPage * * @return $this */ - public function setFitToPage($pValue) + public function setFitToPage($fitToPage) { - $this->fitToPage = $pValue; + $this->fitToPage = $fitToPage; return $this; } @@ -379,15 +379,15 @@ class PageSetup /** * Set Fit To Height. * - * @param null|int $pValue - * @param bool $pUpdate Update fitToPage so it applies rather than scaling + * @param null|int $fitToHeight + * @param bool $update Update fitToPage so it applies rather than scaling * * @return $this */ - public function setFitToHeight($pValue, $pUpdate = true) + public function setFitToHeight($fitToHeight, $update = true) { - $this->fitToHeight = $pValue; - if ($pUpdate) { + $this->fitToHeight = $fitToHeight; + if ($update) { $this->fitToPage = true; } @@ -407,15 +407,15 @@ class PageSetup /** * Set Fit To Width. * - * @param null|int $pValue - * @param bool $pUpdate Update fitToPage so it applies rather than scaling + * @param null|int $value + * @param bool $update Update fitToPage so it applies rather than scaling * * @return $this */ - public function setFitToWidth($pValue, $pUpdate = true) + public function setFitToWidth($value, $update = true) { - $this->fitToWidth = $pValue; - if ($pUpdate) { + $this->fitToWidth = $value; + if ($update) { $this->fitToPage = true; } @@ -451,13 +451,13 @@ class PageSetup /** * 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 */ - public function setColumnsToRepeatAtLeft(array $pValue) + public function setColumnsToRepeatAtLeft(array $columnsToRepeatAtLeft) { - $this->columnsToRepeatAtLeft = $pValue; + $this->columnsToRepeatAtLeft = $columnsToRepeatAtLeft; return $this; } @@ -465,14 +465,14 @@ class PageSetup /** * Set Columns to repeat at left by start and end. * - * @param string $pStart eg: 'A' - * @param string $pEnd eg: 'B' + * @param string $start eg: 'A' + * @param string $end eg: 'B' * * @return $this */ - public function setColumnsToRepeatAtLeftByStartAndEnd($pStart, $pEnd) + public function setColumnsToRepeatAtLeftByStartAndEnd($start, $end) { - $this->columnsToRepeatAtLeft = [$pStart, $pEnd]; + $this->columnsToRepeatAtLeft = [$start, $end]; return $this; } @@ -506,13 +506,13 @@ class PageSetup /** * 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 */ - public function setRowsToRepeatAtTop(array $pValue) + public function setRowsToRepeatAtTop(array $rowsToRepeatAtTop) { - $this->rowsToRepeatAtTop = $pValue; + $this->rowsToRepeatAtTop = $rowsToRepeatAtTop; return $this; } @@ -520,14 +520,14 @@ class PageSetup /** * Set Rows to repeat at top by start and end. * - * @param int $pStart eg: 1 - * @param int $pEnd eg: 1 + * @param int $start eg: 1 + * @param int $end eg: 1 * * @return $this */ - public function setRowsToRepeatAtTopByStartAndEnd($pStart, $pEnd) + public function setRowsToRepeatAtTopByStartAndEnd($start, $end) { - $this->rowsToRepeatAtTop = [$pStart, $pEnd]; + $this->rowsToRepeatAtTop = [$start, $end]; return $this; } diff --git a/src/PhpSpreadsheet/Worksheet/Protection.php b/src/PhpSpreadsheet/Worksheet/Protection.php index ba3af0a7..4d44d8e5 100644 --- a/src/PhpSpreadsheet/Worksheet/Protection.php +++ b/src/PhpSpreadsheet/Worksheet/Protection.php @@ -202,13 +202,13 @@ class Protection /** * Set Sheet. * - * @param bool $pValue + * @param bool $sheet * * @return $this */ - public function setSheet($pValue) + public function setSheet($sheet) { - $this->sheet = $pValue; + $this->sheet = $sheet; return $this; } @@ -226,13 +226,13 @@ class Protection /** * Set Objects. * - * @param bool $pValue + * @param bool $objects * * @return $this */ - public function setObjects($pValue) + public function setObjects($objects) { - $this->objects = $pValue; + $this->objects = $objects; return $this; } @@ -250,13 +250,13 @@ class Protection /** * Set Scenarios. * - * @param bool $pValue + * @param bool $scenarios * * @return $this */ - public function setScenarios($pValue) + public function setScenarios($scenarios) { - $this->scenarios = $pValue; + $this->scenarios = $scenarios; return $this; } @@ -274,13 +274,13 @@ class Protection /** * Set FormatCells. * - * @param bool $pValue + * @param bool $formatCells * * @return $this */ - public function setFormatCells($pValue) + public function setFormatCells($formatCells) { - $this->formatCells = $pValue; + $this->formatCells = $formatCells; return $this; } @@ -298,13 +298,13 @@ class Protection /** * Set FormatColumns. * - * @param bool $pValue + * @param bool $formatColumns * * @return $this */ - public function setFormatColumns($pValue) + public function setFormatColumns($formatColumns) { - $this->formatColumns = $pValue; + $this->formatColumns = $formatColumns; return $this; } @@ -322,13 +322,13 @@ class Protection /** * Set FormatRows. * - * @param bool $pValue + * @param bool $formatRows * * @return $this */ - public function setFormatRows($pValue) + public function setFormatRows($formatRows) { - $this->formatRows = $pValue; + $this->formatRows = $formatRows; return $this; } @@ -346,13 +346,13 @@ class Protection /** * Set InsertColumns. * - * @param bool $pValue + * @param bool $insertColumns * * @return $this */ - public function setInsertColumns($pValue) + public function setInsertColumns($insertColumns) { - $this->insertColumns = $pValue; + $this->insertColumns = $insertColumns; return $this; } @@ -370,13 +370,13 @@ class Protection /** * Set InsertRows. * - * @param bool $pValue + * @param bool $insertRows * * @return $this */ - public function setInsertRows($pValue) + public function setInsertRows($insertRows) { - $this->insertRows = $pValue; + $this->insertRows = $insertRows; return $this; } @@ -394,13 +394,13 @@ class Protection /** * Set InsertHyperlinks. * - * @param bool $pValue + * @param bool $insertHyperLinks * * @return $this */ - public function setInsertHyperlinks($pValue) + public function setInsertHyperlinks($insertHyperLinks) { - $this->insertHyperlinks = $pValue; + $this->insertHyperlinks = $insertHyperLinks; return $this; } @@ -418,13 +418,13 @@ class Protection /** * Set DeleteColumns. * - * @param bool $pValue + * @param bool $deleteColumns * * @return $this */ - public function setDeleteColumns($pValue) + public function setDeleteColumns($deleteColumns) { - $this->deleteColumns = $pValue; + $this->deleteColumns = $deleteColumns; return $this; } @@ -442,13 +442,13 @@ class Protection /** * Set DeleteRows. * - * @param bool $pValue + * @param bool $deleteRows * * @return $this */ - public function setDeleteRows($pValue) + public function setDeleteRows($deleteRows) { - $this->deleteRows = $pValue; + $this->deleteRows = $deleteRows; return $this; } @@ -466,13 +466,13 @@ class Protection /** * Set SelectLockedCells. * - * @param bool $pValue + * @param bool $selectLockedCells * * @return $this */ - public function setSelectLockedCells($pValue) + public function setSelectLockedCells($selectLockedCells) { - $this->selectLockedCells = $pValue; + $this->selectLockedCells = $selectLockedCells; return $this; } @@ -490,13 +490,13 @@ class Protection /** * Set Sort. * - * @param bool $pValue + * @param bool $sort * * @return $this */ - public function setSort($pValue) + public function setSort($sort) { - $this->sort = $pValue; + $this->sort = $sort; return $this; } @@ -514,13 +514,13 @@ class Protection /** * Set AutoFilter. * - * @param bool $pValue + * @param bool $autoFilter * * @return $this */ - public function setAutoFilter($pValue) + public function setAutoFilter($autoFilter) { - $this->autoFilter = $pValue; + $this->autoFilter = $autoFilter; return $this; } @@ -538,13 +538,13 @@ class Protection /** * Set PivotTables. * - * @param bool $pValue + * @param bool $pivotTables * * @return $this */ - public function setPivotTables($pValue) + public function setPivotTables($pivotTables) { - $this->pivotTables = $pValue; + $this->pivotTables = $pivotTables; return $this; } @@ -562,13 +562,13 @@ class Protection /** * Set SelectUnlockedCells. * - * @param bool $pValue + * @param bool $selectUnlockedCells * * @return $this */ - public function setSelectUnlockedCells($pValue) + public function setSelectUnlockedCells($selectUnlockedCells) { - $this->selectUnlockedCells = $pValue; + $this->selectUnlockedCells = $selectUnlockedCells; return $this; } @@ -586,20 +586,20 @@ class Protection /** * Set Password. * - * @param string $pValue - * @param bool $pAlreadyHashed If the password has already been hashed, set this to true + * @param string $password + * @param bool $alreadyHashed If the password has already been hashed, set this to true * * @return $this */ - public function setPassword($pValue, $pAlreadyHashed = false) + public function setPassword($password, $alreadyHashed = false) { - if (!$pAlreadyHashed) { + if (!$alreadyHashed) { $salt = $this->generateSalt(); $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; } diff --git a/src/PhpSpreadsheet/Worksheet/RowDimension.php b/src/PhpSpreadsheet/Worksheet/RowDimension.php index 006157b2..1d8aada8 100644 --- a/src/PhpSpreadsheet/Worksheet/RowDimension.php +++ b/src/PhpSpreadsheet/Worksheet/RowDimension.php @@ -32,12 +32,12 @@ class RowDimension extends Dimension /** * 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 - $this->rowIndex = $pIndex; + $this->rowIndex = $index; // set dimension as unformatted by default parent::__construct(null); @@ -108,9 +108,9 @@ class RowDimension extends Dimension * * @return $this */ - public function setZeroHeight(bool $pValue) + public function setZeroHeight(bool $zeroHeight) { - $this->zeroHeight = $pValue; + $this->zeroHeight = $zeroHeight; return $this; }