From 603b92e8273aa4ef35b6bb7adfa1231507a6cfd1 Mon Sep 17 00:00:00 2001 From: Robin van der Vliet Date: Sun, 9 Nov 2025 17:10:55 +0100 Subject: [PATCH] Fix lots of typos throughout codebase --- .../Calculation/BinaryComparison.php | 2 +- .../Calculation/DateTimeExcel/Date.php | 2 +- .../Calculation/DateTimeExcel/DateValue.php | 2 +- .../Calculation/DateTimeExcel/Days360.php | 2 +- .../Calculation/Engineering/ConvertDecimal.php | 2 +- .../Calculation/Engineering/ErfC.php | 2 +- .../CashFlow/Constant/Periodic/Interest.php | 2 +- .../Calculation/LookupRef/ExcelMatch.php | 2 +- .../Calculation/LookupRef/Offset.php | 4 ++-- .../Calculation/LookupRef/Sort.php | 2 +- .../Calculation/MathTrig/Arabic.php | 2 +- .../Statistical/Distributions/Beta.php | 4 ++-- .../Statistical/Distributions/Binomial.php | 2 +- .../Statistical/Distributions/Normal.php | 2 +- .../Calculation/TextData/Search.php | 4 ++-- src/PhpSpreadsheet/Cell/Coordinate.php | 4 ++-- src/PhpSpreadsheet/Chart/Legend.php | 4 ++-- src/PhpSpreadsheet/Chart/Renderer/JpGraph.php | 2 +- .../Chart/Renderer/JpGraphRendererBase.php | 2 +- src/PhpSpreadsheet/Reader/Csv/Delimiter.php | 14 +++++++------- src/PhpSpreadsheet/Reader/Gnumeric/Styles.php | 2 +- src/PhpSpreadsheet/Reader/Html.php | 2 +- src/PhpSpreadsheet/Reader/Xls/Biff8.php | 4 ++-- .../Reader/Xls/LoadSpreadsheet.php | 6 +++--- src/PhpSpreadsheet/Reader/Xls/RC4.php | 2 +- src/PhpSpreadsheet/Reader/Xlsx/WorkbookView.php | 2 +- src/PhpSpreadsheet/Shared/CodePage.php | 2 +- .../Shared/Escher/DggContainer.php | 2 +- src/PhpSpreadsheet/Shared/OLE.php | 2 +- src/PhpSpreadsheet/Shared/OLE/PPS/Root.php | 2 +- src/PhpSpreadsheet/Shared/OLERead.php | 2 +- src/PhpSpreadsheet/Shared/StringHelper.php | 2 +- src/PhpSpreadsheet/Spreadsheet.php | 16 ++++++++-------- src/PhpSpreadsheet/Style/Alignment.php | 4 ++-- .../Style/NumberFormat/Formatter.php | 2 +- .../Style/NumberFormat/NumberFormatter.php | 2 +- src/PhpSpreadsheet/Style/RgbTint.php | 2 +- src/PhpSpreadsheet/Worksheet/AutoFilter.php | 2 +- .../Worksheet/AutoFilter/Column/Rule.php | 4 ++-- src/PhpSpreadsheet/Worksheet/Drawing.php | 2 +- src/PhpSpreadsheet/Worksheet/HeaderFooter.php | 2 +- src/PhpSpreadsheet/Worksheet/PageSetup.php | 4 ++-- src/PhpSpreadsheet/Worksheet/Table.php | 4 ++-- src/PhpSpreadsheet/Writer/Csv.php | 6 +++--- src/PhpSpreadsheet/Writer/Html.php | 2 +- src/PhpSpreadsheet/Writer/Ods/Formula.php | 2 +- src/PhpSpreadsheet/Writer/Xls.php | 8 ++++---- src/PhpSpreadsheet/Writer/Xls/Parser.php | 6 +++--- src/PhpSpreadsheet/Writer/Xls/Workbook.php | 2 +- src/PhpSpreadsheet/Writer/Xls/Worksheet.php | 4 ++-- src/PhpSpreadsheet/Writer/Xls/Xf.php | 2 +- src/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php | 8 ++++---- src/PhpSpreadsheet/Writer/Xlsx/Rels.php | 4 ++-- .../Worksheet/Table/RemoveTableTest.php | 2 +- .../Worksheet/Table/TableTest.php | 4 ++-- .../Writer/Xlsx/DrawingsTest.php | 2 +- 56 files changed, 94 insertions(+), 94 deletions(-) diff --git a/src/PhpSpreadsheet/Calculation/BinaryComparison.php b/src/PhpSpreadsheet/Calculation/BinaryComparison.php index 1f697946c..2edd5dea0 100644 --- a/src/PhpSpreadsheet/Calculation/BinaryComparison.php +++ b/src/PhpSpreadsheet/Calculation/BinaryComparison.php @@ -51,7 +51,7 @@ class BinaryComparison $operand2 = Calculation::unwrapResult($operand2); } - // Use case insensitive comparaison if not OpenOffice mode + // Use case-insensitive comparison if not OpenOffice mode if (Functions::getCompatibilityMode() != Functions::COMPATIBILITY_OPENOFFICE) { if (is_string($operand1)) { $operand1 = StringHelper::strToUpper($operand1); diff --git a/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php b/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php index 9a6faf326..6ee9d7e55 100644 --- a/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php +++ b/src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php @@ -24,7 +24,7 @@ class Date * Excel Function: * DATE(year,month,day) * - * PhpSpreadsheet is a lot more forgiving than MS Excel when passing non numeric values to this function. + * PhpSpreadsheet is a lot more forgiving than MS Excel when passing non-numeric values to this function. * A Month name or abbreviation (English only at this point) such as 'January' or 'Jan' will still be accepted, * as will a day value with a suffix (e.g. '21st' rather than simply 21); again only English language. * diff --git a/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php b/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php index d29ed6bae..40356924e 100644 --- a/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php +++ b/src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php @@ -118,7 +118,7 @@ class DateValue if (!Helpers::dateParseSucceeded($PHPDateArray)) { // If original count was 1, we've already returned. // If it was 2, we added another. - // Therefore, neither of the first 2 stroks below can fail. + // Therefore, neither of the first 2 strtoks below can fail. $testVal1 = strtok($dateValue, '- '); $testVal2 = strtok('- '); $testVal3 = strtok('- ') ?: $dti->format('Y'); diff --git a/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days360.php b/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days360.php index 2ccadf53f..58eb68de6 100644 --- a/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days360.php +++ b/src/PhpSpreadsheet/Calculation/DateTimeExcel/Days360.php @@ -76,7 +76,7 @@ class Days360 } /** - * Return the number of days between two dates based on a 360 day calendar. + * Return the number of days between two dates based on a 360-day calendar. */ private static function dateDiff360(int $startDay, int $startMonth, int $startYear, int $endDay, int $endMonth, int $endYear, bool $methodUS): int { diff --git a/src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php b/src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php index 9834bccbb..3513840fb 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php @@ -150,7 +150,7 @@ class ConvertDecimal extends ConvertBase /** * toOctal. * - * Return an decimal value as octal. + * Return a decimal value as octal. * * Excel Function: * DEC2OCT(x[,places]) diff --git a/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php b/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php index 4cca2d6b9..db104bfac 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php @@ -18,7 +18,7 @@ class ErfC * Note: In Excel 2007 or earlier, if you input a negative value for the lower bound argument, * the function would return a #NUM! error. However, in Excel 2010, the function algorithm was * improved, so that it can now calculate the function for both positive and negative x values. - * PhpSpreadsheet follows Excel 2010 behaviour, and accepts nagative arguments. + * PhpSpreadsheet follows Excel 2010 behaviour, and accepts negative arguments. * * Excel Function: * ERFC(x) diff --git a/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Interest.php b/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Interest.php index 68ac57b8a..33031ccba 100644 --- a/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Interest.php +++ b/src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/Interest.php @@ -83,7 +83,7 @@ class Interest * =ISPMT(interest_rate, period, number_payments, pv) * * @param mixed $interestRate is the interest rate for the investment - * @param mixed $period is the period to calculate the interest rate. It must be betweeen 1 and number_payments. + * @param mixed $period is the period to calculate the interest rate. It must be between 1 and number_payments. * @param mixed $numberOfPeriods is the number of payments for the annuity * @param mixed $principleRemaining is the loan amount or present value of the payments */ diff --git a/src/PhpSpreadsheet/Calculation/LookupRef/ExcelMatch.php b/src/PhpSpreadsheet/Calculation/LookupRef/ExcelMatch.php index 3a1a6c41b..b7e0f9de7 100644 --- a/src/PhpSpreadsheet/Calculation/LookupRef/ExcelMatch.php +++ b/src/PhpSpreadsheet/Calculation/LookupRef/ExcelMatch.php @@ -58,7 +58,7 @@ class ExcelMatch return $e->getMessage(); } - // MATCH() is not case sensitive, so we convert lookup value to be lower cased if it's a string type. + // MATCH() is not case-sensitive, so we convert lookup value to be lower cased if it's a string type. if (is_string($lookupValue)) { $lookupValue = StringHelper::strToLower($lookupValue); } diff --git a/src/PhpSpreadsheet/Calculation/LookupRef/Offset.php b/src/PhpSpreadsheet/Calculation/LookupRef/Offset.php index 6b0726231..830010f15 100644 --- a/src/PhpSpreadsheet/Calculation/LookupRef/Offset.php +++ b/src/PhpSpreadsheet/Calculation/LookupRef/Offset.php @@ -84,7 +84,7 @@ class Offset $endCellColumn = self::adjustEndCellColumnForWidth($endCellColumn, $width, $startCellColumn, $columns); $startCellColumn = Coordinate::stringFromColumnIndex($startCellColumn + 1); - $endCellRow = self::adustEndCellRowForHeight($height, $startCellRow, $rows, $endCellRow); + $endCellRow = self::adjustEndCellRowForHeight($height, $startCellRow, $rows, $endCellRow); if (($endCellRow <= 0) || ($endCellColumn < 0)) { return ExcelError::REF(); @@ -152,7 +152,7 @@ class Offset * @param null|object|scalar $height * @param scalar $rows */ - private static function adustEndCellRowForHeight($height, int $startCellRow, $rows, int $endCellRow): int + private static function adjustEndCellRowForHeight($height, int $startCellRow, $rows, int $endCellRow): int { if (($height !== null) && (!is_object($height))) { $endCellRow = $startCellRow + (int) $height - 1; diff --git a/src/PhpSpreadsheet/Calculation/LookupRef/Sort.php b/src/PhpSpreadsheet/Calculation/LookupRef/Sort.php index 78a30a4d7..b640f7d9a 100644 --- a/src/PhpSpreadsheet/Calculation/LookupRef/Sort.php +++ b/src/PhpSpreadsheet/Calculation/LookupRef/Sort.php @@ -55,7 +55,7 @@ class Sort extends LookupRefValidations return $e->getMessage(); } - // We want a simple, enumrated array of arrays where we can reference column by its index number. + // We want a simple, enumerated array of arrays where we can reference column by its index number. /** @var callable(mixed): mixed */ $temp = 'array_values'; /** @var array $sortOrder */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php b/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php index 47c2c9800..04549a1ca 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php @@ -57,7 +57,7 @@ class Arabic * * @param string|string[] $roman Should be a string, or can be an array of strings * - * @return array|int|string the arabic numberal contrived from the roman numeral + * @return array|int|string the arabic numeral contrived from the roman numeral * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ diff --git a/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Beta.php b/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Beta.php index 378ce8a22..b53f15c4f 100644 --- a/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Beta.php +++ b/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Beta.php @@ -28,9 +28,9 @@ class Beta * Or can be an array of values * @param mixed $beta Parameter to the distribution as a float * Or can be an array of values - * @param mixed $rMin as an float + * @param mixed $rMin as a float * Or can be an array of values - * @param mixed $rMax as an float + * @param mixed $rMax as a float * Or can be an array of values * * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array diff --git a/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Binomial.php b/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Binomial.php index 67cf4026d..948e64043 100644 --- a/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Binomial.php +++ b/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Binomial.php @@ -65,7 +65,7 @@ class Binomial /** * BINOM.DIST.RANGE. * - * Returns returns the Binomial Distribution probability for the number of successes from a specified number + * Returns the Binomial Distribution probability for the number of successes from a specified number * of trials falling into a specified range. * * @param mixed $trials Integer number of trials diff --git a/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Normal.php b/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Normal.php index 7e2ee92c2..5a0a7ebed 100644 --- a/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Normal.php +++ b/src/PhpSpreadsheet/Calculation/Statistical/Distributions/Normal.php @@ -116,7 +116,7 @@ class Normal // whatever purpose you want, but please show common courtesy and give credit // where credit is due. - // Input paramater is $p - probability - where 0 < p < 1. + // Input parameter is $p - probability - where 0 < p < 1. // Coefficients in rational approximations /** @var array */ diff --git a/src/PhpSpreadsheet/Calculation/TextData/Search.php b/src/PhpSpreadsheet/Calculation/TextData/Search.php index 0c4b97781..0aad5ed70 100644 --- a/src/PhpSpreadsheet/Calculation/TextData/Search.php +++ b/src/PhpSpreadsheet/Calculation/TextData/Search.php @@ -12,7 +12,7 @@ class Search use ArrayEnabled; /** - * FIND (case sensitive search). + * FIND (case-sensitive search). * * @param mixed $needle The string to look for * Or can be an array of values @@ -54,7 +54,7 @@ class Search } /** - * SEARCH (case insensitive search). + * SEARCH (case-insensitive search). * * @param mixed $needle The string to look for * Or can be an array of values diff --git a/src/PhpSpreadsheet/Cell/Coordinate.php b/src/PhpSpreadsheet/Cell/Coordinate.php index 227f2c117..2a84c0deb 100644 --- a/src/PhpSpreadsheet/Cell/Coordinate.php +++ b/src/PhpSpreadsheet/Cell/Coordinate.php @@ -401,7 +401,7 @@ abstract class Coordinate return $indexCache[$columnAddress]; } // It's surprising how costly the strtoupper() and ord() calls actually are, so we use a lookup array - // rather than use ord() and make it case insensitive to get rid of the strtoupper() as well. + // rather than use ord() and make it case-insensitive to get rid of the strtoupper() as well. // Because it's a static, there's no significant memory overhead either. /** @var array */ static $columnLookup = [ @@ -671,7 +671,7 @@ abstract class Coordinate * * @param array $coordinateCollection associative array mapping coordinates to values * - * @return array associative array mapping coordinate ranges to valuea + * @return array associative array mapping coordinate ranges to values */ public static function mergeRangesInCollection(array $coordinateCollection): array { diff --git a/src/PhpSpreadsheet/Chart/Legend.php b/src/PhpSpreadsheet/Chart/Legend.php index 7736fb7a3..f10642d27 100644 --- a/src/PhpSpreadsheet/Chart/Legend.php +++ b/src/PhpSpreadsheet/Chart/Legend.php @@ -66,7 +66,7 @@ class Legend } /** - * Get legend position as an excel string value. + * Get legend position as an Excel string value. */ public function getPosition(): string { @@ -74,7 +74,7 @@ class Legend } /** - * Get legend position using an excel string value. + * Get legend position using an Excel string value. * * @param string $position see self::POSITION_* */ diff --git a/src/PhpSpreadsheet/Chart/Renderer/JpGraph.php b/src/PhpSpreadsheet/Chart/Renderer/JpGraph.php index faadd9a30..ba30a35ff 100644 --- a/src/PhpSpreadsheet/Chart/Renderer/JpGraph.php +++ b/src/PhpSpreadsheet/Chart/Renderer/JpGraph.php @@ -3,7 +3,7 @@ namespace PhpOffice\PhpSpreadsheet\Chart\Renderer; /** - * Jpgraph is not oficially maintained in Composer, so the version there + * Jpgraph is not officially maintained in Composer, so the version there * could be out of date. For that reason, all unit test requiring Jpgraph * are skipped. So, do not measure code coverage for this class till that * is fixed. diff --git a/src/PhpSpreadsheet/Chart/Renderer/JpGraphRendererBase.php b/src/PhpSpreadsheet/Chart/Renderer/JpGraphRendererBase.php index 151d5b58c..ce08ee0a6 100644 --- a/src/PhpSpreadsheet/Chart/Renderer/JpGraphRendererBase.php +++ b/src/PhpSpreadsheet/Chart/Renderer/JpGraphRendererBase.php @@ -81,7 +81,7 @@ abstract class JpGraphRendererBase implements IRenderer } /** - * This method should be overriden in descendants to do real JpGraph library initialization. + * This method should be overridden in descendants to do real JpGraph library initialization. */ abstract protected static function init(): void; diff --git a/src/PhpSpreadsheet/Reader/Csv/Delimiter.php b/src/PhpSpreadsheet/Reader/Csv/Delimiter.php index 05b898fc4..a3370e02d 100644 --- a/src/PhpSpreadsheet/Reader/Csv/Delimiter.php +++ b/src/PhpSpreadsheet/Reader/Csv/Delimiter.php @@ -4,7 +4,7 @@ namespace PhpOffice\PhpSpreadsheet\Reader\Csv; class Delimiter { - protected const POTENTIAL_DELIMETERS = [',', ';', "\t", '|', ':', ' ', '~']; + protected const POTENTIAL_DELIMITERS = [',', ';', "\t", '|', ':', ' ', '~']; /** @var resource */ protected $fileHandle; @@ -34,7 +34,7 @@ class Delimiter public function getDefaultDelimiter(): string { - return self::POTENTIAL_DELIMETERS[0]; + return self::POTENTIAL_DELIMITERS[0]; } public function linesCounted(): int @@ -44,8 +44,8 @@ class Delimiter protected function countPotentialDelimiters(): void { - $this->counts = array_fill_keys(self::POTENTIAL_DELIMETERS, []); - $delimiterKeys = array_flip(self::POTENTIAL_DELIMETERS); + $this->counts = array_fill_keys(self::POTENTIAL_DELIMITERS, []); + $delimiterKeys = array_flip(self::POTENTIAL_DELIMITERS); // Count how many times each of the potential delimiters appears in each line $this->numberLines = 0; @@ -61,7 +61,7 @@ class Delimiter $distribution = array_count_values($splitString); $countLine = array_intersect_key($distribution, $delimiterKeys); - foreach (self::POTENTIAL_DELIMETERS as $delimiter) { + foreach (self::POTENTIAL_DELIMITERS as $delimiter) { $this->counts[$delimiter][] = $countLine[$delimiter] ?? 0; } } @@ -73,7 +73,7 @@ class Delimiter $meanSquareDeviations = []; $middleIdx = (int) floor(($this->numberLines - 1) / 2); - foreach (self::POTENTIAL_DELIMETERS as $delimiter) { + foreach (self::POTENTIAL_DELIMITERS as $delimiter) { $series = $this->counts[$delimiter]; sort($series); @@ -94,7 +94,7 @@ class Delimiter // ... and pick the delimiter with the smallest mean square deviation // (in case of ties, the order in potentialDelimiters is respected) $min = INF; - foreach (self::POTENTIAL_DELIMETERS as $delimiter) { + foreach (self::POTENTIAL_DELIMITERS as $delimiter) { if (!isset($meanSquareDeviations[$delimiter])) { continue; } diff --git a/src/PhpSpreadsheet/Reader/Gnumeric/Styles.php b/src/PhpSpreadsheet/Reader/Gnumeric/Styles.php index e947ae2f9..0729f2ef2 100644 --- a/src/PhpSpreadsheet/Reader/Gnumeric/Styles.php +++ b/src/PhpSpreadsheet/Reader/Gnumeric/Styles.php @@ -47,7 +47,7 @@ class Styles '8' => Fill::FILL_PATTERN_DARKVERTICAL, // vertical stripe '9' => Fill::FILL_PATTERN_DARKDOWN, // diagonal stripe '10' => Fill::FILL_PATTERN_DARKUP, // reverse diagonal stripe - '11' => Fill::FILL_PATTERN_DARKGRID, // diagoanl crosshatch + '11' => Fill::FILL_PATTERN_DARKGRID, // diagonal crosshatch '12' => Fill::FILL_PATTERN_DARKTRELLIS, // thick diagonal crosshatch '13' => Fill::FILL_PATTERN_LIGHTHORIZONTAL, '14' => Fill::FILL_PATTERN_LIGHTVERTICAL, diff --git a/src/PhpSpreadsheet/Reader/Html.php b/src/PhpSpreadsheet/Reader/Html.php index 579f3892d..0723914b6 100644 --- a/src/PhpSpreadsheet/Reader/Html.php +++ b/src/PhpSpreadsheet/Reader/Html.php @@ -915,7 +915,7 @@ class Html extends BaseReader * and only takes 'background-color' and 'color'; property with HEX color * * TODO : - * - Implement to other propertie, such as border + * - Implement to other properties, such as border * * @param string[] $attributeArray */ diff --git a/src/PhpSpreadsheet/Reader/Xls/Biff8.php b/src/PhpSpreadsheet/Reader/Xls/Biff8.php index 2de9fb8c3..6bb84725c 100644 --- a/src/PhpSpreadsheet/Reader/Xls/Biff8.php +++ b/src/PhpSpreadsheet/Reader/Xls/Biff8.php @@ -241,7 +241,7 @@ class Biff8 extends Xls */ protected static function readBIFF8CellRangeAddress(string $subData): string { - // todo: if cell range is just a single cell, should this funciton + // todo: if cell range is just a single cell, should this function // not just return e.g. 'A1' and not 'A1:A1' ? // offset: 0; size: 2; index to first row (0... 65535) (or offset (-32768... 32767)) @@ -297,7 +297,7 @@ class Biff8 extends Xls [$baseCol, $baseRow] = Coordinate::indexesFromString($baseCell); $baseCol = $baseCol - 1; - // TODO: if cell range is just a single cell, should this funciton + // TODO: if cell range is just a single cell, should this function // not just return e.g. 'A1' and not 'A1:A1' ? // offset: 0; size: 2; first row diff --git a/src/PhpSpreadsheet/Reader/Xls/LoadSpreadsheet.php b/src/PhpSpreadsheet/Reader/Xls/LoadSpreadsheet.php index 5c27b0cc3..85adc7fe0 100644 --- a/src/PhpSpreadsheet/Reader/Xls/LoadSpreadsheet.php +++ b/src/PhpSpreadsheet/Reader/Xls/LoadSpreadsheet.php @@ -34,10 +34,10 @@ class LoadSpreadsheet extends Xls $xls->spreadsheet->removeCellXfByIndex(0); // remove the default style } - // Read the summary information stream (containing meta data) + // Read the summary information stream (containing metadata) $xls->readSummaryInformation(); - // Read the Additional document summary information stream (containing application-specific meta data) + // Read the Additional document summary information stream (containing application-specific metadata) $xls->readDocumentSummaryInformation(); // total byte size of Excel data (workbook global substream + sheet substreams) @@ -490,7 +490,7 @@ class LoadSpreadsheet extends Xls // If there is no BSE Index, we will fail here and other fields are not read. // Fix by checking here. // TODO: Why is there no BSE Index? Is this a new Office Version? Password protected field? - // More likely : a uncompatible picture + // More likely: an incompatible picture if (!$BSEindex) { continue 2; } diff --git a/src/PhpSpreadsheet/Reader/Xls/RC4.php b/src/PhpSpreadsheet/Reader/Xls/RC4.php index 663f36723..a880eeeaf 100644 --- a/src/PhpSpreadsheet/Reader/Xls/RC4.php +++ b/src/PhpSpreadsheet/Reader/Xls/RC4.php @@ -12,7 +12,7 @@ class RC4 protected int $j = 0; /** - * RC4 stream decryption/encryption constrcutor. + * RC4 stream decryption/encryption constructor. * * @param string $key Encryption key/passphrase */ diff --git a/src/PhpSpreadsheet/Reader/Xlsx/WorkbookView.php b/src/PhpSpreadsheet/Reader/Xlsx/WorkbookView.php index 429efb089..10f26e954 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx/WorkbookView.php +++ b/src/PhpSpreadsheet/Reader/Xlsx/WorkbookView.php @@ -56,7 +56,7 @@ class WorkbookView /** * Convert an 'xsd:boolean' XML value to a PHP boolean value. * A valid 'xsd:boolean' XML value can be one of the following - * four values: 'true', 'false', '1', '0'. It is case sensitive. + * four values: 'true', 'false', '1', '0'. It is case-sensitive. * * Note that just doing '(bool) $xsdBoolean' is not safe, * since '(bool) "false"' returns true. diff --git a/src/PhpSpreadsheet/Shared/CodePage.php b/src/PhpSpreadsheet/Shared/CodePage.php index de6529c5c..540e96ca1 100644 --- a/src/PhpSpreadsheet/Shared/CodePage.php +++ b/src/PhpSpreadsheet/Shared/CodePage.php @@ -78,7 +78,7 @@ class CodePage * Convert Microsoft Code Page Identifier to Code Page Name which iconv * and mbstring understands. * - * @param int $codePage Microsoft Code Page Indentifier + * @param int $codePage Microsoft Code Page Identifier * * @return string Code Page Name */ diff --git a/src/PhpSpreadsheet/Shared/Escher/DggContainer.php b/src/PhpSpreadsheet/Shared/Escher/DggContainer.php index e5d831fa7..f7053dd07 100644 --- a/src/PhpSpreadsheet/Shared/Escher/DggContainer.php +++ b/src/PhpSpreadsheet/Shared/Escher/DggContainer.php @@ -34,7 +34,7 @@ class DggContainer private array $OPT = []; /** - * Array of identifier clusters containg information about the maximum shape identifiers. + * Array of identifier clusters containing information about the maximum shape identifiers. * * @var mixed[] */ diff --git a/src/PhpSpreadsheet/Shared/OLE.php b/src/PhpSpreadsheet/Shared/OLE.php index 09a3acebc..fa9224671 100644 --- a/src/PhpSpreadsheet/Shared/OLE.php +++ b/src/PhpSpreadsheet/Shared/OLE.php @@ -509,7 +509,7 @@ class OLE } $dateTime = Date::dateTimeFromTimestamp("$date"); - // days from 1-1-1601 until the beggining of UNIX era + // days from 1-1-1601 until the beginning of UNIX era $days = 134774; // calculate seconds $big_date = $days * 24 * 3600 + (float) $dateTime->format('U'); diff --git a/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php b/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php index eb03f8c1f..c92deb5ad 100644 --- a/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php +++ b/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php @@ -131,7 +131,7 @@ class Root extends PPS } /** - * Helper function for caculating a magic value for block sizes. + * Helper function for calculating a magic value for block sizes. * * @param int $i2 The argument * diff --git a/src/PhpSpreadsheet/Shared/OLERead.php b/src/PhpSpreadsheet/Shared/OLERead.php index aa4224b82..5d38e9564 100644 --- a/src/PhpSpreadsheet/Shared/OLERead.php +++ b/src/PhpSpreadsheet/Shared/OLERead.php @@ -231,7 +231,7 @@ class OLERead { $offset = 0; - // loop through entires, each entry is 128 bytes + // loop through entries, each entry is 128 bytes $entryLen = strlen($this->entry); while ($offset < $entryLen) { // entry data (128 bytes) diff --git a/src/PhpSpreadsheet/Shared/StringHelper.php b/src/PhpSpreadsheet/Shared/StringHelper.php index 6398b613b..f6cb4f9e9 100644 --- a/src/PhpSpreadsheet/Shared/StringHelper.php +++ b/src/PhpSpreadsheet/Shared/StringHelper.php @@ -250,7 +250,7 @@ class StringHelper private static ?string $currencyCode = null; /** - * Is iconv extension avalable? + * Is iconv extension available? */ private static ?bool $isIconvEnabled = null; diff --git a/src/PhpSpreadsheet/Spreadsheet.php b/src/PhpSpreadsheet/Spreadsheet.php index 5681e4aaa..42504adb8 100644 --- a/src/PhpSpreadsheet/Spreadsheet.php +++ b/src/PhpSpreadsheet/Spreadsheet.php @@ -17,7 +17,7 @@ use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; class Spreadsheet implements JsonSerializable { - // Allowable values for workbook window visilbity + // Allowable values for workbook window visibility const VISIBILITY_VISIBLE = 'visible'; const VISIBILITY_HIDDEN = 'hidden'; const VISIBILITY_VERY_HIDDEN = 'veryHidden'; @@ -107,14 +107,14 @@ class Spreadsheet implements JsonSerializable private ?string $macrosCertificate = null; /** - * ribbonXMLData : null if workbook is'nt Excel 2007 or not contain a customized UI. + * ribbonXMLData : null if workbook isn't Excel 2007 or not contain a customized UI. * * @var null|array{target: string, data: string} */ private ?array $ribbonXMLData = null; /** - * ribbonBinObjects : null if workbook is'nt Excel 2007 or not contain embedded objects (picture(s)) for Ribbon Elements + * ribbonBinObjects : null if workbook isn't Excel 2007 or not contain embedded objects (picture(s)) for Ribbon Elements * ignored if $ribbonXMLData is null. * * @var null|mixed[] @@ -152,7 +152,7 @@ class Spreadsheet implements JsonSerializable /** * Specifies a boolean value that indicates whether to group dates - * when presenting the user with filtering optiomd in the user + * when presenting the user with filtering options in the user * interface. */ private bool $autoFilterDateGrouping = true; @@ -405,7 +405,7 @@ class Spreadsheet implements JsonSerializable } /** - * This workbook have additionnal object for the ribbon ? + * This workbook have additional object for the ribbon ? */ public function hasRibbonBinObjects(): bool { @@ -1146,7 +1146,7 @@ class Spreadsheet implements JsonSerializable $this->uniqueID = uniqid('', true); $usedKeys = []; - // I don't now why new Style rather than clone. + // I don't know why new Style rather than clone. $this->cellXfSupervisor = new Style(true); //$this->cellXfSupervisor = clone $this->cellXfSupervisor; $this->cellXfSupervisor->bindParent($this); @@ -1559,7 +1559,7 @@ class Spreadsheet implements JsonSerializable /** * Return whether to group dates when presenting the user with - * filtering optiomd in the user interface. + * filtering options in the user interface. * * @return bool true if workbook window is minimized */ @@ -1570,7 +1570,7 @@ class Spreadsheet implements JsonSerializable /** * Set whether to group dates when presenting the user with - * filtering optiomd in the user interface. + * filtering options in the user interface. * * @param bool $autoFilterDateGrouping true if workbook window is minimized */ diff --git a/src/PhpSpreadsheet/Style/Alignment.php b/src/PhpSpreadsheet/Style/Alignment.php index 6ff44e3ef..7d3eb44b5 100644 --- a/src/PhpSpreadsheet/Style/Alignment.php +++ b/src/PhpSpreadsheet/Style/Alignment.php @@ -58,7 +58,7 @@ class Alignment extends Supervisor self::VERTICAL_CENTER => self::VERTICAL_CENTER, self::VERTICAL_JUSTIFY => self::VERTICAL_JUSTIFY, self::VERTICAL_DISTRIBUTED => self::VERTICAL_DISTRIBUTED, - // css settings that arent't in sync with Excel + // css settings that aren't in sync with Excel self::VERTICAL_BASELINE => self::VERTICAL_BOTTOM, self::VERTICAL_MIDDLE => self::VERTICAL_CENTER, self::VERTICAL_SUB => self::VERTICAL_BOTTOM, @@ -74,7 +74,7 @@ class Alignment extends Supervisor self::VERTICAL_CENTER => self::VERTICAL_MIDDLE, self::VERTICAL_JUSTIFY => self::VERTICAL_MIDDLE, self::VERTICAL_DISTRIBUTED => self::VERTICAL_MIDDLE, - // css settings that arent't in sync with Excel + // css settings that aren't in sync with Excel self::VERTICAL_BASELINE => self::VERTICAL_BASELINE, self::VERTICAL_MIDDLE => self::VERTICAL_MIDDLE, self::VERTICAL_SUB => self::VERTICAL_SUB, diff --git a/src/PhpSpreadsheet/Style/NumberFormat/Formatter.php b/src/PhpSpreadsheet/Style/NumberFormat/Formatter.php index 82f2028ba..aba75f4b9 100644 --- a/src/PhpSpreadsheet/Style/NumberFormat/Formatter.php +++ b/src/PhpSpreadsheet/Style/NumberFormat/Formatter.php @@ -181,7 +181,7 @@ class Formatter extends BaseFormatter // Convert any other escaped characters to quoted strings, e.g. (\T to "T") $format = (string) preg_replace('/(\\\(((.)(?!((AM\/PM)|(A\/P))))|([^ ])))(?=(?:[^"]|"[^"]*")*$)/ui', '"${2}"', $format); - // Get the sections, there can be up to four sections, separated with a semi-colon (but only if not a quoted literal) + // Get the sections, there can be up to four sections, separated with a semicolon (but only if not a quoted literal) $sections = preg_split(self::SECTION_SPLIT, $format) ?: []; [$colors, $format, $value] = self::splitFormatForSectionSelection($sections, $value); diff --git a/src/PhpSpreadsheet/Style/NumberFormat/NumberFormatter.php b/src/PhpSpreadsheet/Style/NumberFormat/NumberFormatter.php index 7efcf2112..f869d0736 100644 --- a/src/PhpSpreadsheet/Style/NumberFormat/NumberFormatter.php +++ b/src/PhpSpreadsheet/Style/NumberFormat/NumberFormatter.php @@ -148,7 +148,7 @@ class NumberFormatter extends BaseFormatter $dec = $matches[2]; $right = $matches[3]; - // minimun width of formatted number (including dot) + // minimum width of formatted number (including dot) $minWidth = strlen($left) + strlen($dec) + strlen($right); if ($useThousands) { $value = number_format( diff --git a/src/PhpSpreadsheet/Style/RgbTint.php b/src/PhpSpreadsheet/Style/RgbTint.php index 07d0d77c9..db51f30f8 100644 --- a/src/PhpSpreadsheet/Style/RgbTint.php +++ b/src/PhpSpreadsheet/Style/RgbTint.php @@ -16,7 +16,7 @@ class RgbTint private const TWO_THIRD = 2.0 / 3.0; private const RGBMAX = 255.0; /** - * MS excel's tint function expects that HLS is base 240. + * MS Excel's tint function expects that HLS is base 240. * * @see https://social.msdn.microsoft.com/Forums/en-US/e9d8c136-6d62-4098-9b1b-dac786149f43/excel-color-tint-algorithm-incorrect?forum=os_binaryfile#d3c2ac95-52e0-476b-86f1-e2a697f24969 */ diff --git a/src/PhpSpreadsheet/Worksheet/AutoFilter.php b/src/PhpSpreadsheet/Worksheet/AutoFilter.php index 63f4e6917..7aac85592 100644 --- a/src/PhpSpreadsheet/Worksheet/AutoFilter.php +++ b/src/PhpSpreadsheet/Worksheet/AutoFilter.php @@ -216,7 +216,7 @@ class AutoFilter implements Stringable } /** - * Get a specified AutoFilter Column by it's offset. + * Get a specified AutoFilter Column by its offset. * * @param int $columnOffset Column offset within range (starting from 0) */ diff --git a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php index 441204ca6..fa9768d9e 100644 --- a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php +++ b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php @@ -158,7 +158,7 @@ class Rule self::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM, ]; - // Unimplented Rule Operators (Numeric, Boolean etc) + // Unimplemented Rule Operators (Numeric, Boolean etc) // const AUTOFILTER_COLUMN_RULE_BETWEEN = 'between'; // greaterThanOrEqual 1 && lessThanOrEqual 2 // Rule Operators (Numeric Special) which are translated to standard numeric operators with calculated values // Rule Operators (String) which are set as wild-carded values @@ -357,7 +357,7 @@ class Rule $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 the user supplies an argument for grouping, then on their own head be it if ($grouping !== null) { $this->setGrouping($grouping); } diff --git a/src/PhpSpreadsheet/Worksheet/Drawing.php b/src/PhpSpreadsheet/Worksheet/Drawing.php index 213351426..99a04573b 100644 --- a/src/PhpSpreadsheet/Worksheet/Drawing.php +++ b/src/PhpSpreadsheet/Worksheet/Drawing.php @@ -222,7 +222,7 @@ class Drawing extends BaseDrawing } /** - * Get Image file extention for Save. + * Get Image file extension for Save. */ public function getImageFileExtensionForSave(bool $includeDot = true): string { diff --git a/src/PhpSpreadsheet/Worksheet/HeaderFooter.php b/src/PhpSpreadsheet/Worksheet/HeaderFooter.php index 787b00fd2..e20f90494 100644 --- a/src/PhpSpreadsheet/Worksheet/HeaderFooter.php +++ b/src/PhpSpreadsheet/Worksheet/HeaderFooter.php @@ -30,7 +30,7 @@ namespace PhpOffice\PhpSpreadsheet\Worksheet; * &font size - code for "text font size", where font size is a font size in points. * &K - code for "text font color" * RGB Color is specified as RRGGBB - * Theme Color is specifed as TTSNN where TT is the theme color Id, S is either "+" or "-" of the tint/shade + * Theme Color is specified as TTSNN where TT is the theme color Id, S is either "+" or "-" of the tint/shade * value, NN is the tint/shade value. * &S - code for "text strikethrough" on / off * &X - code for "text super script" on / off diff --git a/src/PhpSpreadsheet/Worksheet/PageSetup.php b/src/PhpSpreadsheet/Worksheet/PageSetup.php index 4c6a53918..db23eac7b 100644 --- a/src/PhpSpreadsheet/Worksheet/PageSetup.php +++ b/src/PhpSpreadsheet/Worksheet/PageSetup.php @@ -576,7 +576,7 @@ class PageSetup * Get print area. * * @param int $index Identifier for a specific print area range if several ranges have been set - * Default behaviour, or a index value of 0, will return all ranges as a comma-separated string + * Default behaviour, or an index value of 0, will return all ranges as a comma-separated string * Otherwise, the specific range identified by the value of $index will be returned * Print areas are numbered from 1 */ @@ -642,7 +642,7 @@ class PageSetup * @param int $index Identifier for a specific print area range allowing several ranges to be set * When the method is "O"verwrite, then a positive integer index will overwrite that indexed * entry in the print areas list; a negative index value will identify which entry to - * overwrite working bacward through the print area to the list, with the last entry as -1. + * overwrite working backward through the print area to the list, with the last entry as -1. * Specifying an index value of 0, will overwrite all existing print ranges. * When the method is "I"nsert, then a positive index will insert after that indexed entry in * the print areas list, while a negative index will insert before the indexed entry. diff --git a/src/PhpSpreadsheet/Worksheet/Table.php b/src/PhpSpreadsheet/Worksheet/Table.php index 072beab2d..08d1641bd 100644 --- a/src/PhpSpreadsheet/Worksheet/Table.php +++ b/src/PhpSpreadsheet/Worksheet/Table.php @@ -420,7 +420,7 @@ class Table implements Stringable } /** - * Get a specified Table Column by it's offset. + * Get a specified Table Column by its offset. * * @param int $columnOffset Column offset within range (starting from 0) */ @@ -477,7 +477,7 @@ class Table implements Stringable } /** - * Shift an Table Column Rule to a different column. + * Shift a Table Column Rule to a different column. * * Note: This method bypasses validation of the destination column to ensure it is within this Table range. * Nor does it verify whether any column rule already exists at $toColumn, but will simply override any existing value. diff --git a/src/PhpSpreadsheet/Writer/Csv.php b/src/PhpSpreadsheet/Writer/Csv.php index 0ec8aa472..4de9bb7ff 100644 --- a/src/PhpSpreadsheet/Writer/Csv.php +++ b/src/PhpSpreadsheet/Writer/Csv.php @@ -95,7 +95,7 @@ class Csv extends BaseWriter $this->setUseBOM(true); // Enforce UTF-8 BOM Header $this->setIncludeSeparatorLine(true); // Set separator line $this->setEnclosure('"'); // Set enclosure to " - $this->setDelimiter(';'); // Set delimiter to a semi-colon + $this->setDelimiter(';'); // Set delimiter to a semicolon $this->setLineEnding("\r\n"); } @@ -251,9 +251,9 @@ class Csv extends BaseWriter return $this->outputEncoding; } - public function setOutputEncoding(string $outputEnconding): self + public function setOutputEncoding(string $outputEncoding): self { - $this->outputEncoding = $outputEnconding; + $this->outputEncoding = $outputEncoding; return $this; } diff --git a/src/PhpSpreadsheet/Writer/Html.php b/src/PhpSpreadsheet/Writer/Html.php index ecf79d806..98289dcdb 100644 --- a/src/PhpSpreadsheet/Writer/Html.php +++ b/src/PhpSpreadsheet/Writer/Html.php @@ -745,7 +745,7 @@ class Html extends BaseWriter $dataUri = 'data:image/png;base64,' . base64_encode($contents); // Because of the nature of tables, width is more important than height. - // max-width: 100% ensures that image doesnt overflow containing cell + // max-width: 100% ensures that image doesn't overflow containing cell // However, PR #3535 broke test // 25_In_memory_image, apparently because // of the use of max-with. In addition, diff --git a/src/PhpSpreadsheet/Writer/Ods/Formula.php b/src/PhpSpreadsheet/Writer/Ods/Formula.php index 0e470b610..a11ce5f05 100644 --- a/src/PhpSpreadsheet/Writer/Ods/Formula.php +++ b/src/PhpSpreadsheet/Writer/Ods/Formula.php @@ -76,7 +76,7 @@ class Formula $columns = $splitRanges[6]; $rows = $splitRanges[7]; - // Replace any commas in the formula with semi-colons for Ods + // Replace any commas in the formula with semicolons for Ods // If by chance there are commas in worksheet names, then they will be "fixed" again in the loop // because we've already extracted worksheet names with our Preg::matchAllWithOffsets() $formula = str_replace(',', ';', $formula); diff --git a/src/PhpSpreadsheet/Writer/Xls.php b/src/PhpSpreadsheet/Writer/Xls.php index 3ef9bec9b..b321cb9fa 100644 --- a/src/PhpSpreadsheet/Writer/Xls.php +++ b/src/PhpSpreadsheet/Writer/Xls.php @@ -128,7 +128,7 @@ class Xls extends BaseWriter $this->writerWorksheets[$i] = new Worksheet($this->strTotal, $this->strUnique, $this->strTable, $this->colors, $this->parser, $this->preCalculateFormulas, $this->spreadsheet->getSheet($i), $this->writerWorkbook); } - // build Escher objects. Escher objects for workbooks needs to be build before Escher object for workbook. + // build Escher objects. Escher objects for workbooks needs to be built before Escher object for workbook. $this->buildWorksheetEschers(); $this->buildWorkbookEscher(); @@ -144,7 +144,7 @@ class Xls extends BaseWriter $this->writerWorkbook->addXfWriter($style, false); } - // add fonts from rich text eleemnts + // add fonts from rich text elements for ($i = 0; $i < $countSheets; ++$i) { foreach ($this->writerWorksheets[$i]->phpSheet->getCellCollection()->getCoordinates() as $coordinate) { /** @var Cell $cell */ @@ -339,7 +339,7 @@ class Xls extends BaseWriter while ($iInc <= $iNumColEnd) { ++$countShapes[$sheetIndex]; - // create an Drawing Object for the dropdown + // create a Drawing Object for the dropdown $oDrawing = new BaseDrawing(); // get the coordinates of drawing $cDrawing = Coordinate::stringFromColumnIndex($iInc) . $rangeBounds[0][1]; @@ -698,7 +698,7 @@ class Xls extends BaseWriter // value $dataProp .= 'Feuilles de calcul'; // vtUnalignedString - headingParts - // wType : 0x0003 = 32 bit signed integer + // wType : 0x0003 = 32-bit signed integer $dataProp .= pack('v', 0x0300); // padding $dataProp .= pack('v', 0x0000); diff --git a/src/PhpSpreadsheet/Writer/Xls/Parser.php b/src/PhpSpreadsheet/Writer/Xls/Parser.php index 55a530e6c..9a51c3f10 100644 --- a/src/PhpSpreadsheet/Writer/Xls/Parser.php +++ b/src/PhpSpreadsheet/Writer/Xls/Parser.php @@ -219,7 +219,7 @@ class Parser * The following hash was generated by "function_locale.pl" in the distro. * Refer to function_locale.pl for non-English function names. * - * The array elements are as follow: + * The array elements are as follows: * ptg: The Excel function ptg code. * args: The number of arguments that the function takes: * >=0 is a fixed number of arguments. @@ -1262,7 +1262,7 @@ class Parser } /** - * It parses a expression. It assumes the following rule: + * It parses an expression. It assumes the following rule: * Expr -> Term [("+" | "-") Term] * -> "string" * -> "-" Term : Negative value @@ -1622,7 +1622,7 @@ class Parser $converted_tree = $this->convert(StringHelper::convertToString($tree['right'])); $polish .= $converted_tree; } - // if it's a function convert it here (so we can set it's arguments) + // if it's a function convert it here (so we can set its arguments) /** @var string */ $treeValueString = $tree['value']; if ( diff --git a/src/PhpSpreadsheet/Writer/Xls/Workbook.php b/src/PhpSpreadsheet/Writer/Xls/Workbook.php index 4e0bf3edd..7b1e73ab3 100644 --- a/src/PhpSpreadsheet/Writer/Xls/Workbook.php +++ b/src/PhpSpreadsheet/Writer/Xls/Workbook.php @@ -1116,7 +1116,7 @@ class Workbook extends BIFFwriter // combine into one chunk with all the blocks SST, CONTINUE,... $chunk = ''; foreach ($recordDatas as $i => $recordData) { - // first block should have the SST record header, remaing should have CONTINUE header + // first block should have the SST record header, remaining should have CONTINUE header $record = ($i == 0) ? 0x00FC : 0x003C; $header = pack('vv', $record, strlen($recordData)); diff --git a/src/PhpSpreadsheet/Writer/Xls/Worksheet.php b/src/PhpSpreadsheet/Writer/Xls/Worksheet.php index 810abe9c4..494593d77 100644 --- a/src/PhpSpreadsheet/Writer/Xls/Worksheet.php +++ b/src/PhpSpreadsheet/Writer/Xls/Worksheet.php @@ -282,7 +282,7 @@ class Worksheet extends BIFFwriter // $lastcol last column on the range // $width width to set // $xfIndex The optional cell style Xf index to apply to the columns - // $hidden The optional hidden atribute + // $hidden The optional hidden attribute // $level The optional outline level $this->columnInfo[] = [$i, $i, $width, $xfIndex, $hidden, $level]; } @@ -2316,7 +2316,7 @@ class Worksheet extends BIFFwriter } /** - * Store the OBJ record that precedes an IMDATA record. This could be generalise + * Store the OBJ record that precedes an IMDATA record. This could be generalised * to support other Excel objects. * * @param int $colL Column containing upper left corner of object diff --git a/src/PhpSpreadsheet/Writer/Xls/Xf.php b/src/PhpSpreadsheet/Writer/Xls/Xf.php index bda33ed36..3e97260f6 100644 --- a/src/PhpSpreadsheet/Writer/Xls/Xf.php +++ b/src/PhpSpreadsheet/Writer/Xls/Xf.php @@ -219,7 +219,7 @@ class Xf $header = pack('vv', $record, $length); - //BIFF8 options: identation, shrinkToFit and text direction + //BIFF8 options: indentation, shrinkToFit and text direction $biff8_options = $this->style->getAlignment()->getIndent() & 15; $biff8_options |= (int) $this->style->getAlignment()->getShrinkToFit() << 4; $biff8_options |= $this->style->getAlignment()->getReadOrder() << 6; diff --git a/src/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php b/src/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php index 16c7bb978..843133045 100644 --- a/src/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php +++ b/src/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php @@ -185,12 +185,12 @@ class ContentTypes extends WriterPart } $bgImage = $comment->getBackgroundImage(); - $bgImageExtentionKey = strtolower($bgImage->getImageFileExtensionForSave(false)); + $bgImageExtensionKey = strtolower($bgImage->getImageFileExtensionForSave(false)); - if (!isset($aMediaContentTypes[$bgImageExtentionKey])) { - $aMediaContentTypes[$bgImageExtentionKey] = $bgImage->getImageMimeType(); + if (!isset($aMediaContentTypes[$bgImageExtensionKey])) { + $aMediaContentTypes[$bgImageExtensionKey] = $bgImage->getImageMimeType(); - $this->writeDefaultContentType($objWriter, $bgImageExtentionKey, $aMediaContentTypes[$bgImageExtentionKey]); + $this->writeDefaultContentType($objWriter, $bgImageExtensionKey, $aMediaContentTypes[$bgImageExtensionKey]); } } } diff --git a/src/PhpSpreadsheet/Writer/Xlsx/Rels.php b/src/PhpSpreadsheet/Writer/Xlsx/Rels.php index a913767dc..abcb8f262 100644 --- a/src/PhpSpreadsheet/Writer/Xlsx/Rels.php +++ b/src/PhpSpreadsheet/Writer/Xlsx/Rels.php @@ -148,7 +148,7 @@ class Rels extends WriterPart Namespaces::VBA, 'vbaProject.bin' ); - ++$i; //increment i if needed for an another relation + ++$i; //increment i if needed for another relation } // Metadata needed for Dynamic Arrays @@ -159,7 +159,7 @@ class Rels extends WriterPart Namespaces::RELATIONSHIPS_METADATA, 'metadata.xml' ); - ++$i; //increment i if needed for an another relation + ++$i; //increment i if needed for another relation } $objWriter->endElement(); diff --git a/tests/PhpSpreadsheetTests/Worksheet/Table/RemoveTableTest.php b/tests/PhpSpreadsheetTests/Worksheet/Table/RemoveTableTest.php index be46b663d..ea7a4e63b 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/Table/RemoveTableTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/Table/RemoveTableTest.php @@ -20,7 +20,7 @@ class RemoveTableTest extends SetupTeardown self::assertEquals(1, $sheet->getTableCollection()->count()); - $sheet->removeTableByName('table1'); // case insensitive + $sheet->removeTableByName('table1'); // case-insensitive self::assertEquals(0, $sheet->getTableCollection()->count()); } diff --git a/tests/PhpSpreadsheetTests/Worksheet/Table/TableTest.php b/tests/PhpSpreadsheetTests/Worksheet/Table/TableTest.php index 3edbe79b1..4a9160ba0 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/Table/TableTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/Table/TableTest.php @@ -89,7 +89,7 @@ class TableTest extends SetupTeardown $sheet->addTable($table1); $table2 = new Table(); - $table2->setName('tABlE_1'); // case insensitive + $table2->setName('tABlE_1'); // case-insensitive $sheet->addTable($table2); } @@ -103,7 +103,7 @@ class TableTest extends SetupTeardown $sheet->addTable($table1); $table2 = new Table(); - $table2->setName('table_2'); // case insensitive + $table2->setName('table_2'); // case-insensitive $sheet->addTable($table2); $table2->setName('tAbLe_1'); } diff --git a/tests/PhpSpreadsheetTests/Writer/Xlsx/DrawingsTest.php b/tests/PhpSpreadsheetTests/Writer/Xlsx/DrawingsTest.php index 2738faa74..452e72106 100644 --- a/tests/PhpSpreadsheetTests/Writer/Xlsx/DrawingsTest.php +++ b/tests/PhpSpreadsheetTests/Writer/Xlsx/DrawingsTest.php @@ -324,7 +324,7 @@ class DrawingsTest extends AbstractFunctional try { $drawing->getImageFileExtensionForSave(); - self::fail('Should throw exception when attempting to get image file extention for tiff'); + self::fail('Should throw exception when attempting to get image file extension for tiff'); } catch (PhpSpreadsheetException $e) { self::assertEquals($e->getMessage(), 'Unsupported image type in comment background. Supported types: PNG, JPEG, BMP, GIF.'); }