From 14d807c2c4187f577902c0768c3a9e43b026880e Mon Sep 17 00:00:00 2001 From: Jon Link Date: Fri, 24 Jan 2020 00:40:30 -0500 Subject: [PATCH 01/38] BUGFIX for issue #1161 (#1328) Removed broken unused code that tried to set a constant multiple times. Fixes #1161 Closes #1328 --- CHANGELOG.md | 1 + src/PhpSpreadsheet/Calculation/Calculation.php | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5011905..864479f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Handle Error in Formula Processing Better for Xls [#1267](https://github.com/PHPOffice/PhpSpreadsheet/pull/1267) - Handle ConditionalStyle NumberFormat When Reading Xlsx File [#1296](https://github.com/PHPOffice/PhpSpreadsheet/pull/1296) - Fix Xlsx Writer's handling of decimal commas [#1282](https://github.com/PHPOffice/PhpSpreadsheet/pull/1282) +- Fix for issue by removing test code mistakenly left in [#1328](https://github.com/PHPOffice/PhpSpreadsheet/pull/1328) ## [1.10.1] - 2019-12-02 diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php index 1e299f47..cc8a8bd8 100644 --- a/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/src/PhpSpreadsheet/Calculation/Calculation.php @@ -4159,13 +4159,6 @@ class Calculation if ($pCellParent) { $pCell->attach($pCellParent); } - if (($cellID == 'AC99') || (isset($pCell) && $pCell->getCoordinate() == 'AC99')) { - if (defined('RESOLVING')) { - define('RESOLVING2', true); - } else { - define('RESOLVING', true); - } - } $functionName = $matches[1]; $argCount = $stack->pop(); From 25e3e45eb67eea4c1cbe25654ccb73037c98bdc4 Mon Sep 17 00:00:00 2001 From: paulkned Date: Tue, 11 Feb 2020 22:59:19 +0100 Subject: [PATCH 02/38] Added support for the ARABIC excel function (#1343) Updated changelog Updated docprops Fixed stylci --- CHANGELOG.md | 1 + .../Calculation/Calculation.php | 5 ++ src/PhpSpreadsheet/Calculation/MathTrig.php | 58 +++++++++++++++++++ .../Calculation/functionlist.txt | 1 + .../Functions/MathTrig/ArabicTest.php | 32 ++++++++++ tests/data/Calculation/MathTrig/ARABIC.php | 36 ++++++++++++ 6 files changed, 133 insertions(+) create mode 100644 tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ArabicTest.php create mode 100644 tests/data/Calculation/MathTrig/ARABIC.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 864479f6..cbf1bdde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). ## [Unreleased] +- Added support for the ARABIC function - Conditionals - Extend Support for (NOT)CONTAINSBLANKS [#1278](https://github.com/PHPOffice/PhpSpreadsheet/pull/1278) - Handle Error in Formula Processing Better for Xls [#1267](https://github.com/PHPOffice/PhpSpreadsheet/pull/1267) - Handle ConditionalStyle NumberFormat When Reading Xlsx File [#1296](https://github.com/PHPOffice/PhpSpreadsheet/pull/1296) diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php index cc8a8bd8..1901e5d3 100644 --- a/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/src/PhpSpreadsheet/Calculation/Calculation.php @@ -263,6 +263,11 @@ class Calculation 'functionCall' => [Logical::class, 'logicalAnd'], 'argumentCount' => '1+', ], + 'ARABIC' => [ + 'category' => Category::CATEGORY_MATH_AND_TRIG, + 'functionCall' => [MathTrig::class, 'ARABIC'], + 'argumentCount' => '1', + ], 'AREAS' => [ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE, 'functionCall' => [Functions::class, 'DUMMY'], diff --git a/src/PhpSpreadsheet/Calculation/MathTrig.php b/src/PhpSpreadsheet/Calculation/MathTrig.php index a73e14e1..7ad78524 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig.php @@ -38,6 +38,64 @@ class MathTrig return ($num - ($num % $n)) / $n; } + /** + * ARABIC. + * + * Converts a Roman numeral to an Arabic numeral. + * + * Excel Function: + * ARABIC(text) + * + * @category Mathematical and Trigonometric Functions + * + * @param string $roman + * + * @return int|string the arabic numberal contrived from the roman numeral + */ + public static function ARABIC($roman) + { + // An empty string should return 0 + $roman = substr(trim(strtoupper((string) Functions::flattenSingleValue($roman))), 0, 255); + if ($roman === '') { + return 0; + } + + // Convert the roman numeral to an arabic number + $lookup = [ + 'M' => 1000, 'CM' => 900, + 'D' => 500, 'CD' => 400, + 'C' => 100, 'XC' => 90, + 'L' => 50, 'XL' => 40, + 'X' => 10, 'IX' => 9, + 'V' => 5, 'IV' => 4, 'I' => 1, + ]; + + $negativeNumber = $roman[0] === '-'; + if ($negativeNumber) { + $roman = substr($roman, 1); + } + + $arabic = 0; + for ($i = 0; $i < strlen($roman); ++$i) { + if (!isset($lookup[$roman[$i]])) { + return Functions::VALUE(); // Invalid character detected + } + + if ($i < (strlen($roman) - 1) && isset($lookup[substr($roman, $i, 2)])) { + $arabic += $lookup[substr($roman, $i, 2)]; // Detected a match on the next 2 characters + ++$i; + } else { + $arabic += $lookup[$roman[$i]]; // Detected a match on one character only + } + } + + if ($negativeNumber) { + $arabic *= -1; // The number should be negative + } + + return $arabic; + } + /** * ATAN2. * diff --git a/src/PhpSpreadsheet/Calculation/functionlist.txt b/src/PhpSpreadsheet/Calculation/functionlist.txt index 97a0ceeb..66523f4f 100644 --- a/src/PhpSpreadsheet/Calculation/functionlist.txt +++ b/src/PhpSpreadsheet/Calculation/functionlist.txt @@ -9,6 +9,7 @@ ADDRESS AMORDEGRC AMORLINC AND +ARABIC AREAS ASC ASIN diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ArabicTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ArabicTest.php new file mode 100644 index 00000000..f3f5c965 --- /dev/null +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ArabicTest.php @@ -0,0 +1,32 @@ +assertEquals($expectedResult, $result); + } + + public function providerARABIC() + { + return require 'data/Calculation/MathTrig/ARABIC.php'; + } +} diff --git a/tests/data/Calculation/MathTrig/ARABIC.php b/tests/data/Calculation/MathTrig/ARABIC.php new file mode 100644 index 00000000..3c397dc9 --- /dev/null +++ b/tests/data/Calculation/MathTrig/ARABIC.php @@ -0,0 +1,36 @@ + Date: Wed, 19 Feb 2020 20:12:30 +0100 Subject: [PATCH 03/38] Added support for the base function (#1344) --- CHANGELOG.md | 1 + .../Calculation/Calculation.php | 5 ++ src/PhpSpreadsheet/Calculation/MathTrig.php | 43 ++++++++++++++ .../Calculation/functionlist.txt | 1 + .../Functions/MathTrig/BaseTest.php | 31 ++++++++++ tests/data/Calculation/MathTrig/BASE.php | 59 +++++++++++++++++++ 6 files changed, 140 insertions(+) create mode 100644 tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php create mode 100644 tests/data/Calculation/MathTrig/BASE.php diff --git a/CHANGELOG.md b/CHANGELOG.md index cbf1bdde..c2931dca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). ## [Unreleased] +- Added support for the BASE function - Added support for the ARABIC function - Conditionals - Extend Support for (NOT)CONTAINSBLANKS [#1278](https://github.com/PHPOffice/PhpSpreadsheet/pull/1278) - Handle Error in Formula Processing Better for Xls [#1267](https://github.com/PHPOffice/PhpSpreadsheet/pull/1267) diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php index 1901e5d3..4ebce2ae 100644 --- a/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/src/PhpSpreadsheet/Calculation/Calculation.php @@ -333,6 +333,11 @@ class Calculation 'functionCall' => [Functions::class, 'DUMMY'], 'argumentCount' => '1', ], + 'BASE' => [ + 'category' => Category::CATEGORY_MATH_AND_TRIG, + 'functionCall' => [MathTrig::class, 'BASE'], + 'argumentCount' => '2,3', + ], 'BESSELI' => [ 'category' => Category::CATEGORY_ENGINEERING, 'functionCall' => [Engineering::class, 'BESSELI'], diff --git a/src/PhpSpreadsheet/Calculation/MathTrig.php b/src/PhpSpreadsheet/Calculation/MathTrig.php index 7ad78524..33bfee19 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig.php @@ -142,6 +142,49 @@ class MathTrig return Functions::VALUE(); } + /** + * BASE. + * + * Converts a number into a text representation with the given radix (base). + * + * Excel Function: + * BASE(Number, Radix [Min_length]) + * + * @category Mathematical and Trigonometric Functions + * + * @param float $number + * @param float $radix + * @param int $minLength + * + * @return string the text representation with the given radix (base) + */ + public static function BASE($number, $radix, $minLength = null) + { + $number = Functions::flattenSingleValue($number); + $radix = Functions::flattenSingleValue($radix); + $minLength = Functions::flattenSingleValue($minLength); + + if (is_numeric($number) && is_numeric($radix) && ($minLength === null || is_numeric($minLength))) { + // Truncate to an integer + $number = (int) $number; + $radix = (int) $radix; + $minLength = (int) $minLength; + + if ($number < 0 || $number >= 2 ** 53 || $radix < 2 || $radix > 36) { + return Functions::NAN(); // Numeric range constraints + } + + $outcome = strtoupper((string) base_convert($number, 10, $radix)); + if ($minLength !== null) { + $outcome = str_pad($outcome, $minLength, '0', STR_PAD_LEFT); // String padding + } + + return $outcome; + } + + return Functions::VALUE(); + } + /** * CEILING. * diff --git a/src/PhpSpreadsheet/Calculation/functionlist.txt b/src/PhpSpreadsheet/Calculation/functionlist.txt index 66523f4f..7776e6ea 100644 --- a/src/PhpSpreadsheet/Calculation/functionlist.txt +++ b/src/PhpSpreadsheet/Calculation/functionlist.txt @@ -23,6 +23,7 @@ AVERAGEA AVERAGEIF AVERAGEIFS BAHTTEXT +BASE BESSELI BESSELJ BESSELK diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php new file mode 100644 index 00000000..3aaf68b5 --- /dev/null +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php @@ -0,0 +1,31 @@ +assertEquals($expectedResult, $result); + } + + public function providerBASE() + { + return require 'data/Calculation/MathTrig/BASE.php'; + } +} diff --git a/tests/data/Calculation/MathTrig/BASE.php b/tests/data/Calculation/MathTrig/BASE.php new file mode 100644 index 00000000..c2802dd9 --- /dev/null +++ b/tests/data/Calculation/MathTrig/BASE.php @@ -0,0 +1,59 @@ + Date: Wed, 19 Feb 2020 11:22:31 -0800 Subject: [PATCH 04/38] Changes to WEEKNUM and YEARFRAC (#1316) * Changes to WEEKNUM and YEARFRAC The optional second parameter for WEEKNUM can take any of 10 values (1, 2, 11-17, and 21), but currently only 1 and 2 are supported. This change adds support for the other 8 possibilities. YEARFRAC in Excel does not require that end date be before start date, but PhpSpreadsheet was returning an error in that situation. YEARFRAC third parameter (method) of 1 was not correctly implemented. I was able to find a description of the algorithm, and documented that location in the code, and implemented according to that spec. PHPExcel had a (failing) test to assert the result of YEARFRAC("1960-12-19", "2008-06-28", 1). This test had been dropped from PhpSpreadsheet, and is now restored; several new tests have been added, and verified against Excel. * Add YEARFRAC Tests Scrutinizer reported a very mysterious failure with no details. project.metric_change("scrutinizer.test_coverage", < 0), without even a link to explain what it is reporting. It is possible that it was a complaint about code coverage. If so, I have added some tests which will, I hope, eliminate the problem. * Make Array Constant Responding to review from Mark Baker. * Merge with PR 1362 Bugfix 1161 Travis CI reported problem with Calculation.php (which is not part of this change). That was changed in master a few days ago (delete some unused code). Perhaps the lack of that change is the problem here. Merging it manually. --- src/PhpSpreadsheet/Calculation/DateTime.php | 134 +++++++++----- tests/data/Calculation/DateTime/WEEKNUM.php | 112 ++++++++++++ tests/data/Calculation/DateTime/YEARFRAC.php | 175 +++++++++++++++++++ 3 files changed, 376 insertions(+), 45 deletions(-) diff --git a/src/PhpSpreadsheet/Calculation/DateTime.php b/src/PhpSpreadsheet/Calculation/DateTime.php index 55740fc1..4f85edeb 100644 --- a/src/PhpSpreadsheet/Calculation/DateTime.php +++ b/src/PhpSpreadsheet/Calculation/DateTime.php @@ -878,6 +878,8 @@ class DateTime * * Excel Function: * YEARFRAC(startDate,endDate[,method]) + * See https://lists.oasis-open.org/archives/office-formula/200806/msg00039.html + * for description of algorithm used in Excel * * @category Date/Time Functions * @@ -906,6 +908,11 @@ class DateTime if (is_string($endDate = self::getDateValue($endDate))) { return Functions::VALUE(); } + if ($startDate > $endDate) { + $temp = $startDate; + $startDate = $endDate; + $endDate = $temp; + } if (((is_numeric($method)) && (!is_string($method))) || ($method == '')) { switch ($method) { @@ -916,46 +923,43 @@ class DateTime $startYear = self::YEAR($startDate); $endYear = self::YEAR($endDate); $years = $endYear - $startYear + 1; - $leapDays = 0; + $startMonth = self::MONTHOFYEAR($startDate); + $startDay = self::DAYOFMONTH($startDate); + $endMonth = self::MONTHOFYEAR($endDate); + $endDay = self::DAYOFMONTH($endDate); + $startMonthDay = 100 * $startMonth + $startDay; + $endMonthDay = 100 * $endMonth + $endDay; if ($years == 1) { if (self::isLeapYear($endYear)) { - $startMonth = self::MONTHOFYEAR($startDate); - $endMonth = self::MONTHOFYEAR($endDate); - $endDay = self::DAYOFMONTH($endDate); - if (($startMonth < 3) || - (($endMonth * 100 + $endDay) >= (2 * 100 + 29))) { - $leapDays += 1; + $tmpCalcAnnualBasis = 366; + } else { + $tmpCalcAnnualBasis = 365; + } + } elseif ($years == 2 && $startMonthDay >= $endMonthDay) { + if (self::isLeapYear($startYear)) { + if ($startMonthDay <= 229) { + $tmpCalcAnnualBasis = 366; + } else { + $tmpCalcAnnualBasis = 365; } + } elseif (self::isLeapYear($endYear)) { + if ($endMonthDay >= 229) { + $tmpCalcAnnualBasis = 366; + } else { + $tmpCalcAnnualBasis = 365; + } + } else { + $tmpCalcAnnualBasis = 365; } } else { + $tmpCalcAnnualBasis = 0; for ($year = $startYear; $year <= $endYear; ++$year) { - if ($year == $startYear) { - $startMonth = self::MONTHOFYEAR($startDate); - $startDay = self::DAYOFMONTH($startDate); - if ($startMonth < 3) { - $leapDays += (self::isLeapYear($year)) ? 1 : 0; - } - } elseif ($year == $endYear) { - $endMonth = self::MONTHOFYEAR($endDate); - $endDay = self::DAYOFMONTH($endDate); - if (($endMonth * 100 + $endDay) >= (2 * 100 + 29)) { - $leapDays += (self::isLeapYear($year)) ? 1 : 0; - } - } else { - $leapDays += (self::isLeapYear($year)) ? 1 : 0; - } + $tmpCalcAnnualBasis += self::isLeapYear($year) ? 366 : 365; } - if ($years == 2) { - if (($leapDays == 0) && (self::isLeapYear($startYear)) && ($days > 365)) { - $leapDays = 1; - } elseif ($days < 366) { - $years = 1; - } - } - $leapDays /= $years; + $tmpCalcAnnualBasis /= $years; } - return $days / (365 + $leapDays); + return $days / $tmpCalcAnnualBasis; case 2: return self::DATEDIF($startDate, $endDate) / 360; case 3: @@ -1273,6 +1277,36 @@ class DateTime return $DoW; } + const STARTWEEK_SUNDAY = 1; + const STARTWEEK_MONDAY = 2; + const STARTWEEK_MONDAY_ALT = 11; + const STARTWEEK_TUESDAY = 12; + const STARTWEEK_WEDNESDAY = 13; + const STARTWEEK_THURSDAY = 14; + const STARTWEEK_FRIDAY = 15; + const STARTWEEK_SATURDAY = 16; + const STARTWEEK_SUNDAY_ALT = 17; + const DOW_SUNDAY = 1; + const DOW_MONDAY = 2; + const DOW_TUESDAY = 3; + const DOW_WEDNESDAY = 4; + const DOW_THURSDAY = 5; + const DOW_FRIDAY = 6; + const DOW_SATURDAY = 7; + const STARTWEEK_MONDAY_ISO = 21; + const METHODARR = [ + self::STARTWEEK_SUNDAY => self::DOW_SUNDAY, + self::DOW_MONDAY, + self::STARTWEEK_MONDAY_ALT => self::DOW_MONDAY, + self::DOW_TUESDAY, + self::DOW_WEDNESDAY, + self::DOW_THURSDAY, + self::DOW_FRIDAY, + self::DOW_SATURDAY, + self::DOW_SUNDAY, + self::STARTWEEK_MONDAY_ISO => self::STARTWEEK_MONDAY_ISO, + ]; + /** * WEEKNUM. * @@ -1291,41 +1325,51 @@ class DateTime * @param int $method Week begins on Sunday or Monday * 1 or omitted Week begins on Sunday. * 2 Week begins on Monday. + * 11 Week begins on Monday. + * 12 Week begins on Tuesday. + * 13 Week begins on Wednesday. + * 14 Week begins on Thursday. + * 15 Week begins on Friday. + * 16 Week begins on Saturday. + * 17 Week begins on Sunday. + * 21 ISO (Jan. 4 is week 1, begins on Monday). * * @return int|string Week Number */ - public static function WEEKNUM($dateValue = 1, $method = 1) + public static function WEEKNUM($dateValue = 1, $method = self::STARTWEEK_SUNDAY) { $dateValue = Functions::flattenSingleValue($dateValue); $method = Functions::flattenSingleValue($method); if (!is_numeric($method)) { return Functions::VALUE(); - } elseif (($method < 1) || ($method > 2)) { - return Functions::NAN(); } - $method = floor($method); + $method = (int) $method; + if (!array_key_exists($method, self::METHODARR)) { + return Functions::NaN(); + } + $method = self::METHODARR[$method]; - if ($dateValue === null) { - $dateValue = 1; - } elseif (is_string($dateValue = self::getDateValue($dateValue))) { + $dateValue = self::getDateValue($dateValue); + if (is_string($dateValue)) { return Functions::VALUE(); - } elseif ($dateValue < 0.0) { + } + if ($dateValue < 0.0) { return Functions::NAN(); } // Execute function $PHPDateObject = Date::excelToDateTimeObject($dateValue); + if ($method == self::STARTWEEK_MONDAY_ISO) { + return (int) $PHPDateObject->format('W'); + } $dayOfYear = $PHPDateObject->format('z'); $PHPDateObject->modify('-' . $dayOfYear . ' days'); $firstDayOfFirstWeek = $PHPDateObject->format('w'); $daysInFirstWeek = (6 - $firstDayOfFirstWeek + $method) % 7; - $interval = $dayOfYear - $daysInFirstWeek; - $weekOfYear = floor($interval / 7) + 1; - - if ($daysInFirstWeek) { - ++$weekOfYear; - } + $daysInFirstWeek += 7 * !$daysInFirstWeek; + $endFirstWeek = $daysInFirstWeek - 1; + $weekOfYear = floor(($dayOfYear - $endFirstWeek + 13) / 7); return (int) $weekOfYear; } diff --git a/tests/data/Calculation/DateTime/WEEKNUM.php b/tests/data/Calculation/DateTime/WEEKNUM.php index ceb84315..d73ee463 100644 --- a/tests/data/Calculation/DateTime/WEEKNUM.php +++ b/tests/data/Calculation/DateTime/WEEKNUM.php @@ -53,6 +53,10 @@ return [ '#NUM!', '3/7/1977', 0, ], + [ + '#NUM!', + '3/7/1977', -1, + ], [ '#VALUE!', 'Invalid', 1, @@ -61,4 +65,112 @@ return [ '#NUM!', -1, ], + [ + 53, + '2019-12-29', 1, + ], + [ + 52, + '2019-12-29', 2, + ], + [ + '#NUM!', + '2019-12-29', 3, + ], + [ + '#NUM!', + '2019-12-29', 10, + ], + [ + 52, + '2019-12-29', 11, + ], + [ + 52, + '2019-12-29', 12, + ], + [ + 53, + '2019-12-29', 13, + ], + [ + 53, + '2019-12-29', 14, + ], + [ + 53, + '2019-12-29', 15, + ], + [ + 53, + '2019-12-29', 16, + ], + [ + 53, + '2019-12-29', 17, + ], + [ + '#NUM!', + '2019-12-29', 18, + ], + [ + '#NUM!', + '2019-12-29', 20, + ], + [ + '#NUM!', + '2019-12-29', 22, + ], + [ + 52, + '2019-12-29', 21, + ], + [ + 53, + '2020-12-29', 21, + ], + [ + 52, + '2021-12-29', 21, + ], + [ + 52, + '2022-12-29', 21, + ], + [ + 1, + '2020-01-01', 21, + ], + [ + 53, + '2021-01-01', 21, + ], + [ + 52, + '2022-01-01', 21, + ], + [ + 52, + '2023-01-01', 21, + ], + [ + 2, + '2020-01-08', 21, + ], + [ + 1, + '2021-01-08', 21, + ], + [ + 1, + '2022-01-08', 21, + ], + [ + 1, + '2023-01-08', 21, + ], + [ + 1, + '2025-12-29', 21, + ], ]; diff --git a/tests/data/Calculation/DateTime/YEARFRAC.php b/tests/data/Calculation/DateTime/YEARFRAC.php index 9cb7005a..3e76087c 100644 --- a/tests/data/Calculation/DateTime/YEARFRAC.php +++ b/tests/data/Calculation/DateTime/YEARFRAC.php @@ -7,6 +7,12 @@ return [ '2007-1-10', 0, ], + [ + 0.025, + '2007-1-10', + '2007-1-1', + 0, + ], [ 0.024657534246580001, '2007-1-1', @@ -337,6 +343,12 @@ return [ '2008-6-28', 0, ], + [ + 47.52162252765670, + '1960-12-19', + '2008-6-28', + 1, + ], [ 48.216666666666697, '1960-12-19', @@ -385,4 +397,167 @@ return [ '2008-6-28', 4, ], + [ + 0.163934426, + '1960-01-01', + '1960-03-01', + 1, + ], + [ + 0.161643836, + '1961-01-01', + '1961-03-01', + 1, + ], + [ + 0.161643836, + '1963-03-01', + '1963-01-01', + 1, + ], + [ + 1.086183311, + '1960-01-01', + '1961-02-01', + 1, + ], + [ + 1.084931507, + '1961-01-01', + '1962-02-01', + 1, + ], + [ + 1.083447332, + '1963-01-01', + '1964-02-01', + 1, + ], + [ + 1.162790698, + '1963-01-01', + '1964-03-01', + 1, + ], + [ + 0.841530055, + '2020-02-28', + '2021-01-01', + 1, + ], + [ + 0.764383562, + '2020-03-28', + '2021-01-01', + 1, + ], + [ + 0.841530055, + '2023-04-28', + '2024-03-01', + 1, + ], + [ + 0.838797814, + '2023-04-28', + '2024-02-29', + 1, + ], + [ + 0.838356164, + '2023-04-28', + '2024-02-28', + 1, + ], + [ + 0.753424658, + '2023-04-28', + '2024-01-28', + 1, + ], + [ + 0.753424658, + '2022-04-28', + '2023-01-28', + 1, + ], + [ + 1.0, + '2020-01-01', + '2021-01-01', + 1, + ], + [ + 0.99726776, + '2020-02-28', + '2021-02-27', + 1, + ], + [ + 0.764383562, + '2020-03-28', + '2021-01-01', + 1, + ], + [ + 0.841530055, + '2023-04-28', + '2024-03-01', + 1, + ], + [ + 0.838797814, + '2023-04-28', + '2024-02-29', + 1, + ], + [ + 0.838356164, + '2023-04-28', + '2024-02-28', + 1, + ], + [ + 0.753424658, + '2023-04-28', + '2024-01-28', + 1, + ], + [ + 0.753424658, + '2022-04-28', + '2023-01-28', + 1, + ], + [ + 1.082191781, + '2022-04-28', + '2023-05-28', + 1, + ], + [ + 1.002739726, + '2022-04-27', + '2023-04-28', + 1, + ], + [ + 0.084699454, + '2024-04-27', + '2024-05-28', + 1, + ], + [ + 0.084931507, + '2023-04-27', + '2023-05-28', + 1, + ], + [ + 2.085766423, + '2023-04-27', + '2025-05-28', + 1, + ], + ]; From 80f5e8fd1eed823d5ce38fdc32395cd8de832ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=A0=E4=B8=8B=E5=85=8B=E5=BD=A6?= Date: Fri, 21 Feb 2020 14:39:11 +0900 Subject: [PATCH 05/38] added IFS, NETWORKDAYS.INTL and WORKDAY.INTL as dummy EXCEL function they are listed on the doc --- .../Calculation/Calculation.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php index 4ebce2ae..344bc323 100644 --- a/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/src/PhpSpreadsheet/Calculation/Calculation.php @@ -1042,6 +1042,11 @@ class Calculation 'functionCall' => [Logical::class, 'IFNA'], 'argumentCount' => '2', ], + 'IFS' => [ + 'category' => Category::CATEGORY_LOGICAL, + 'functionCall' => [Functions::class, 'DUMMY'], + 'argumentCount' => '2+', + ], 'IMABS' => [ 'category' => Category::CATEGORY_ENGINEERING, 'functionCall' => [Engineering::class, 'IMABS'], @@ -1498,7 +1503,12 @@ class Calculation 'NETWORKDAYS' => [ 'category' => Category::CATEGORY_DATE_AND_TIME, 'functionCall' => [DateTime::class, 'NETWORKDAYS'], - 'argumentCount' => '2+', + 'argumentCount' => '2-3', + ], + 'NETWORKDAYS.INTL' => [ + 'category' => Category::CATEGORY_DATE_AND_TIME, + 'functionCall' => [Functions::class, 'DUMMY'], + 'argumentCount' => '2-4', ], 'NOMINAL' => [ 'category' => Category::CATEGORY_FINANCIAL, @@ -2167,7 +2177,12 @@ class Calculation 'WORKDAY' => [ 'category' => Category::CATEGORY_DATE_AND_TIME, 'functionCall' => [DateTime::class, 'WORKDAY'], - 'argumentCount' => '2+', + 'argumentCount' => '2-3', + ], + 'WORKDAY.INTL' => [ + 'category' => Category::CATEGORY_DATE_AND_TIME, + 'functionCall' => [Functions::class, 'DUMMY'], + 'argumentCount' => '2-4', ], 'XIRR' => [ 'category' => Category::CATEGORY_FINANCIAL, From b98c19ca281f1c163517edc014a08169cc6729f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=A0=E4=B8=8B=E5=85=8B=E5=BD=A6?= Date: Fri, 21 Feb 2020 14:39:39 +0900 Subject: [PATCH 06/38] update function-list-by-* to sync with $phpSpreadsheetFunctions --- docs/references/function-list-by-category.md | 44 +++++++++++--------- docs/references/function-list-by-name.md | 43 +++++++++---------- 2 files changed, 46 insertions(+), 41 deletions(-) diff --git a/docs/references/function-list-by-category.md b/docs/references/function-list-by-category.md index effe9e97..9f768459 100644 --- a/docs/references/function-list-by-category.md +++ b/docs/references/function-list-by-category.md @@ -69,12 +69,12 @@ BESSELK | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BESSELK BESSELY | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BESSELY BIN2DEC | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BINTODEC BIN2HEX | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BINTOHEX -BIN2OCT | \PhpOffice\PhpSpreadsheet\Calculation\Engineeri +BIN2OCT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BINTOOCT BITAND | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BITAND BITLSHIFT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BITLSHIFT BITOR | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BITOR BITRSHIFT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BITRSHIFT -BITXOR | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BITXOR +BITXOR | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BITOR COMPLEX | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::COMPLEX CONVERT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::CONVERTUOM DEC2BIN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::DECTOBIN @@ -184,21 +184,21 @@ YIELDMAT | \PhpOffice\PhpSpreadsheet\Calculation\Financial::YIELDMAT Excel Function | PhpSpreadsheet Function --------------------|------------------------------------------- CELL | **Not yet Implemented** -ERROR.TYPE | \PhpOffice\PhpSpreadsheet\Calculation\Functions::ERROR_TYPE +ERROR.TYPE | \PhpOffice\PhpSpreadsheet\Calculation\Functions::errorType INFO | **Not yet Implemented** -ISBLANK | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_BLANK -ISERR | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ERR -ISERROR | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ERROR -ISEVEN | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_EVEN -ISFORMULA | \PhpOffice\PhpSpreadsheet\Calculation\Functions::ISFORMULA -ISLOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_LOGICAL -ISNA | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NA -ISNONTEXT | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NONTEXT -ISNUMBER | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NUMBER -ISODD | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ODD +ISBLANK | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isBlank +ISERR | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isErr +ISERROR | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isError +ISEVEN | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isEven +ISFORMULA | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isFormula +ISLOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isLogical +ISNA | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isNa +ISNONTEXT | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isNonText +ISNUMBER | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isNumber +ISODD | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isOdd ISREF | **Not yet Implemented** -ISTEXT | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_TEXT -N | \PhpOffice\PhpSpreadsheet\Calculation\Functions::N +ISTEXT | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isText +N | \PhpOffice\PhpSpreadsheet\Calculation\Functions::n NA | \PhpOffice\PhpSpreadsheet\Calculation\Functions::NA TYPE | \PhpOffice\PhpSpreadsheet\Calculation\Functions::TYPE @@ -208,11 +208,13 @@ Excel Function | PhpSpreadsheet Function --------------------|------------------------------------------- AND | \PhpOffice\PhpSpreadsheet\Calculation\Logical::logicalAnd FALSE | \PhpOffice\PhpSpreadsheet\Calculation\Logical::FALSE -IF | \PhpOffice\PhpSpreadsheet\Calculation\Logical::STATEMENT_IF +IF | \PhpOffice\PhpSpreadsheet\Calculation\Logical::statementIf IFERROR | \PhpOffice\PhpSpreadsheet\Calculation\Logical::IFERROR IFNA | \PhpOffice\PhpSpreadsheet\Calculation\Logical::IFNA +IFS | **Not yet Implemented** NOT | \PhpOffice\PhpSpreadsheet\Calculation\Logical::NOT OR | \PhpOffice\PhpSpreadsheet\Calculation\Logical::logicalOr +SWITCH | \PhpOffice\PhpSpreadsheet\Calculation\Logical::statementSwitch TRUE | \PhpOffice\PhpSpreadsheet\Calculation\Logical::TRUE XOR | \PhpOffice\PhpSpreadsheet\Calculation\Logical::logicalXor @@ -220,7 +222,7 @@ XOR | \PhpOffice\PhpSpreadsheet\Calculation\Logical::logicalXor Excel Function | PhpSpreadsheet Function --------------------|------------------------------------------- -ADDRESS | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::CELL_ADDRESS +ADDRESS | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::cellAddress AREAS | **Not yet Implemented** CHOOSE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::CHOOSE COLUMN | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::COLUMN @@ -249,11 +251,13 @@ ACOS | acos ACOSH | acosh ACOT | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ACOT ACOTH | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ACOTH +ARABIC | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ARABIC ASIN | asin ASINH | asinh ATAN | atan -ATAN2 | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::REVERSE_ATAN2 +ATAN2 | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ATAN2 ATANH | atanh +BASE | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::BASE CEILING | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::CEILING COMBIN | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::COMBIN COS | cos @@ -272,7 +276,7 @@ GCD | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::GCD INT | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::INT LCM | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::LCM LN | log -LOG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::LOG_BASE +LOG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::logBase LOG10 | log10 MDETERM | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::MDETERM MINVERSE | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::MINVERSE @@ -389,8 +393,8 @@ SLOPE | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::SLOPE SMALL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::SMALL STANDARDIZE | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STANDARDIZE STDEV | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEV -STDEV.S | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEV STDEV.P | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVP +STDEV.S | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEV STDEVA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVA STDEVP | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVP STDEVPA | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVPA diff --git a/docs/references/function-list-by-name.md b/docs/references/function-list-by-name.md index e974c316..709b4b1d 100644 --- a/docs/references/function-list-by-name.md +++ b/docs/references/function-list-by-name.md @@ -11,16 +11,17 @@ ACOS | CATEGORY_MATH_AND_TRIG | acos ACOSH | CATEGORY_MATH_AND_TRIG | acosh ACOT | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ACOT ACOTH | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ACOTH -ADDRESS | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::CELL_ADDRESS +ADDRESS | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::cellAddress AMORDEGRC | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::AMORDEGRC AMORLINC | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::AMORLINC AND | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::logicalAnd +ARABIC | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ARABIC AREAS | CATEGORY_LOOKUP_AND_REFERENCE | **Not yet Implemented** ASC | CATEGORY_TEXT_AND_DATA | **Not yet Implemented** ASIN | CATEGORY_MATH_AND_TRIG | asin ASINH | CATEGORY_MATH_AND_TRIG | asinh ATAN | CATEGORY_MATH_AND_TRIG | atan -ATAN2 | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::REVERSE_ATAN2 +ATAN2 | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::ATAN2 ATANH | CATEGORY_MATH_AND_TRIG | atanh AVEDEV | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::AVEDEV AVERAGE | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::AVERAGE @@ -33,6 +34,7 @@ AVERAGEIFS | CATEGORY_STATISTICAL | **Not yet Implemented** Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- BAHTTEXT | CATEGORY_TEXT_AND_DATA | **Not yet Implemented** +BASE | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::BASE BESSELI | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BESSELI BESSELJ | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BESSELJ BESSELK | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BESSELK @@ -47,7 +49,7 @@ BITAND | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet BITLSHIFT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BITLSHIFT BITOR | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BITOR BITRSHIFT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BITRSHIFT -BITXOR | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BITXOR +BITXOR | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::BITOR ## C @@ -147,7 +149,7 @@ ERF | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet ERF.PRECISE | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERFPRECISE ERFC | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERFC ERFC.PRECISE | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERFC -ERROR.TYPE | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::ERROR_TYPE +ERROR.TYPE | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::errorType EVEN | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::EVEN EXACT | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::EXACT EXP | CATEGORY_MATH_AND_TRIG | exp @@ -205,7 +207,7 @@ HYPGEOMDIST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- -IF | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::STATEMENT_IF +IF | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::statementIf IFERROR | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::IFERROR IFNA | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::IFNA IFS | CATEGORY_LOGICAL | **Not yet Implemented** @@ -242,20 +244,20 @@ INTERCEPT | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet INTRATE | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::INTRATE IPMT | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::IPMT IRR | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::IRR -ISBLANK | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_BLANK -ISERR | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ERR -ISERROR | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ERROR -ISEVEN | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_EVEN -ISFORMULA | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::ISFORMULA -ISLOGICAL | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_LOGICAL -ISNA | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NA -ISNONTEXT | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NONTEXT -ISNUMBER | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_NUMBER -ISODD | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_ODD +ISBLANK | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isBlank +ISERR | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isErr +ISERROR | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isError +ISEVEN | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isEven +ISFORMULA | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isFormula +ISLOGICAL | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isLogical +ISNA | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isNa +ISNONTEXT | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isNonText +ISNUMBER | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isNumber +ISODD | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isOdd ISOWEEKNUM | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::ISOWEEKNUM ISPMT | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::ISPMT ISREF | CATEGORY_INFORMATION | **Not yet Implemented** -ISTEXT | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::IS_TEXT +ISTEXT | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::isText ## J @@ -281,7 +283,7 @@ LEN | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet LENB | CATEGORY_TEXT_AND_DATA | \PhpOffice\PhpSpreadsheet\Calculation\TextData::STRINGLENGTH LINEST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::LINEST LN | CATEGORY_MATH_AND_TRIG | log -LOG | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::LOG_BASE +LOG | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::logBase LOG10 | CATEGORY_MATH_AND_TRIG | log10 LOGEST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::LOGEST LOGINV | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::LOGINV @@ -321,7 +323,7 @@ MULTINOMIAL | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet Excel Function | Category | PhpSpreadsheet Function --------------------|--------------------------------|------------------------------------------- -N | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::N +N | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::n NA | CATEGORY_INFORMATION | \PhpOffice\PhpSpreadsheet\Calculation\Functions::NA NEGBINOMDIST | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::NEGBINOMDIST NETWORKDAYS | CATEGORY_DATE_AND_TIME | \PhpOffice\PhpSpreadsheet\Calculation\DateTime::NETWORKDAYS @@ -428,8 +430,8 @@ SQRT | CATEGORY_MATH_AND_TRIG | sqrt SQRTPI | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SQRTPI STANDARDIZE | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STANDARDIZE STDEV | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEV -STDEV.S | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEV STDEV.P | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVP +STDEV.S | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEV STDEVA | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVA STDEVP | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVP STDEVPA | CATEGORY_STATISTICAL | \PhpOffice\PhpSpreadsheet\Calculation\Statistical::STDEVPA @@ -444,7 +446,7 @@ SUMSQ | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet SUMX2MY2 | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMX2MY2 SUMX2PY2 | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMX2PY2 SUMXMY2 | CATEGORY_MATH_AND_TRIG | \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::SUMXMY2 -SWITCH | CATEGORY_LOGICAL | **Not yet Implemented** +SWITCH | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::statementSwitch SYD | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::SYD ## T @@ -514,7 +516,6 @@ XIRR | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet XNPV | CATEGORY_FINANCIAL | \PhpOffice\PhpSpreadsheet\Calculation\Financial::XNPV XOR | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::logicalXor - ## Y Excel Function | Category | PhpSpreadsheet Function From e11202168f9c36ee92e28969e44e6875d429573d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=A0=E4=B8=8B=E5=85=8B=E5=BD=A6?= Date: Fri, 21 Feb 2020 14:56:43 +0900 Subject: [PATCH 07/38] bin/generate-document generates function-list-by-* --- bin/generate-document | 14 ++++ src/PhpSpreadsheet/DocumentGenerator.php | 102 +++++++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100755 bin/generate-document create mode 100644 src/PhpSpreadsheet/DocumentGenerator.php diff --git a/bin/generate-document b/bin/generate-document new file mode 100755 index 00000000..a68a1361 --- /dev/null +++ b/bin/generate-document @@ -0,0 +1,14 @@ +#!/usr/bin/env php + $category) { + echo "\n"; + echo "## {$categoryConstant}\n"; + echo "\n"; + echo "Excel Function | PhpSpreadsheet Function\n"; + echo "--------------------|-------------------------------------------\n"; + foreach ($phpSpreadsheetFunctions as $function => $functionInfo) { + if ($category === $functionInfo['category']) { + echo str_pad($function, 20) + . '| ' . self::getPhpSpreadsheetFunctionText($functionInfo['functionCall']) . "\n"; + } + } + } + } finally { + file_put_contents(__DIR__ . '/../../docs/references/function-list-by-category.md', ob_get_clean()); + } + } + + /** + * @return mixed + * @throws ReflectionException + */ + private static function getPhpSpreadsheetFunctions() { + $phpSpreadsheetFunctionsProperty = (new ReflectionClass(Calculation::class))->getProperty('phpSpreadsheetFunctions'); + $phpSpreadsheetFunctionsProperty->setAccessible(true); + $phpSpreadsheetFunctions = $phpSpreadsheetFunctionsProperty->getValue(); + ksort($phpSpreadsheetFunctions); + return $phpSpreadsheetFunctions; + } + + /** + * @return array + * @throws ReflectionException + */ + private static function getCategories(): array { + return (new ReflectionClass(Category::class))->getConstants(); + } + + private static function getPhpSpreadsheetFunctionText($functionCall): string { + if (is_string($functionCall)) { + return $functionCall; + } + if ($functionCall === [Functions::class, 'DUMMY']) { + return '**Not yet Implemented**'; + } + if (is_array($functionCall)) { + return "\\{$functionCall[0]}::{$functionCall[1]}"; + } + throw new UnexpectedValueException('$functionCall is of type ' . gettype($functionCall) . '. string or array expected'); + } + + /** + * @throws ReflectionException + */ + public static function generateFunctionListByName(): void { + $categoryConstants = array_flip(self::getCategories()); + ob_start(); + try { + echo "# Function list by name\n"; + $phpSpreadsheetFunctions = self::getPhpSpreadsheetFunctions(); + $lastAlphabet = null; + foreach ($phpSpreadsheetFunctions as $function => $functionInfo) { + if ($lastAlphabet !== $function[0]) { + $lastAlphabet = $function[0]; + echo "\n"; + echo "## {$lastAlphabet}\n"; + echo "\n"; + echo "Excel Function | Category | PhpSpreadsheet Function\n"; + echo "--------------------|--------------------------------|-------------------------------------------\n"; + } + echo str_pad($function, 20) + . '| ' . str_pad($categoryConstants[$functionInfo['category']], 31) + . '| ' . self::getPhpSpreadsheetFunctionText($functionInfo['functionCall']) + . "\n"; + } + } finally { + file_put_contents(__DIR__ . '/../../docs/references/function-list-by-name.md', ob_get_clean()); + } + } +} \ No newline at end of file From fe83f070aa404bc954c515fc8b440c7a618a3147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=A0=E4=B8=8B=E5=85=8B=E5=BD=A6?= Date: Sun, 23 Feb 2020 12:30:18 +0900 Subject: [PATCH 08/38] improve testability --- bin/generate-document | 14 ++- src/PhpSpreadsheet/DocumentGenerator.php | 127 ++++++++++++----------- 2 files changed, 80 insertions(+), 61 deletions(-) diff --git a/bin/generate-document b/bin/generate-document index a68a1361..10ac8118 100755 --- a/bin/generate-document +++ b/bin/generate-document @@ -1,13 +1,23 @@ #!/usr/bin/env php getProperty('phpSpreadsheetFunctions'); + $phpSpreadsheetFunctionsProperty->setAccessible(true); + $phpSpreadsheetFunctions = $phpSpreadsheetFunctionsProperty->getValue(); + ksort($phpSpreadsheetFunctions); + + file_put_contents(__DIR__ . '/../docs/references/function-list-by-category.md', + DocumentGenerator::generateFunctionListByCategory($phpSpreadsheetFunctions) + ); + file_put_contents(__DIR__ . '/../docs/references/function-list-by-name.md', + DocumentGenerator::generateFunctionListByName($phpSpreadsheetFunctions) + ); } catch (ReflectionException $e) { fwrite(STDERR, (string)$e); exit(1); diff --git a/src/PhpSpreadsheet/DocumentGenerator.php b/src/PhpSpreadsheet/DocumentGenerator.php index 010d1325..de6f313f 100644 --- a/src/PhpSpreadsheet/DocumentGenerator.php +++ b/src/PhpSpreadsheet/DocumentGenerator.php @@ -1,64 +1,69 @@ $category) { - echo "\n"; - echo "## {$categoryConstant}\n"; - echo "\n"; - echo "Excel Function | PhpSpreadsheet Function\n"; - echo "--------------------|-------------------------------------------\n"; - foreach ($phpSpreadsheetFunctions as $function => $functionInfo) { - if ($category === $functionInfo['category']) { - echo str_pad($function, 20) - . '| ' . self::getPhpSpreadsheetFunctionText($functionInfo['functionCall']) . "\n"; - } + public static function generateFunctionListByCategory(array $phpSpreadsheetFunctions): string + { + $result = "# Function list by category\n"; + foreach (self::getCategories() as $categoryConstant => $category) { + $result .= "\n"; + $result .= "## {$categoryConstant}\n"; + $result .= "\n"; + $lengths = [20, 42]; + $result .= self::tableRow($lengths, ['Excel Function', 'PhpSpreadsheet Function']) . "\n"; + $result .= self::tableRow($lengths, null) . "\n"; + foreach ($phpSpreadsheetFunctions as $excelFunction => $functionInfo) { + if ($category === $functionInfo['category']) { + $phpFunction = self::getPhpSpreadsheetFunctionText($functionInfo['functionCall']); + $result .= self::tableRow($lengths, [$excelFunction, $phpFunction]) . "\n"; } } - } finally { - file_put_contents(__DIR__ . '/../../docs/references/function-list-by-category.md', ob_get_clean()); } + + return $result; } /** - * @return mixed * @throws ReflectionException - */ - private static function getPhpSpreadsheetFunctions() { - $phpSpreadsheetFunctionsProperty = (new ReflectionClass(Calculation::class))->getProperty('phpSpreadsheetFunctions'); - $phpSpreadsheetFunctionsProperty->setAccessible(true); - $phpSpreadsheetFunctions = $phpSpreadsheetFunctionsProperty->getValue(); - ksort($phpSpreadsheetFunctions); - return $phpSpreadsheetFunctions; - } - - /** + * * @return array - * @throws ReflectionException */ - private static function getCategories(): array { + private static function getCategories(): array + { return (new ReflectionClass(Category::class))->getConstants(); } - private static function getPhpSpreadsheetFunctionText($functionCall): string { + private static function tableRow(array $lengths, array $values = null): string + { + $result = ''; + foreach (array_map(null, $lengths, $values ?? []) as $i => [$length, $value]) { + $pad = $value === null ? '-' : ' '; + if ($i > 0) { + $result .= '|' . $pad; + } + $result .= str_pad($value ?? '', $length, $pad); + } + + return rtrim($result, ' '); + } + + private static function getPhpSpreadsheetFunctionText($functionCall): string + { if (is_string($functionCall)) { return $functionCall; } @@ -68,35 +73,39 @@ class DocumentGenerator { if (is_array($functionCall)) { return "\\{$functionCall[0]}::{$functionCall[1]}"; } - throw new UnexpectedValueException('$functionCall is of type ' . gettype($functionCall) . '. string or array expected'); + + throw new UnexpectedValueException( + '$functionCall is of type ' . gettype($functionCall) . '. string or array expected' + ); } /** + * @param array[] $phpSpreadsheetFunctions + * * @throws ReflectionException + * + * @return string */ - public static function generateFunctionListByName(): void { + public static function generateFunctionListByName(array $phpSpreadsheetFunctions): string + { $categoryConstants = array_flip(self::getCategories()); - ob_start(); - try { - echo "# Function list by name\n"; - $phpSpreadsheetFunctions = self::getPhpSpreadsheetFunctions(); - $lastAlphabet = null; - foreach ($phpSpreadsheetFunctions as $function => $functionInfo) { - if ($lastAlphabet !== $function[0]) { - $lastAlphabet = $function[0]; - echo "\n"; - echo "## {$lastAlphabet}\n"; - echo "\n"; - echo "Excel Function | Category | PhpSpreadsheet Function\n"; - echo "--------------------|--------------------------------|-------------------------------------------\n"; - } - echo str_pad($function, 20) - . '| ' . str_pad($categoryConstants[$functionInfo['category']], 31) - . '| ' . self::getPhpSpreadsheetFunctionText($functionInfo['functionCall']) - . "\n"; + $result = "# Function list by name\n"; + $lastAlphabet = null; + foreach ($phpSpreadsheetFunctions as $excelFunction => $functionInfo) { + $lengths = [20, 31, 42]; + if ($lastAlphabet !== $excelFunction[0]) { + $lastAlphabet = $excelFunction[0]; + $result .= "\n"; + $result .= "## {$lastAlphabet}\n"; + $result .= "\n"; + $result .= self::tableRow($lengths, ['Excel Function', 'Category', 'PhpSpreadsheet Function']) . "\n"; + $result .= self::tableRow($lengths, null) . "\n"; } - } finally { - file_put_contents(__DIR__ . '/../../docs/references/function-list-by-name.md', ob_get_clean()); + $category = $categoryConstants[$functionInfo['category']]; + $phpFunction = self::getPhpSpreadsheetFunctionText($functionInfo['functionCall']); + $result .= self::tableRow($lengths, [$excelFunction, $category, $phpFunction]) . "\n"; } + + return $result; } -} \ No newline at end of file +} From 32a8ef5e33638668d6a399a5b3e65aba45dbbaa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=A0=E4=B8=8B=E5=85=8B=E5=BD=A6?= Date: Tue, 25 Feb 2020 09:52:32 +0900 Subject: [PATCH 09/38] DocumentGeneratorTest --- .../DocumentGeneratorTest.php | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 tests/PhpSpreadsheetTests/DocumentGeneratorTest.php diff --git a/tests/PhpSpreadsheetTests/DocumentGeneratorTest.php b/tests/PhpSpreadsheetTests/DocumentGeneratorTest.php new file mode 100644 index 00000000..da0eb4bd --- /dev/null +++ b/tests/PhpSpreadsheetTests/DocumentGeneratorTest.php @@ -0,0 +1,141 @@ + ['category' => Cat::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'abs'], + 'AND' => ['category' => Cat::CATEGORY_LOGICAL, 'functionCall' => [Logical::class, 'logicalAnd']], + 'IFS' => ['category' => Cat::CATEGORY_LOGICAL, 'functionCall' => [Functions::class, 'DUMMY']], + ], + <<<'EXPECTED' +# Function list by name + +## A + +Excel Function | Category | PhpSpreadsheet Function +--------------------|--------------------------------|------------------------------------------- +ABS | CATEGORY_MATH_AND_TRIG | abs +AND | CATEGORY_LOGICAL | \PhpOffice\PhpSpreadsheet\Calculation\Logical::logicalAnd + +## I + +Excel Function | Category | PhpSpreadsheet Function +--------------------|--------------------------------|------------------------------------------- +IFS | CATEGORY_LOGICAL | **Not yet Implemented** + +EXPECTED + + ], + ]; + } + + public function providerGenerateFunctionListByCategory(): array + { + return [ + [ + [ + 'ABS' => ['category' => Cat::CATEGORY_MATH_AND_TRIG, 'functionCall' => 'abs'], + 'AND' => ['category' => Cat::CATEGORY_LOGICAL, 'functionCall' => [Logical::class, 'logicalAnd']], + 'IFS' => ['category' => Cat::CATEGORY_LOGICAL, 'functionCall' => [Functions::class, 'DUMMY']], + ], + <<<'EXPECTED' +# Function list by category + +## CATEGORY_CUBE + +Excel Function | PhpSpreadsheet Function +--------------------|------------------------------------------- + +## CATEGORY_DATABASE + +Excel Function | PhpSpreadsheet Function +--------------------|------------------------------------------- + +## CATEGORY_DATE_AND_TIME + +Excel Function | PhpSpreadsheet Function +--------------------|------------------------------------------- + +## CATEGORY_ENGINEERING + +Excel Function | PhpSpreadsheet Function +--------------------|------------------------------------------- + +## CATEGORY_FINANCIAL + +Excel Function | PhpSpreadsheet Function +--------------------|------------------------------------------- + +## CATEGORY_INFORMATION + +Excel Function | PhpSpreadsheet Function +--------------------|------------------------------------------- + +## CATEGORY_LOGICAL + +Excel Function | PhpSpreadsheet Function +--------------------|------------------------------------------- +AND | \PhpOffice\PhpSpreadsheet\Calculation\Logical::logicalAnd +IFS | **Not yet Implemented** + +## CATEGORY_LOOKUP_AND_REFERENCE + +Excel Function | PhpSpreadsheet Function +--------------------|------------------------------------------- + +## CATEGORY_MATH_AND_TRIG + +Excel Function | PhpSpreadsheet Function +--------------------|------------------------------------------- +ABS | abs + +## CATEGORY_STATISTICAL + +Excel Function | PhpSpreadsheet Function +--------------------|------------------------------------------- + +## CATEGORY_TEXT_AND_DATA + +Excel Function | PhpSpreadsheet Function +--------------------|------------------------------------------- + +EXPECTED + + ], + ]; + } +} From 23f26fa6162c23f17d4700ca9c96e5b6f166827c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=A0=E4=B8=8B=E5=85=8B=E5=BD=A6?= Date: Tue, 25 Feb 2020 10:41:00 +0900 Subject: [PATCH 10/38] phpcs fix --- tests/PhpSpreadsheetTests/DocumentGeneratorTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/PhpSpreadsheetTests/DocumentGeneratorTest.php b/tests/PhpSpreadsheetTests/DocumentGeneratorTest.php index da0eb4bd..b0aed466 100644 --- a/tests/PhpSpreadsheetTests/DocumentGeneratorTest.php +++ b/tests/PhpSpreadsheetTests/DocumentGeneratorTest.php @@ -12,8 +12,10 @@ class DocumentGeneratorTest extends TestCase { /** * @dataProvider providerGenerateFunctionListByName + * * @param array $phpSpreadsheetFunctions * @param string $expected + * * @throws \ReflectionException */ public function testGenerateFunctionListByName(array $phpSpreadsheetFunctions, string $expected): void @@ -23,8 +25,10 @@ class DocumentGeneratorTest extends TestCase /** * @dataProvider providerGenerateFunctionListByCategory + * * @param array $phpSpreadsheetFunctions * @param string $expected + * * @throws \ReflectionException */ public function testGenerateFunctionListByCategory(array $phpSpreadsheetFunctions, string $expected): void From 06d9dc03e90cda33dbed0a0c00f8816e81e7d308 Mon Sep 17 00:00:00 2001 From: Jimmy4o4 Date: Mon, 25 Nov 2019 08:41:55 +0100 Subject: [PATCH 11/38] Fix for Xls writer wrong selected cells and active sheet --- CHANGELOG.md | 6 ++ src/PhpSpreadsheet/Writer/Xls/Worksheet.php | 15 +++- .../Functional/ActiveSheetTest.php | 68 +++++++++++++++++++ .../Functional/SelectedCellsTest.php | 57 ++++++++++++++++ 4 files changed, 143 insertions(+), 3 deletions(-) create mode 100644 tests/PhpSpreadsheetTests/Functional/ActiveSheetTest.php create mode 100644 tests/PhpSpreadsheetTests/Functional/SelectedCellsTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index c2931dca..541e9279 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,13 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org). ## [Unreleased] +### Added + - Added support for the BASE function - Added support for the ARABIC function - Conditionals - Extend Support for (NOT)CONTAINSBLANKS [#1278](https://github.com/PHPOffice/PhpSpreadsheet/pull/1278) + +### Fixed + - Handle Error in Formula Processing Better for Xls [#1267](https://github.com/PHPOffice/PhpSpreadsheet/pull/1267) - Handle ConditionalStyle NumberFormat When Reading Xlsx File [#1296](https://github.com/PHPOffice/PhpSpreadsheet/pull/1296) - Fix Xlsx Writer's handling of decimal commas [#1282](https://github.com/PHPOffice/PhpSpreadsheet/pull/1282) - Fix for issue by removing test code mistakenly left in [#1328](https://github.com/PHPOffice/PhpSpreadsheet/pull/1328) +- Fix for Xls writer wrong selected cells and active sheet [#1256](https://github.com/PHPOffice/PhpSpreadsheet/pull/1256) ## [1.10.1] - 2019-12-02 diff --git a/src/PhpSpreadsheet/Writer/Xls/Worksheet.php b/src/PhpSpreadsheet/Writer/Xls/Worksheet.php index baa45345..5a6fa61a 100644 --- a/src/PhpSpreadsheet/Writer/Xls/Worksheet.php +++ b/src/PhpSpreadsheet/Writer/Xls/Worksheet.php @@ -281,6 +281,10 @@ class Worksheet extends BIFFwriter { $phpSheet = $this->phpSheet; + // Storing selected cells and active sheet because it changes while parsing cells with formulas. + $selectedCells = $this->phpSheet->getSelectedCells(); + $activeSheetIndex = $this->phpSheet->getParent()->getActiveSheetIndex(); + // Write BOF record $this->storeBof(0x0010); @@ -481,6 +485,9 @@ class Worksheet extends BIFFwriter // Append $this->writeMsoDrawing(); + // Restoring active sheet. + $this->phpSheet->getParent()->setActiveSheetIndex($activeSheetIndex); + // Write WINDOW2 record $this->writeWindow2(); @@ -493,6 +500,9 @@ class Worksheet extends BIFFwriter $this->writePanes(); } + // Restoring selected cells. + $this->phpSheet->setSelectedCells($selectedCells); + // Write SELECTION record $this->writeSelection(); @@ -1250,7 +1260,6 @@ class Worksheet extends BIFFwriter $fFrozenNoSplit = 0; // 0 - bit // no support in PhpSpreadsheet for selected sheet, therefore sheet is only selected if it is the active sheet $fSelected = ($this->phpSheet === $this->phpSheet->getParent()->getActiveSheet()) ? 1 : 0; - $fPaged = 1; // 2 $fPageBreakPreview = $this->phpSheet->getSheetView()->getView() === SheetView::SHEETVIEW_PAGE_BREAK_PREVIEW; $grbit = $fDspFmla; @@ -1262,8 +1271,8 @@ class Worksheet extends BIFFwriter $grbit |= $fArabic << 6; $grbit |= $fDspGuts << 7; $grbit |= $fFrozenNoSplit << 8; - $grbit |= $fSelected << 9; - $grbit |= $fPaged << 10; + $grbit |= $fSelected << 9; // Selected sheets. + $grbit |= $fSelected << 10; // Active sheet. $grbit |= $fPageBreakPreview << 11; $header = pack('vv', $record, $length); diff --git a/tests/PhpSpreadsheetTests/Functional/ActiveSheetTest.php b/tests/PhpSpreadsheetTests/Functional/ActiveSheetTest.php new file mode 100644 index 00000000..9274e9c4 --- /dev/null +++ b/tests/PhpSpreadsheetTests/Functional/ActiveSheetTest.php @@ -0,0 +1,68 @@ +setActiveSheetIndex(0) + ->setTitle('Test1') + ->setCellValue('D1', 1) + ->setCellValue('D2', 2) + ->setCellValue('D3', 3) + ->setCellValue('D4', 4) + ->setCellValue('D5', '=SUM(D1:D4)') + ->setSelectedCell('B2'); + + $spreadsheet->createSheet(1); + + $spreadsheet->setActiveSheetIndex(1) + ->setTitle('Test2') + ->setCellValue('D1', 4) + ->setCellValue('E1', 3) + ->setCellValue('F1', 2) + ->setCellValue('G1', 1) + ->setCellValue('H1', '=SUM(D1:G4)') + ->setSelectedCells('A1:B2'); + + $spreadsheet->createSheet(2); + + $spreadsheet->setActiveSheetIndex(2) + ->setTitle('Test3') + ->setCellValue('A1', 4) + ->setCellValue('B1', 3) + ->setCellValue('C1', 2) + ->setCellValue('D1', 1) + ->setCellValue('E1', '=SUM(A1:D4)') + ->setSelectedCells('A1:D1'); + + $spreadsheet->setActiveSheetIndex(1); + + $reloadedSpreadsheet = $this->writeAndReload($spreadsheet, $format); + + // Original object. + self::assertSame(1, $spreadsheet->getActiveSheetIndex()); + + // Saved and reloaded file. + self::assertSame(1, $reloadedSpreadsheet->getActiveSheetIndex()); + } +} diff --git a/tests/PhpSpreadsheetTests/Functional/SelectedCellsTest.php b/tests/PhpSpreadsheetTests/Functional/SelectedCellsTest.php new file mode 100644 index 00000000..03d4be9f --- /dev/null +++ b/tests/PhpSpreadsheetTests/Functional/SelectedCellsTest.php @@ -0,0 +1,57 @@ +setActiveSheetIndex(0) + ->setTitle('Test1') + ->setCellValue('D1', 1) + ->setCellValue('D2', 2) + ->setCellValue('D3', 3) + ->setCellValue('D4', 4) + ->setCellValue('D5', '=SUM(D1:D4)') + ->setSelectedCell('B2'); + + $spreadsheet->createSheet(1); + + $spreadsheet->setActiveSheetIndex(1) + ->setTitle('Test2') + ->setCellValue('D1', 4) + ->setCellValue('E1', 3) + ->setCellValue('F1', 2) + ->setCellValue('G1', 1) + ->setCellValue('H1', '=SUM(D1:G4)') + ->setSelectedCells('A1:B2'); + + $reloadedSpreadsheet = $this->writeAndReload($spreadsheet, $format); + + // Original object. + self::assertSame('B2', $spreadsheet->setActiveSheetIndex(0)->getSelectedCells()); + self::assertSame('A1:B2', $spreadsheet->setActiveSheetIndex(1)->getSelectedCells()); + + // Saved and reloaded file. + self::assertSame('B2', $reloadedSpreadsheet->setActiveSheetIndex(0)->getSelectedCells()); + self::assertSame('A1:B2', $reloadedSpreadsheet->setActiveSheetIndex(1)->getSelectedCells()); + } +} From fb379385e07a8500792694ca0c7ec4f5ff43aa0a Mon Sep 17 00:00:00 2001 From: Owen Leibman Date: Tue, 14 Jan 2020 19:44:06 -0800 Subject: [PATCH 12/38] Fix active cell when freeze pane is used When freeze pane is in use on a worksheet, PhpSpreadsheet saves to Xlsx in such a way that the active cell is always set to the top left cell below the freeze pane. I find it difficult to understand why: 1. You have given users the setSelectedCells function, but then choose to ignore it. 2. Excel itself does not act in this manner. 3. PHPExcel did not act in this manner. 4. PhpSpreadsheet when writing to Xls does not act in this manner. This is especially emphasized because the one test in FreezePaneTest which would expose the difference is the only test in that member which is not made for both Xls and Xlsx. 5. It is *really* useful to be able to open a spreadsheet anywhere, even when it has header rows. Closes #1323 --- CHANGELOG.md | 1 + src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php | 2 - .../Functional/FreezePaneTest.php | 69 ++++++++++++++++--- 3 files changed, 61 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 541e9279..4286fa9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Fix Xlsx Writer's handling of decimal commas [#1282](https://github.com/PHPOffice/PhpSpreadsheet/pull/1282) - Fix for issue by removing test code mistakenly left in [#1328](https://github.com/PHPOffice/PhpSpreadsheet/pull/1328) - Fix for Xls writer wrong selected cells and active sheet [#1256](https://github.com/PHPOffice/PhpSpreadsheet/pull/1256) +- Fix active cell when freeze pane is used [#1323](https://github.com/PHPOffice/PhpSpreadsheet/pull/1323) ## [1.10.1] - 2019-12-02 diff --git a/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php b/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php index bf811bdc..1d5a995a 100644 --- a/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php +++ b/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php @@ -262,8 +262,6 @@ class Worksheet extends WriterPart --$ySplit; $topLeftCell = $pSheet->getTopLeftCell(); - $activeCell = $topLeftCell; - $sqref = $topLeftCell; // pane $pane = 'topRight'; diff --git a/tests/PhpSpreadsheetTests/Functional/FreezePaneTest.php b/tests/PhpSpreadsheetTests/Functional/FreezePaneTest.php index fda67231..38709716 100644 --- a/tests/PhpSpreadsheetTests/Functional/FreezePaneTest.php +++ b/tests/PhpSpreadsheetTests/Functional/FreezePaneTest.php @@ -38,15 +38,8 @@ class FreezePaneTest extends AbstractFunctional self::assertSame($topLeftCell, $actualTopLeftCell, 'should be able to set the top left cell'); } - public function providerFormatsInvalidSelectedCells() - { - return [ - ['Xlsx'], - ]; - } - /** - * @dataProvider providerFormatsInvalidSelectedCells + * @dataProvider providerFormats * * @param string $format */ @@ -70,6 +63,64 @@ class FreezePaneTest extends AbstractFunctional self::assertSame($cellSplit, $actualCellSplit, 'should be able to set freeze pane'); self::assertSame($topLeftCell, $actualTopLeftCell, 'should be able to set the top left cell'); - self::assertSame('A24', $reloadedActive->getSelectedCells(), 'selected cell should default to be first cell after the freeze pane'); + self::assertSame('F5', $reloadedActive->getSelectedCells()); + } + + /** + * @dataProvider providerFormats + * + * @param string $format + */ + public function testFreezePaneUserSelectedCell($format) + { + $spreadsheet = new Spreadsheet(); + $worksheet = $spreadsheet->getActiveSheet(); + $worksheet->setCellValue('A1', 'Header1'); + $worksheet->setCellValue('B1', 'Header2'); + $worksheet->setCellValue('C1', 'Header3'); + $worksheet->setCellValue('A2', 'Data1'); + $worksheet->setCellValue('B2', 'Data2'); + $worksheet->setCellValue('C2', 'Data3'); + $worksheet->setCellValue('A3', 'Data4'); + $worksheet->setCellValue('B3', 'Data5'); + $worksheet->setCellValue('C3', 'Data6'); + $worksheet->freezePane('A2'); + $worksheet->setSelectedCells('C3'); + + $reloadedSpreadsheet = $this->writeAndReload($spreadsheet, $format); + // Read written file + $reloadedActive = $reloadedSpreadsheet->getActiveSheet(); + + $expected = 'C3'; + self::assertSame($expected, $reloadedActive->getSelectedCells()); + } + + /** + * @dataProvider providerFormats + * + * @param string $format + */ + public function testNoFreezePaneUserSelectedCell($format) + { + $spreadsheet = new Spreadsheet(); + $worksheet = $spreadsheet->getActiveSheet(); + $worksheet->setCellValue('A1', 'Header1'); + $worksheet->setCellValue('B1', 'Header2'); + $worksheet->setCellValue('C1', 'Header3'); + $worksheet->setCellValue('A2', 'Data1'); + $worksheet->setCellValue('B2', 'Data2'); + $worksheet->setCellValue('C2', 'Data3'); + $worksheet->setCellValue('A3', 'Data4'); + $worksheet->setCellValue('B3', 'Data5'); + $worksheet->setCellValue('C3', 'Data6'); + //$worksheet->freezePane('A2'); + $worksheet->setSelectedCells('C3'); + + $reloadedSpreadsheet = $this->writeAndReload($spreadsheet, $format); + // Read written file + $reloadedActive = $reloadedSpreadsheet->getActiveSheet(); + + $expected = 'C3'; + self::assertSame($expected, $reloadedActive->getSelectedCells()); } } From 9f5a4724268557344043384ffceb884892dfef5a Mon Sep 17 00:00:00 2001 From: Stronati Andrea Date: Wed, 15 Jan 2020 15:49:24 +0100 Subject: [PATCH 13/38] Fix XLSX file loading with autofilter containing '$' The `setRange` method of the `Xlsx/AutoFilter` class expects a filter range format like "A1:E10". The returned value from `$this->worksheetXml->autoFilter['ref']` could contain "$" and returning a value like "$A$1:$E$10". Fixes #687 Fixes #1325 Closes #1326 --- CHANGELOG.md | 1 + src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php | 3 +- .../Reader/Xlsx/AutoFilterTest.php | 69 +++++++++++++++++++ 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 tests/PhpSpreadsheetTests/Reader/Xlsx/AutoFilterTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 4286fa9c..354ec8d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Fix for issue by removing test code mistakenly left in [#1328](https://github.com/PHPOffice/PhpSpreadsheet/pull/1328) - Fix for Xls writer wrong selected cells and active sheet [#1256](https://github.com/PHPOffice/PhpSpreadsheet/pull/1256) - Fix active cell when freeze pane is used [#1323](https://github.com/PHPOffice/PhpSpreadsheet/pull/1323) +- Fix XLSX file loading with autofilter containing '$' [#1326](https://github.com/PHPOffice/PhpSpreadsheet/pull/1326) ## [1.10.1] - 2019-12-02 diff --git a/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php b/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php index 6929758d..69d5f69e 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php +++ b/src/PhpSpreadsheet/Reader/Xlsx/AutoFilter.php @@ -20,7 +20,8 @@ class AutoFilter public function load() { - $autoFilterRange = (string) $this->worksheetXml->autoFilter['ref']; + // Remove all "$" in the auto filter range + $autoFilterRange = preg_replace('/\$/', '', $this->worksheetXml->autoFilter['ref']); if (strpos($autoFilterRange, ':') !== false) { $this->readAutoFilter($autoFilterRange, $this->worksheetXml); } diff --git a/tests/PhpSpreadsheetTests/Reader/Xlsx/AutoFilterTest.php b/tests/PhpSpreadsheetTests/Reader/Xlsx/AutoFilterTest.php new file mode 100644 index 00000000..90ea17aa --- /dev/null +++ b/tests/PhpSpreadsheetTests/Reader/Xlsx/AutoFilterTest.php @@ -0,0 +1,69 @@ +getMockBuilder(Worksheet::class) + ->disableOriginalConstructor() + ->getMock(); + } + + private function getXMLInstance($ref) + { + return new \SimpleXMLElement( + '' . + '' . + '' . + '' + ); + } + + private function getAutoFilterInstance() + { + $instance = $this->getMockBuilder(WorksheetAutoFilter::class) + ->disableOriginalConstructor() + ->getMock(); + + return $instance; + } + + public function loadDataProvider() + { + return [ + ['$B3$E8', 0, 'B3E8'], + ['$B3:$E8', 1, 'B3:E8'], + ]; + } + + /** + * @dataProvider loadDataProvider + * + * @param string $ref + * @param int $expectedReadAutoFilterCalled + * @param string $expectedRef + */ + public function testLoad($ref, $expectedReadAutoFilterCalled, $expectedRef) + { + $worksheetAutoFilter = $this->getAutoFilterInstance(); + $worksheetAutoFilter->expects($this->exactly($expectedReadAutoFilterCalled ? 1 : 0)) + ->method('setRange') + ->with($expectedRef); + + $worksheet = $this->getWorksheetInstance(); + $worksheet->expects($this->exactly($expectedReadAutoFilterCalled ? 1 : 0)) + ->method('getAutoFilter') + ->willReturn($worksheetAutoFilter); + + $autoFilter = new AutoFilter($worksheet, $this->getXMLInstance($ref)); + + $autoFilter->load(); + } +} From ffb0d21cec9a1ef9abf168ce7650e6ab846208e9 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Sun, 16 Feb 2020 21:51:20 +0100 Subject: [PATCH 14/38] PHPDoc: use @return $this for fluent methods Fluent methods, especially setters, return the object on which are called. This is documented in PHPDoc using the `$this` keyword, which is equivalent to `static` with the additional notion of object identity. This helps IDEs and static analysis tools provide more meaningful output. --- CHANGELOG.md | 1 + src/PhpSpreadsheet/Cell/Cell.php | 6 +- src/PhpSpreadsheet/Cell/DataValidation.php | 26 ++-- src/PhpSpreadsheet/Cell/Hyperlink.php | 4 +- src/PhpSpreadsheet/Chart/Axis.php | 16 +-- src/PhpSpreadsheet/Chart/Chart.php | 24 ++-- src/PhpSpreadsheet/Chart/DataSeries.php | 10 +- src/PhpSpreadsheet/Chart/DataSeriesValues.php | 12 +- src/PhpSpreadsheet/Chart/GridLines.php | 18 +-- src/PhpSpreadsheet/Chart/Layout.php | 28 ++--- src/PhpSpreadsheet/Chart/PlotArea.php | 2 +- src/PhpSpreadsheet/Chart/Title.php | 2 +- src/PhpSpreadsheet/Comment.php | 16 +-- src/PhpSpreadsheet/Document/Properties.php | 24 ++-- src/PhpSpreadsheet/Document/Security.php | 10 +- src/PhpSpreadsheet/NamedRange.php | 10 +- src/PhpSpreadsheet/Reader/Csv.php | 10 +- src/PhpSpreadsheet/Reader/Html.php | 4 +- src/PhpSpreadsheet/Reader/Slk.php | 4 +- src/PhpSpreadsheet/RichText/RichText.php | 4 +- src/PhpSpreadsheet/RichText/Run.php | 2 +- src/PhpSpreadsheet/RichText/TextElement.php | 2 +- src/PhpSpreadsheet/Shared/JAMA/Matrix.php | 10 +- src/PhpSpreadsheet/Spreadsheet.php | 2 +- src/PhpSpreadsheet/Style/Alignment.php | 16 +-- src/PhpSpreadsheet/Style/Border.php | 6 +- src/PhpSpreadsheet/Style/Borders.php | 4 +- src/PhpSpreadsheet/Style/Color.php | 8 +- src/PhpSpreadsheet/Style/Conditional.php | 14 +-- src/PhpSpreadsheet/Style/Fill.php | 10 +- src/PhpSpreadsheet/Style/Font.php | 20 +-- src/PhpSpreadsheet/Style/NumberFormat.php | 6 +- src/PhpSpreadsheet/Style/Protection.php | 6 +- src/PhpSpreadsheet/Style/Style.php | 8 +- src/PhpSpreadsheet/Style/Supervisor.php | 2 +- src/PhpSpreadsheet/Worksheet/AutoFilter.php | 12 +- .../Worksheet/AutoFilter/Column.php | 18 +-- .../Worksheet/AutoFilter/Column/Rule.php | 12 +- src/PhpSpreadsheet/Worksheet/BaseDrawing.php | 24 ++-- .../Worksheet/ColumnCellIterator.php | 6 +- .../Worksheet/ColumnDimension.php | 6 +- .../Worksheet/ColumnIterator.php | 6 +- src/PhpSpreadsheet/Worksheet/Dimension.php | 8 +- src/PhpSpreadsheet/Worksheet/Drawing.php | 2 +- .../Worksheet/Drawing/Shadow.php | 14 +-- src/PhpSpreadsheet/Worksheet/HeaderFooter.php | 26 ++-- .../Worksheet/MemoryDrawing.php | 6 +- src/PhpSpreadsheet/Worksheet/PageMargins.php | 12 +- src/PhpSpreadsheet/Worksheet/PageSetup.php | 38 +++--- src/PhpSpreadsheet/Worksheet/Protection.php | 34 ++--- .../Worksheet/RowCellIterator.php | 6 +- src/PhpSpreadsheet/Worksheet/RowDimension.php | 6 +- src/PhpSpreadsheet/Worksheet/RowIterator.php | 6 +- src/PhpSpreadsheet/Worksheet/SheetView.php | 6 +- src/PhpSpreadsheet/Worksheet/Worksheet.php | 118 +++++++++--------- src/PhpSpreadsheet/Writer/Csv.php | 14 +-- src/PhpSpreadsheet/Writer/Html.php | 14 ++- src/PhpSpreadsheet/Writer/Ods.php | 2 +- src/PhpSpreadsheet/Writer/Pdf.php | 2 +- src/PhpSpreadsheet/Writer/Xlsx.php | 4 +- 60 files changed, 376 insertions(+), 373 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 354ec8d1..64075749 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Fix for Xls writer wrong selected cells and active sheet [#1256](https://github.com/PHPOffice/PhpSpreadsheet/pull/1256) - Fix active cell when freeze pane is used [#1323](https://github.com/PHPOffice/PhpSpreadsheet/pull/1323) - Fix XLSX file loading with autofilter containing '$' [#1326](https://github.com/PHPOffice/PhpSpreadsheet/pull/1326) +- PHPDoc - Use `@return $this` for fluent methods [#1362](https://github.com/PHPOffice/PhpSpreadsheet/pull/1362) ## [1.10.1] - 2019-12-02 diff --git a/src/PhpSpreadsheet/Cell/Cell.php b/src/PhpSpreadsheet/Cell/Cell.php index cdef9018..bae8261e 100644 --- a/src/PhpSpreadsheet/Cell/Cell.php +++ b/src/PhpSpreadsheet/Cell/Cell.php @@ -67,7 +67,7 @@ class Cell /** * Update the cell into the cell collection. * - * @return self + * @return $this */ public function updateInCollection() { @@ -177,7 +177,7 @@ class Cell * * @throws Exception * - * @return Cell + * @return $this */ public function setValue($pValue) { @@ -672,7 +672,7 @@ class Cell * * @param mixed $pAttributes * - * @return Cell + * @return $this */ public function setFormulaAttributes($pAttributes) { diff --git a/src/PhpSpreadsheet/Cell/DataValidation.php b/src/PhpSpreadsheet/Cell/DataValidation.php index a041ea0e..dfeb024c 100644 --- a/src/PhpSpreadsheet/Cell/DataValidation.php +++ b/src/PhpSpreadsheet/Cell/DataValidation.php @@ -142,7 +142,7 @@ class DataValidation * * @param string $value * - * @return DataValidation + * @return $this */ public function setFormula1($value) { @@ -166,7 +166,7 @@ class DataValidation * * @param string $value * - * @return DataValidation + * @return $this */ public function setFormula2($value) { @@ -190,7 +190,7 @@ class DataValidation * * @param string $value * - * @return DataValidation + * @return $this */ public function setType($value) { @@ -214,7 +214,7 @@ class DataValidation * * @param string $value see self::STYLE_* * - * @return DataValidation + * @return $this */ public function setErrorStyle($value) { @@ -238,7 +238,7 @@ class DataValidation * * @param string $value * - * @return DataValidation + * @return $this */ public function setOperator($value) { @@ -262,7 +262,7 @@ class DataValidation * * @param bool $value * - * @return DataValidation + * @return $this */ public function setAllowBlank($value) { @@ -286,7 +286,7 @@ class DataValidation * * @param bool $value * - * @return DataValidation + * @return $this */ public function setShowDropDown($value) { @@ -310,7 +310,7 @@ class DataValidation * * @param bool $value * - * @return DataValidation + * @return $this */ public function setShowInputMessage($value) { @@ -334,7 +334,7 @@ class DataValidation * * @param bool $value * - * @return DataValidation + * @return $this */ public function setShowErrorMessage($value) { @@ -358,7 +358,7 @@ class DataValidation * * @param string $value * - * @return DataValidation + * @return $this */ public function setErrorTitle($value) { @@ -382,7 +382,7 @@ class DataValidation * * @param string $value * - * @return DataValidation + * @return $this */ public function setError($value) { @@ -406,7 +406,7 @@ class DataValidation * * @param string $value * - * @return DataValidation + * @return $this */ public function setPromptTitle($value) { @@ -430,7 +430,7 @@ class DataValidation * * @param string $value * - * @return DataValidation + * @return $this */ public function setPrompt($value) { diff --git a/src/PhpSpreadsheet/Cell/Hyperlink.php b/src/PhpSpreadsheet/Cell/Hyperlink.php index e17c20d9..003d5101 100644 --- a/src/PhpSpreadsheet/Cell/Hyperlink.php +++ b/src/PhpSpreadsheet/Cell/Hyperlink.php @@ -46,7 +46,7 @@ class Hyperlink * * @param string $value * - * @return Hyperlink + * @return $this */ public function setUrl($value) { @@ -70,7 +70,7 @@ class Hyperlink * * @param string $value * - * @return Hyperlink + * @return $this */ public function setTooltip($value) { diff --git a/src/PhpSpreadsheet/Chart/Axis.php b/src/PhpSpreadsheet/Chart/Axis.php index 3d1dd222..66242e34 100644 --- a/src/PhpSpreadsheet/Chart/Axis.php +++ b/src/PhpSpreadsheet/Chart/Axis.php @@ -354,7 +354,7 @@ class Axis extends Properties * * @param int $shadow_presets * - * @return Axis + * @return $this */ private function setShadowPresetsProperties($shadow_presets) { @@ -370,7 +370,7 @@ class Axis extends Properties * @param array $properties_map * @param mixed &$reference * - * @return Axis + * @return $this */ private function setShadowProperiesMapValues(array $properties_map, &$reference = null) { @@ -402,7 +402,7 @@ class Axis extends Properties * @param int $alpha * @param string $type * - * @return Axis + * @return $this */ private function setShadowColor($color, $alpha, $type) { @@ -416,7 +416,7 @@ class Axis extends Properties * * @param float $blur * - * @return Axis + * @return $this */ private function setShadowBlur($blur) { @@ -432,7 +432,7 @@ class Axis extends Properties * * @param int $angle * - * @return Axis + * @return $this */ private function setShadowAngle($angle) { @@ -448,7 +448,7 @@ class Axis extends Properties * * @param float $distance * - * @return Axis + * @return $this */ private function setShadowDistance($distance) { @@ -506,7 +506,7 @@ class Axis extends Properties * * @param float $size * - * @return Axis + * @return $this */ private function setGlowSize($size) { @@ -524,7 +524,7 @@ class Axis extends Properties * @param int $alpha * @param string $type * - * @return Axis + * @return $this */ private function setGlowColor($color, $alpha, $type) { diff --git a/src/PhpSpreadsheet/Chart/Chart.php b/src/PhpSpreadsheet/Chart/Chart.php index 921795da..59c9ed5d 100644 --- a/src/PhpSpreadsheet/Chart/Chart.php +++ b/src/PhpSpreadsheet/Chart/Chart.php @@ -197,7 +197,7 @@ class Chart * * @param Worksheet $pValue * - * @return Chart + * @return $this */ public function setWorksheet(Worksheet $pValue = null) { @@ -221,7 +221,7 @@ class Chart * * @param Title $title * - * @return Chart + * @return $this */ public function setTitle(Title $title) { @@ -245,7 +245,7 @@ class Chart * * @param Legend $legend * - * @return Chart + * @return $this */ public function setLegend(Legend $legend) { @@ -269,7 +269,7 @@ class Chart * * @param Title $label * - * @return Chart + * @return $this */ public function setXAxisLabel(Title $label) { @@ -293,7 +293,7 @@ class Chart * * @param Title $label * - * @return Chart + * @return $this */ public function setYAxisLabel(Title $label) { @@ -327,7 +327,7 @@ class Chart * * @param bool $plotVisibleOnly * - * @return Chart + * @return $this */ public function setPlotVisibleOnly($plotVisibleOnly) { @@ -351,7 +351,7 @@ class Chart * * @param string $displayBlanksAs * - * @return Chart + * @return $this */ public function setDisplayBlanksAs($displayBlanksAs) { @@ -423,7 +423,7 @@ class Chart * @param int $xOffset * @param int $yOffset * - * @return Chart + * @return $this */ public function setTopLeftPosition($cell, $xOffset = null, $yOffset = null) { @@ -467,7 +467,7 @@ class Chart * * @param string $cell * - * @return Chart + * @return $this */ public function setTopLeftCell($cell) { @@ -482,7 +482,7 @@ class Chart * @param int $xOffset * @param int $yOffset * - * @return Chart + * @return $this */ public function setTopLeftOffset($xOffset, $yOffset) { @@ -541,7 +541,7 @@ class Chart * @param int $xOffset * @param int $yOffset * - * @return Chart + * @return $this */ public function setBottomRightPosition($cell, $xOffset = null, $yOffset = null) { @@ -593,7 +593,7 @@ class Chart * @param int $xOffset * @param int $yOffset * - * @return Chart + * @return $this */ public function setBottomRightOffset($xOffset, $yOffset) { diff --git a/src/PhpSpreadsheet/Chart/DataSeries.php b/src/PhpSpreadsheet/Chart/DataSeries.php index 8056bbee..c20efabe 100644 --- a/src/PhpSpreadsheet/Chart/DataSeries.php +++ b/src/PhpSpreadsheet/Chart/DataSeries.php @@ -157,7 +157,7 @@ class DataSeries * * @param string $plotType * - * @return DataSeries + * @return $this */ public function setPlotType($plotType) { @@ -181,7 +181,7 @@ class DataSeries * * @param string $groupingType * - * @return DataSeries + * @return $this */ public function setPlotGrouping($groupingType) { @@ -205,7 +205,7 @@ class DataSeries * * @param string $plotDirection * - * @return DataSeries + * @return $this */ public function setPlotDirection($plotDirection) { @@ -297,7 +297,7 @@ class DataSeries * * @param null|string $plotStyle * - * @return DataSeries + * @return $this */ public function setPlotStyle($plotStyle) { @@ -360,7 +360,7 @@ class DataSeries * * @param bool $smoothLine * - * @return DataSeries + * @return $this */ public function setSmoothLine($smoothLine) { diff --git a/src/PhpSpreadsheet/Chart/DataSeriesValues.php b/src/PhpSpreadsheet/Chart/DataSeriesValues.php index a568e3fa..ec40cb84 100644 --- a/src/PhpSpreadsheet/Chart/DataSeriesValues.php +++ b/src/PhpSpreadsheet/Chart/DataSeriesValues.php @@ -117,7 +117,7 @@ class DataSeriesValues * * @throws Exception * - * @return DataSeriesValues + * @return $this */ public function setDataType($dataType) { @@ -144,7 +144,7 @@ class DataSeriesValues * * @param string $dataSource * - * @return DataSeriesValues + * @return $this */ public function setDataSource($dataSource) { @@ -168,7 +168,7 @@ class DataSeriesValues * * @param string $marker * - * @return DataSeriesValues + * @return $this */ public function setPointMarker($marker) { @@ -192,7 +192,7 @@ class DataSeriesValues * * @param string $formatCode * - * @return DataSeriesValues + * @return $this */ public function setFormatCode($formatCode) { @@ -275,7 +275,7 @@ class DataSeriesValues * * @param int $width * - * @return DataSeriesValues + * @return $this */ public function setLineWidth($width) { @@ -346,7 +346,7 @@ class DataSeriesValues * * @param array $dataValues * - * @return DataSeriesValues + * @return $this */ public function setDataValues($dataValues) { diff --git a/src/PhpSpreadsheet/Chart/GridLines.php b/src/PhpSpreadsheet/Chart/GridLines.php index 8cc83e55..b07fcae5 100644 --- a/src/PhpSpreadsheet/Chart/GridLines.php +++ b/src/PhpSpreadsheet/Chart/GridLines.php @@ -91,7 +91,7 @@ class GridLines extends Properties /** * Change Object State to True. * - * @return GridLines + * @return $this */ private function activateObject() { @@ -229,7 +229,7 @@ class GridLines extends Properties * * @param float $size * - * @return GridLines + * @return $this */ private function setGlowSize($size) { @@ -245,7 +245,7 @@ class GridLines extends Properties * @param int $alpha * @param string $type * - * @return GridLines + * @return $this */ private function setGlowColor($color, $alpha, $type) { @@ -305,7 +305,7 @@ class GridLines extends Properties * * @param int $shadow_presets * - * @return GridLines + * @return $this */ private function setShadowPresetsProperties($shadow_presets) { @@ -321,7 +321,7 @@ class GridLines extends Properties * @param array $properties_map * @param mixed &$reference * - * @return GridLines + * @return $this */ private function setShadowProperiesMapValues(array $properties_map, &$reference = null) { @@ -353,7 +353,7 @@ class GridLines extends Properties * @param int $alpha * @param string $type * - * @return GridLines + * @return $this */ private function setShadowColor($color, $alpha, $type) { @@ -375,7 +375,7 @@ class GridLines extends Properties * * @param float $blur * - * @return GridLines + * @return $this */ private function setShadowBlur($blur) { @@ -391,7 +391,7 @@ class GridLines extends Properties * * @param int $angle * - * @return GridLines + * @return $this */ private function setShadowAngle($angle) { @@ -407,7 +407,7 @@ class GridLines extends Properties * * @param float $distance * - * @return GridLines + * @return $this */ private function setShadowDistance($distance) { diff --git a/src/PhpSpreadsheet/Chart/Layout.php b/src/PhpSpreadsheet/Chart/Layout.php index a8a96d2f..3e989c6d 100644 --- a/src/PhpSpreadsheet/Chart/Layout.php +++ b/src/PhpSpreadsheet/Chart/Layout.php @@ -153,7 +153,7 @@ class Layout * * @param string $value * - * @return Layout + * @return $this */ public function setLayoutTarget($value) { @@ -177,7 +177,7 @@ class Layout * * @param string $value * - * @return Layout + * @return $this */ public function setXMode($value) { @@ -201,7 +201,7 @@ class Layout * * @param string $value * - * @return Layout + * @return $this */ public function setYMode($value) { @@ -225,7 +225,7 @@ class Layout * * @param float $value * - * @return Layout + * @return $this */ public function setXPosition($value) { @@ -249,7 +249,7 @@ class Layout * * @param float $value * - * @return Layout + * @return $this */ public function setYPosition($value) { @@ -273,7 +273,7 @@ class Layout * * @param float $value * - * @return Layout + * @return $this */ public function setWidth($value) { @@ -297,7 +297,7 @@ class Layout * * @param float $value * - * @return Layout + * @return $this */ public function setHeight($value) { @@ -322,7 +322,7 @@ class Layout * * @param bool $value Show legend key * - * @return Layout + * @return $this */ public function setShowLegendKey($value) { @@ -347,7 +347,7 @@ class Layout * * @param bool $value Show val * - * @return Layout + * @return $this */ public function setShowVal($value) { @@ -372,7 +372,7 @@ class Layout * * @param bool $value Show cat name * - * @return Layout + * @return $this */ public function setShowCatName($value) { @@ -397,7 +397,7 @@ class Layout * * @param bool $value Show series name * - * @return Layout + * @return $this */ public function setShowSerName($value) { @@ -422,7 +422,7 @@ class Layout * * @param bool $value Show percentage * - * @return Layout + * @return $this */ public function setShowPercent($value) { @@ -447,7 +447,7 @@ class Layout * * @param bool $value Show bubble size * - * @return Layout + * @return $this */ public function setShowBubbleSize($value) { @@ -472,7 +472,7 @@ class Layout * * @param bool $value Show leader lines * - * @return Layout + * @return $this */ public function setShowLeaderLines($value) { diff --git a/src/PhpSpreadsheet/Chart/PlotArea.php b/src/PhpSpreadsheet/Chart/PlotArea.php index b98c638d..9da4aa32 100644 --- a/src/PhpSpreadsheet/Chart/PlotArea.php +++ b/src/PhpSpreadsheet/Chart/PlotArea.php @@ -94,7 +94,7 @@ class PlotArea * * @param DataSeries[] $plotSeries * - * @return PlotArea + * @return $this */ public function setPlotSeries(array $plotSeries) { diff --git a/src/PhpSpreadsheet/Chart/Title.php b/src/PhpSpreadsheet/Chart/Title.php index f53c6b37..650bcdc1 100644 --- a/src/PhpSpreadsheet/Chart/Title.php +++ b/src/PhpSpreadsheet/Chart/Title.php @@ -45,7 +45,7 @@ class Title * * @param string $caption * - * @return Title + * @return $this */ public function setCaption($caption) { diff --git a/src/PhpSpreadsheet/Comment.php b/src/PhpSpreadsheet/Comment.php index 1b5ab1fd..8041ddaf 100644 --- a/src/PhpSpreadsheet/Comment.php +++ b/src/PhpSpreadsheet/Comment.php @@ -96,7 +96,7 @@ class Comment implements IComparable * * @param string $author * - * @return Comment + * @return $this */ public function setAuthor($author) { @@ -120,7 +120,7 @@ class Comment implements IComparable * * @param RichText $pValue * - * @return Comment + * @return $this */ public function setText(RichText $pValue) { @@ -144,7 +144,7 @@ class Comment implements IComparable * * @param string $width * - * @return Comment + * @return $this */ public function setWidth($width) { @@ -168,7 +168,7 @@ class Comment implements IComparable * * @param string $value * - * @return Comment + * @return $this */ public function setHeight($value) { @@ -192,7 +192,7 @@ class Comment implements IComparable * * @param string $value * - * @return Comment + * @return $this */ public function setMarginLeft($value) { @@ -216,7 +216,7 @@ class Comment implements IComparable * * @param string $value * - * @return Comment + * @return $this */ public function setMarginTop($value) { @@ -240,7 +240,7 @@ class Comment implements IComparable * * @param bool $value * - * @return Comment + * @return $this */ public function setVisible($value) { @@ -264,7 +264,7 @@ class Comment implements IComparable * * @param string $alignment see Style\Alignment::HORIZONTAL_* * - * @return Comment + * @return $this */ public function setAlignment($alignment) { diff --git a/src/PhpSpreadsheet/Document/Properties.php b/src/PhpSpreadsheet/Document/Properties.php index 1a432db0..58fd2ef6 100644 --- a/src/PhpSpreadsheet/Document/Properties.php +++ b/src/PhpSpreadsheet/Document/Properties.php @@ -122,7 +122,7 @@ class Properties * * @param string $creator * - * @return Properties + * @return $this */ public function setCreator($creator) { @@ -146,7 +146,7 @@ class Properties * * @param string $pValue * - * @return Properties + * @return $this */ public function setLastModifiedBy($pValue) { @@ -170,7 +170,7 @@ class Properties * * @param int|string $time * - * @return Properties + * @return $this */ public function setCreated($time) { @@ -204,7 +204,7 @@ class Properties * * @param int|string $time * - * @return Properties + * @return $this */ public function setModified($time) { @@ -238,7 +238,7 @@ class Properties * * @param string $title * - * @return Properties + * @return $this */ public function setTitle($title) { @@ -262,7 +262,7 @@ class Properties * * @param string $description * - * @return Properties + * @return $this */ public function setDescription($description) { @@ -286,7 +286,7 @@ class Properties * * @param string $subject * - * @return Properties + * @return $this */ public function setSubject($subject) { @@ -310,7 +310,7 @@ class Properties * * @param string $keywords * - * @return Properties + * @return $this */ public function setKeywords($keywords) { @@ -334,7 +334,7 @@ class Properties * * @param string $category * - * @return Properties + * @return $this */ public function setCategory($category) { @@ -358,7 +358,7 @@ class Properties * * @param string $company * - * @return Properties + * @return $this */ public function setCompany($company) { @@ -382,7 +382,7 @@ class Properties * * @param string $manager * - * @return Properties + * @return $this */ public function setManager($manager) { @@ -453,7 +453,7 @@ class Properties * 'd' : Date/Time * 'b' : Boolean * - * @return Properties + * @return $this */ public function setCustomProperty($propertyName, $propertyValue = '', $propertyType = null) { diff --git a/src/PhpSpreadsheet/Document/Security.php b/src/PhpSpreadsheet/Document/Security.php index 1682678c..cef3db8c 100644 --- a/src/PhpSpreadsheet/Document/Security.php +++ b/src/PhpSpreadsheet/Document/Security.php @@ -75,7 +75,7 @@ class Security * * @param bool $pValue * - * @return Security + * @return $this */ public function setLockRevision($pValue) { @@ -99,7 +99,7 @@ class Security * * @param bool $pValue * - * @return Security + * @return $this */ public function setLockStructure($pValue) { @@ -123,7 +123,7 @@ class Security * * @param bool $pValue * - * @return Security + * @return $this */ public function setLockWindows($pValue) { @@ -148,7 +148,7 @@ class Security * @param string $pValue * @param bool $pAlreadyHashed If the password has already been hashed, set this to true * - * @return Security + * @return $this */ public function setRevisionsPassword($pValue, $pAlreadyHashed = false) { @@ -176,7 +176,7 @@ class Security * @param string $pValue * @param bool $pAlreadyHashed If the password has already been hashed, set this to true * - * @return Security + * @return $this */ public function setWorkbookPassword($pValue, $pAlreadyHashed = false) { diff --git a/src/PhpSpreadsheet/NamedRange.php b/src/PhpSpreadsheet/NamedRange.php index 1f94d5a4..e539b7c5 100644 --- a/src/PhpSpreadsheet/NamedRange.php +++ b/src/PhpSpreadsheet/NamedRange.php @@ -82,7 +82,7 @@ class NamedRange * * @param string $value * - * @return NamedRange + * @return $this */ public function setName($value) { @@ -123,7 +123,7 @@ class NamedRange * * @param Worksheet $value * - * @return NamedRange + * @return $this */ public function setWorksheet(Worksheet $value = null) { @@ -149,7 +149,7 @@ class NamedRange * * @param string $value * - * @return NamedRange + * @return $this */ public function setRange($value) { @@ -175,7 +175,7 @@ class NamedRange * * @param bool $value * - * @return NamedRange + * @return $this */ public function setLocalOnly($value) { @@ -200,7 +200,7 @@ class NamedRange * * @param null|Worksheet $value * - * @return NamedRange + * @return $this */ public function setScope(Worksheet $value = null) { diff --git a/src/PhpSpreadsheet/Reader/Csv.php b/src/PhpSpreadsheet/Reader/Csv.php index 21251913..47134098 100644 --- a/src/PhpSpreadsheet/Reader/Csv.php +++ b/src/PhpSpreadsheet/Reader/Csv.php @@ -70,7 +70,7 @@ class Csv extends BaseReader * * @param string $pValue Input encoding, eg: 'UTF-8' * - * @return Csv + * @return $this */ public function setInputEncoding($pValue) { @@ -415,7 +415,7 @@ class Csv extends BaseReader * * @param string $delimiter Delimiter, eg: ',' * - * @return CSV + * @return $this */ public function setDelimiter($delimiter) { @@ -439,7 +439,7 @@ class Csv extends BaseReader * * @param string $enclosure Enclosure, defaults to " * - * @return CSV + * @return $this */ public function setEnclosure($enclosure) { @@ -466,7 +466,7 @@ class Csv extends BaseReader * * @param int $pValue Sheet index * - * @return CSV + * @return $this */ public function setSheetIndex($pValue) { @@ -480,7 +480,7 @@ class Csv extends BaseReader * * @param bool $contiguous * - * @return Csv + * @return $this */ public function setContiguous($contiguous) { diff --git a/src/PhpSpreadsheet/Reader/Html.php b/src/PhpSpreadsheet/Reader/Html.php index b500d3ae..a255cfd9 100644 --- a/src/PhpSpreadsheet/Reader/Html.php +++ b/src/PhpSpreadsheet/Reader/Html.php @@ -223,7 +223,7 @@ class Html extends BaseReader * * @param string $pValue Input encoding, eg: 'ANSI' * - * @return Html + * @return $this */ public function setInputEncoding($pValue) { @@ -669,7 +669,7 @@ class Html extends BaseReader * * @param int $pValue Sheet index * - * @return HTML + * @return $this */ public function setSheetIndex($pValue) { diff --git a/src/PhpSpreadsheet/Reader/Slk.php b/src/PhpSpreadsheet/Reader/Slk.php index d73f598c..9912e937 100644 --- a/src/PhpSpreadsheet/Reader/Slk.php +++ b/src/PhpSpreadsheet/Reader/Slk.php @@ -83,7 +83,7 @@ class Slk extends BaseReader * * @param string $pValue Input encoding, eg: 'ANSI' * - * @return Slk + * @return $this */ public function setInputEncoding($pValue) { @@ -485,7 +485,7 @@ class Slk extends BaseReader * * @param int $pValue Sheet index * - * @return Slk + * @return $this */ public function setSheetIndex($pValue) { diff --git a/src/PhpSpreadsheet/RichText/RichText.php b/src/PhpSpreadsheet/RichText/RichText.php index 76a04d54..6e90fa35 100644 --- a/src/PhpSpreadsheet/RichText/RichText.php +++ b/src/PhpSpreadsheet/RichText/RichText.php @@ -47,7 +47,7 @@ class RichText implements IComparable * * @param ITextElement $pText Rich text element * - * @return RichText + * @return $this */ public function addText(ITextElement $pText) { @@ -133,7 +133,7 @@ class RichText implements IComparable * * @param ITextElement[] $textElements Array of elements * - * @return RichText + * @return $this */ public function setRichTextElements(array $textElements) { diff --git a/src/PhpSpreadsheet/RichText/Run.php b/src/PhpSpreadsheet/RichText/Run.php index b4996235..aa4a8e46 100644 --- a/src/PhpSpreadsheet/RichText/Run.php +++ b/src/PhpSpreadsheet/RichText/Run.php @@ -40,7 +40,7 @@ class Run extends TextElement implements ITextElement * * @param Font $pFont Font * - * @return ITextElement + * @return $this */ public function setFont(Font $pFont = null) { diff --git a/src/PhpSpreadsheet/RichText/TextElement.php b/src/PhpSpreadsheet/RichText/TextElement.php index d9ad0d7f..f8be5d55 100644 --- a/src/PhpSpreadsheet/RichText/TextElement.php +++ b/src/PhpSpreadsheet/RichText/TextElement.php @@ -37,7 +37,7 @@ class TextElement implements ITextElement * * @param $text string Text * - * @return ITextElement + * @return $this */ public function setText($text) { diff --git a/src/PhpSpreadsheet/Shared/JAMA/Matrix.php b/src/PhpSpreadsheet/Shared/JAMA/Matrix.php index 17f32107..a67b6c2d 100644 --- a/src/PhpSpreadsheet/Shared/JAMA/Matrix.php +++ b/src/PhpSpreadsheet/Shared/JAMA/Matrix.php @@ -524,7 +524,7 @@ class Matrix * * @param mixed $B Matrix/Array * - * @return Matrix Sum + * @return $this */ public function plusEquals(...$args) { @@ -628,7 +628,7 @@ class Matrix * * @param mixed $B Matrix/Array * - * @return Matrix Sum + * @return $this */ public function minusEquals(...$args) { @@ -734,7 +734,7 @@ class Matrix * * @param mixed $B Matrix/Array * - * @return Matrix Matrix Aij + * @return $this */ public function arrayTimesEquals(...$args) { @@ -1091,7 +1091,7 @@ class Matrix * * @param mixed $B Matrix/Array * - * @return Matrix Sum + * @return $this */ public function power(...$args) { @@ -1150,7 +1150,7 @@ class Matrix * * @param mixed $B Matrix/Array * - * @return Matrix Sum + * @return $this */ public function concat(...$args) { diff --git a/src/PhpSpreadsheet/Spreadsheet.php b/src/PhpSpreadsheet/Spreadsheet.php index 04a9f1df..d33a9871 100644 --- a/src/PhpSpreadsheet/Spreadsheet.php +++ b/src/PhpSpreadsheet/Spreadsheet.php @@ -955,7 +955,7 @@ class Spreadsheet * @param string $namedRange * @param null|Worksheet $pSheet scope: use null for global scope * - * @return Spreadsheet + * @return $this */ public function removeNamedRange($namedRange, Worksheet $pSheet = null) { diff --git a/src/PhpSpreadsheet/Style/Alignment.php b/src/PhpSpreadsheet/Style/Alignment.php index b4df792b..5eb7c2b0 100644 --- a/src/PhpSpreadsheet/Style/Alignment.php +++ b/src/PhpSpreadsheet/Style/Alignment.php @@ -140,7 +140,7 @@ class Alignment extends Supervisor * * @throws PhpSpreadsheetException * - * @return Alignment + * @return $this */ public function applyFromArray(array $pStyles) { @@ -193,7 +193,7 @@ class Alignment extends Supervisor * * @param string $pValue see self::HORIZONTAL_* * - * @return Alignment + * @return $this */ public function setHorizontal($pValue) { @@ -230,7 +230,7 @@ class Alignment extends Supervisor * * @param string $pValue see self::VERTICAL_* * - * @return Alignment + * @return $this */ public function setVertical($pValue) { @@ -269,7 +269,7 @@ class Alignment extends Supervisor * * @throws PhpSpreadsheetException * - * @return Alignment + * @return $this */ public function setTextRotation($pValue) { @@ -312,7 +312,7 @@ class Alignment extends Supervisor * * @param bool $pValue * - * @return Alignment + * @return $this */ public function setWrapText($pValue) { @@ -348,7 +348,7 @@ class Alignment extends Supervisor * * @param bool $pValue * - * @return Alignment + * @return $this */ public function setShrinkToFit($pValue) { @@ -384,7 +384,7 @@ class Alignment extends Supervisor * * @param int $pValue * - * @return Alignment + * @return $this */ public function setIndent($pValue) { @@ -424,7 +424,7 @@ class Alignment extends Supervisor * * @param int $pValue * - * @return Alignment + * @return $this */ public function setReadOrder($pValue) { diff --git a/src/PhpSpreadsheet/Style/Border.php b/src/PhpSpreadsheet/Style/Border.php index c957cf59..5fa0cae7 100644 --- a/src/PhpSpreadsheet/Style/Border.php +++ b/src/PhpSpreadsheet/Style/Border.php @@ -127,7 +127,7 @@ class Border extends Supervisor * * @throws PhpSpreadsheetException * - * @return Border + * @return $this */ public function applyFromArray(array $pStyles) { @@ -166,7 +166,7 @@ class Border extends Supervisor * When passing a boolean, FALSE equates Border::BORDER_NONE * and TRUE to Border::BORDER_MEDIUM * - * @return Border + * @return $this */ public function setBorderStyle($pValue) { @@ -202,7 +202,7 @@ class Border extends Supervisor * * @throws PhpSpreadsheetException * - * @return Border + * @return $this */ public function setColor(Color $pValue) { diff --git a/src/PhpSpreadsheet/Style/Borders.php b/src/PhpSpreadsheet/Style/Borders.php index a1d6759b..8f005a99 100644 --- a/src/PhpSpreadsheet/Style/Borders.php +++ b/src/PhpSpreadsheet/Style/Borders.php @@ -197,7 +197,7 @@ class Borders extends Supervisor * * @throws PhpSpreadsheetException * - * @return Borders + * @return $this */ public function applyFromArray(array $pStyles) { @@ -382,7 +382,7 @@ class Borders extends Supervisor * * @param int $pValue see self::DIAGONAL_* * - * @return Borders + * @return $this */ public function setDiagonalDirection($pValue) { diff --git a/src/PhpSpreadsheet/Style/Color.php b/src/PhpSpreadsheet/Style/Color.php index 60e4a8ce..ab22cbe3 100644 --- a/src/PhpSpreadsheet/Style/Color.php +++ b/src/PhpSpreadsheet/Style/Color.php @@ -106,7 +106,7 @@ class Color extends Supervisor * * @throws PhpSpreadsheetException * - * @return Color + * @return $this */ public function applyFromArray(array $pStyles) { @@ -143,7 +143,7 @@ class Color extends Supervisor * * @param string $pValue see self::COLOR_* * - * @return Color + * @return $this */ public function setARGB($pValue) { @@ -179,7 +179,7 @@ class Color extends Supervisor * * @param string $pValue RGB value * - * @return Color + * @return $this */ public function setRGB($pValue) { @@ -312,7 +312,7 @@ class Color extends Supervisor * @param bool $background Flag to indicate whether default background or foreground colour * should be returned if the indexed colour doesn't exist * - * @return Color + * @return self */ public static function indexedColor($pIndex, $background = false) { diff --git a/src/PhpSpreadsheet/Style/Conditional.php b/src/PhpSpreadsheet/Style/Conditional.php index 48375937..ec8c858b 100644 --- a/src/PhpSpreadsheet/Style/Conditional.php +++ b/src/PhpSpreadsheet/Style/Conditional.php @@ -94,7 +94,7 @@ class Conditional implements IComparable * * @param string $pValue Condition type, see self::CONDITION_* * - * @return Conditional + * @return $this */ public function setConditionType($pValue) { @@ -118,7 +118,7 @@ class Conditional implements IComparable * * @param string $pValue Conditional operator type, see self::OPERATOR_* * - * @return Conditional + * @return $this */ public function setOperatorType($pValue) { @@ -142,7 +142,7 @@ class Conditional implements IComparable * * @param string $value * - * @return Conditional + * @return $this */ public function setText($value) { @@ -166,7 +166,7 @@ class Conditional implements IComparable * * @param bool $value * - * @return Conditional + * @return $this */ public function setStopIfTrue($value) { @@ -190,7 +190,7 @@ class Conditional implements IComparable * * @param string[] $pValue Condition * - * @return Conditional + * @return $this */ public function setConditions($pValue) { @@ -207,7 +207,7 @@ class Conditional implements IComparable * * @param string $pValue Condition * - * @return Conditional + * @return $this */ public function addCondition($pValue) { @@ -231,7 +231,7 @@ class Conditional implements IComparable * * @param Style $pValue * - * @return Conditional + * @return $this */ public function setStyle(Style $pValue = null) { diff --git a/src/PhpSpreadsheet/Style/Fill.php b/src/PhpSpreadsheet/Style/Fill.php index ce616c9d..1d6bace1 100644 --- a/src/PhpSpreadsheet/Style/Fill.php +++ b/src/PhpSpreadsheet/Style/Fill.php @@ -141,7 +141,7 @@ class Fill extends Supervisor * * @throws PhpSpreadsheetException * - * @return Fill + * @return $this */ public function applyFromArray(array $pStyles) { @@ -188,7 +188,7 @@ class Fill extends Supervisor * * @param string $pValue Fill type, see self::FILL_* * - * @return Fill + * @return $this */ public function setFillType($pValue) { @@ -221,7 +221,7 @@ class Fill extends Supervisor * * @param float $pValue * - * @return Fill + * @return $this */ public function setRotation($pValue) { @@ -252,7 +252,7 @@ class Fill extends Supervisor * * @throws PhpSpreadsheetException * - * @return Fill + * @return $this */ public function setStartColor(Color $pValue) { @@ -286,7 +286,7 @@ class Fill extends Supervisor * * @throws PhpSpreadsheetException * - * @return Fill + * @return $this */ public function setEndColor(Color $pValue) { diff --git a/src/PhpSpreadsheet/Style/Font.php b/src/PhpSpreadsheet/Style/Font.php index 6d8e23b1..0341cad0 100644 --- a/src/PhpSpreadsheet/Style/Font.php +++ b/src/PhpSpreadsheet/Style/Font.php @@ -161,7 +161,7 @@ class Font extends Supervisor * * @throws PhpSpreadsheetException * - * @return Font + * @return $this */ public function applyFromArray(array $pStyles) { @@ -219,7 +219,7 @@ class Font extends Supervisor * * @param string $pValue * - * @return Font + * @return $this */ public function setName($pValue) { @@ -255,7 +255,7 @@ class Font extends Supervisor * * @param float $pValue * - * @return Font + * @return $this */ public function setSize($pValue) { @@ -291,7 +291,7 @@ class Font extends Supervisor * * @param bool $pValue * - * @return Font + * @return $this */ public function setBold($pValue) { @@ -327,7 +327,7 @@ class Font extends Supervisor * * @param bool $pValue * - * @return Font + * @return $this */ public function setItalic($pValue) { @@ -363,7 +363,7 @@ class Font extends Supervisor * * @param bool $pValue * - * @return Font + * @return $this */ public function setSuperscript($pValue) { @@ -400,7 +400,7 @@ class Font extends Supervisor * * @param bool $pValue * - * @return Font + * @return $this */ public function setSubscript($pValue) { @@ -439,7 +439,7 @@ class Font extends Supervisor * If a boolean is passed, then TRUE equates to UNDERLINE_SINGLE, * false equates to UNDERLINE_NONE * - * @return Font + * @return $this */ public function setUnderline($pValue) { @@ -477,7 +477,7 @@ class Font extends Supervisor * * @param bool $pValue * - * @return Font + * @return $this */ public function setStrikethrough($pValue) { @@ -512,7 +512,7 @@ class Font extends Supervisor * * @throws PhpSpreadsheetException * - * @return Font + * @return $this */ public function setColor(Color $pValue) { diff --git a/src/PhpSpreadsheet/Style/NumberFormat.php b/src/PhpSpreadsheet/Style/NumberFormat.php index 5ea30b88..df4ca76f 100644 --- a/src/PhpSpreadsheet/Style/NumberFormat.php +++ b/src/PhpSpreadsheet/Style/NumberFormat.php @@ -139,7 +139,7 @@ class NumberFormat extends Supervisor * * @throws PhpSpreadsheetException * - * @return NumberFormat + * @return $this */ public function applyFromArray(array $pStyles) { @@ -176,7 +176,7 @@ class NumberFormat extends Supervisor * * @param string $pValue see self::FORMAT_* * - * @return NumberFormat + * @return $this */ public function setFormatCode($pValue) { @@ -213,7 +213,7 @@ class NumberFormat extends Supervisor * * @param int $pValue * - * @return NumberFormat + * @return $this */ public function setBuiltInFormatCode($pValue) { diff --git a/src/PhpSpreadsheet/Style/Protection.php b/src/PhpSpreadsheet/Style/Protection.php index b5feb534..8112bc62 100644 --- a/src/PhpSpreadsheet/Style/Protection.php +++ b/src/PhpSpreadsheet/Style/Protection.php @@ -86,7 +86,7 @@ class Protection extends Supervisor * * @throws PhpSpreadsheetException * - * @return Protection + * @return $this */ public function applyFromArray(array $pStyles) { @@ -123,7 +123,7 @@ class Protection extends Supervisor * * @param string $pValue see self::PROTECTION_* * - * @return Protection + * @return $this */ public function setLocked($pValue) { @@ -156,7 +156,7 @@ class Protection extends Supervisor * * @param string $pValue see self::PROTECTION_* * - * @return Protection + * @return $this */ public function setHidden($pValue) { diff --git a/src/PhpSpreadsheet/Style/Style.php b/src/PhpSpreadsheet/Style/Style.php index 9cdfc1b1..a37d99b5 100644 --- a/src/PhpSpreadsheet/Style/Style.php +++ b/src/PhpSpreadsheet/Style/Style.php @@ -189,7 +189,7 @@ class Style extends Supervisor * @param array $pStyles Array containing style information * @param bool $pAdvanced advanced mode for setting borders * - * @return Style + * @return $this */ public function applyFromArray(array $pStyles, $pAdvanced = true) { @@ -485,7 +485,7 @@ class Style extends Supervisor * * @param Font $font * - * @return Style + * @return $this */ public function setFont(Font $font) { @@ -539,7 +539,7 @@ class Style extends Supervisor * * @param Conditional[] $pValue Array of conditional styles * - * @return Style + * @return $this */ public function setConditionalStyles(array $pValue) { @@ -577,7 +577,7 @@ class Style extends Supervisor * * @param bool $pValue * - * @return Style + * @return $this */ public function setQuotePrefix($pValue) { diff --git a/src/PhpSpreadsheet/Style/Supervisor.php b/src/PhpSpreadsheet/Style/Supervisor.php index 2d1a2726..1a700974 100644 --- a/src/PhpSpreadsheet/Style/Supervisor.php +++ b/src/PhpSpreadsheet/Style/Supervisor.php @@ -48,7 +48,7 @@ abstract class Supervisor implements IComparable * @param Spreadsheet|Style $parent * @param null|string $parentPropertyName * - * @return Supervisor + * @return $this */ public function bindParent($parent, $parentPropertyName = null) { diff --git a/src/PhpSpreadsheet/Worksheet/AutoFilter.php b/src/PhpSpreadsheet/Worksheet/AutoFilter.php index b4449254..dcbc4da5 100644 --- a/src/PhpSpreadsheet/Worksheet/AutoFilter.php +++ b/src/PhpSpreadsheet/Worksheet/AutoFilter.php @@ -59,7 +59,7 @@ class AutoFilter * * @param Worksheet $pSheet * - * @return AutoFilter + * @return $this */ public function setParent(Worksheet $pSheet = null) { @@ -85,7 +85,7 @@ class AutoFilter * * @throws PhpSpreadsheetException * - * @return AutoFilter + * @return $this */ public function setRange($pRange) { @@ -210,7 +210,7 @@ class AutoFilter * * @throws PhpSpreadsheetException * - * @return AutoFilter + * @return $this */ public function setColumn($pColumn) { @@ -241,7 +241,7 @@ class AutoFilter * * @throws PhpSpreadsheetException * - * @return AutoFilter + * @return $this */ public function clearColumn($pColumn) { @@ -264,7 +264,7 @@ class AutoFilter * @param string $fromColumn Column name (e.g. A) * @param string $toColumn Column name (e.g. B) * - * @return AutoFilter + * @return $this */ public function shiftColumn($fromColumn, $toColumn) { @@ -617,7 +617,7 @@ class AutoFilter * * @throws PhpSpreadsheetException * - * @return AutoFilter + * @return $this */ public function showHideRows() { diff --git a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php index 25ccffda..3ed7270a 100644 --- a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php +++ b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php @@ -117,7 +117,7 @@ class Column * * @throws PhpSpreadsheetException * - * @return Column + * @return $this */ public function setColumnIndex($pColumn) { @@ -147,7 +147,7 @@ class Column * * @param AutoFilter $pParent * - * @return Column + * @return $this */ public function setParent(AutoFilter $pParent = null) { @@ -173,7 +173,7 @@ class Column * * @throws PhpSpreadsheetException * - * @return Column + * @return $this */ public function setFilterType($pFilterType) { @@ -203,7 +203,7 @@ class Column * * @throws PhpSpreadsheetException * - * @return Column + * @return $this */ public function setJoin($pJoin) { @@ -223,7 +223,7 @@ class Column * * @param string[] $attributes * - * @return Column + * @return $this */ public function setAttributes(array $attributes) { @@ -238,7 +238,7 @@ class Column * @param string $pName Attribute Name * @param string $pValue Attribute Value * - * @return Column + * @return $this */ public function setAttribute($pName, $pValue) { @@ -316,7 +316,7 @@ class Column * * @param Column\Rule $pRule * - * @return Column + * @return $this */ public function addRule(Column\Rule $pRule) { @@ -332,7 +332,7 @@ class Column * * @param int $pIndex Rule index in the ruleset array * - * @return Column + * @return $this */ public function deleteRule($pIndex) { @@ -350,7 +350,7 @@ class Column /** * Delete all AutoFilter Column Rules. * - * @return Column + * @return $this */ public function clearRules() { diff --git a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php index 450bccdb..09a2bacd 100644 --- a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php +++ b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php @@ -262,7 +262,7 @@ class Rule * * @throws PhpSpreadsheetException * - * @return Rule + * @return $this */ public function setRuleType($pRuleType) { @@ -292,7 +292,7 @@ class Rule * * @throws PhpSpreadsheetException * - * @return Rule + * @return $this */ public function setValue($pValue) { @@ -336,7 +336,7 @@ class Rule * * @throws PhpSpreadsheetException * - * @return Rule + * @return $this */ public function setOperator($pOperator) { @@ -369,7 +369,7 @@ class Rule * * @throws PhpSpreadsheetException * - * @return Rule + * @return $this */ public function setGrouping($pGrouping) { @@ -393,7 +393,7 @@ class Rule * * @throws PhpSpreadsheetException * - * @return Rule + * @return $this */ public function setRule($pOperator, $pValue, $pGrouping = null) { @@ -424,7 +424,7 @@ class Rule * * @param Column $pParent * - * @return Rule + * @return $this */ public function setParent(Column $pParent = null) { diff --git a/src/PhpSpreadsheet/Worksheet/BaseDrawing.php b/src/PhpSpreadsheet/Worksheet/BaseDrawing.php index 98b68972..7d24e449 100644 --- a/src/PhpSpreadsheet/Worksheet/BaseDrawing.php +++ b/src/PhpSpreadsheet/Worksheet/BaseDrawing.php @@ -154,7 +154,7 @@ class BaseDrawing implements IComparable * * @param string $pValue * - * @return BaseDrawing + * @return $this */ public function setName($pValue) { @@ -178,7 +178,7 @@ class BaseDrawing implements IComparable * * @param string $description * - * @return BaseDrawing + * @return $this */ public function setDescription($description) { @@ -205,7 +205,7 @@ class BaseDrawing implements IComparable * * @throws PhpSpreadsheetException * - * @return BaseDrawing + * @return $this */ public function setWorksheet(Worksheet $pValue = null, $pOverrideOld = false) { @@ -253,7 +253,7 @@ class BaseDrawing implements IComparable * * @param string $pValue eg: 'A1' * - * @return BaseDrawing + * @return $this */ public function setCoordinates($pValue) { @@ -277,7 +277,7 @@ class BaseDrawing implements IComparable * * @param int $pValue * - * @return BaseDrawing + * @return $this */ public function setOffsetX($pValue) { @@ -301,7 +301,7 @@ class BaseDrawing implements IComparable * * @param int $pValue * - * @return BaseDrawing + * @return $this */ public function setOffsetY($pValue) { @@ -325,7 +325,7 @@ class BaseDrawing implements IComparable * * @param int $pValue * - * @return BaseDrawing + * @return $this */ public function setWidth($pValue) { @@ -356,7 +356,7 @@ class BaseDrawing implements IComparable * * @param int $pValue * - * @return BaseDrawing + * @return $this */ public function setHeight($pValue) { @@ -386,7 +386,7 @@ class BaseDrawing implements IComparable * @param int $width * @param int $height * - * @return BaseDrawing + * @return $this */ public function setWidthAndHeight($width, $height) { @@ -423,7 +423,7 @@ class BaseDrawing implements IComparable * * @param bool $pValue * - * @return BaseDrawing + * @return $this */ public function setResizeProportional($pValue) { @@ -447,7 +447,7 @@ class BaseDrawing implements IComparable * * @param int $pValue * - * @return BaseDrawing + * @return $this */ public function setRotation($pValue) { @@ -471,7 +471,7 @@ class BaseDrawing implements IComparable * * @param Drawing\Shadow $pValue * - * @return BaseDrawing + * @return $this */ public function setShadow(Drawing\Shadow $pValue = null) { diff --git a/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php b/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php index 7e8f040d..d75da898 100644 --- a/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php +++ b/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php @@ -59,7 +59,7 @@ class ColumnCellIterator extends CellIterator * * @throws PhpSpreadsheetException * - * @return ColumnCellIterator + * @return $this */ public function resetStart($startRow = 1) { @@ -77,7 +77,7 @@ class ColumnCellIterator extends CellIterator * * @throws PhpSpreadsheetException * - * @return ColumnCellIterator + * @return $this */ public function resetEnd($endRow = null) { @@ -94,7 +94,7 @@ class ColumnCellIterator extends CellIterator * * @throws PhpSpreadsheetException * - * @return ColumnCellIterator + * @return $this */ public function seek($row = 1) { diff --git a/src/PhpSpreadsheet/Worksheet/ColumnDimension.php b/src/PhpSpreadsheet/Worksheet/ColumnDimension.php index e9586a60..4e87a344 100644 --- a/src/PhpSpreadsheet/Worksheet/ColumnDimension.php +++ b/src/PhpSpreadsheet/Worksheet/ColumnDimension.php @@ -56,7 +56,7 @@ class ColumnDimension extends Dimension * * @param string $pValue * - * @return ColumnDimension + * @return $this */ public function setColumnIndex($pValue) { @@ -80,7 +80,7 @@ class ColumnDimension extends Dimension * * @param float $pValue * - * @return ColumnDimension + * @return $this */ public function setWidth($pValue) { @@ -104,7 +104,7 @@ class ColumnDimension extends Dimension * * @param bool $pValue * - * @return ColumnDimension + * @return $this */ public function setAutoSize($pValue) { diff --git a/src/PhpSpreadsheet/Worksheet/ColumnIterator.php b/src/PhpSpreadsheet/Worksheet/ColumnIterator.php index d2b57aad..c8913cc1 100644 --- a/src/PhpSpreadsheet/Worksheet/ColumnIterator.php +++ b/src/PhpSpreadsheet/Worksheet/ColumnIterator.php @@ -66,7 +66,7 @@ class ColumnIterator implements \Iterator * * @throws Exception * - * @return ColumnIterator + * @return $this */ public function resetStart($startColumn = 'A') { @@ -89,7 +89,7 @@ class ColumnIterator implements \Iterator * * @param string $endColumn The column address at which to stop iterating * - * @return ColumnIterator + * @return $this */ public function resetEnd($endColumn = null) { @@ -106,7 +106,7 @@ class ColumnIterator implements \Iterator * * @throws PhpSpreadsheetException * - * @return ColumnIterator + * @return $this */ public function seek($column = 'A') { diff --git a/src/PhpSpreadsheet/Worksheet/Dimension.php b/src/PhpSpreadsheet/Worksheet/Dimension.php index 697fc97e..ce40cf57 100644 --- a/src/PhpSpreadsheet/Worksheet/Dimension.php +++ b/src/PhpSpreadsheet/Worksheet/Dimension.php @@ -60,7 +60,7 @@ abstract class Dimension * * @param bool $pValue * - * @return Dimension + * @return $this */ public function setVisible($pValue) { @@ -87,7 +87,7 @@ abstract class Dimension * * @throws PhpSpreadsheetException * - * @return Dimension + * @return $this */ public function setOutlineLevel($pValue) { @@ -115,7 +115,7 @@ abstract class Dimension * * @param bool $pValue * - * @return Dimension + * @return $this */ public function setCollapsed($pValue) { @@ -139,7 +139,7 @@ abstract class Dimension * * @param int $pValue * - * @return Dimension + * @return $this */ public function setXfIndex($pValue) { diff --git a/src/PhpSpreadsheet/Worksheet/Drawing.php b/src/PhpSpreadsheet/Worksheet/Drawing.php index 8194da31..da492b4c 100644 --- a/src/PhpSpreadsheet/Worksheet/Drawing.php +++ b/src/PhpSpreadsheet/Worksheet/Drawing.php @@ -78,7 +78,7 @@ class Drawing extends BaseDrawing * * @throws PhpSpreadsheetException * - * @return Drawing + * @return $this */ public function setPath($pValue, $pVerifyFile = true) { diff --git a/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php b/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php index a1e05d60..c7594dae 100644 --- a/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php +++ b/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php @@ -100,7 +100,7 @@ class Shadow implements IComparable * * @param bool $pValue * - * @return Shadow + * @return $this */ public function setVisible($pValue) { @@ -124,7 +124,7 @@ class Shadow implements IComparable * * @param int $pValue * - * @return Shadow + * @return $this */ public function setBlurRadius($pValue) { @@ -148,7 +148,7 @@ class Shadow implements IComparable * * @param int $pValue * - * @return Shadow + * @return $this */ public function setDistance($pValue) { @@ -172,7 +172,7 @@ class Shadow implements IComparable * * @param int $pValue * - * @return Shadow + * @return $this */ public function setDirection($pValue) { @@ -196,7 +196,7 @@ class Shadow implements IComparable * * @param int $pValue * - * @return Shadow + * @return $this */ public function setAlignment($pValue) { @@ -220,7 +220,7 @@ class Shadow implements IComparable * * @param Color $pValue * - * @return Shadow + * @return $this */ public function setColor(Color $pValue = null) { @@ -244,7 +244,7 @@ class Shadow implements IComparable * * @param int $pValue * - * @return Shadow + * @return $this */ public function setAlpha($pValue) { diff --git a/src/PhpSpreadsheet/Worksheet/HeaderFooter.php b/src/PhpSpreadsheet/Worksheet/HeaderFooter.php index a78f4fcc..be19abbd 100644 --- a/src/PhpSpreadsheet/Worksheet/HeaderFooter.php +++ b/src/PhpSpreadsheet/Worksheet/HeaderFooter.php @@ -172,7 +172,7 @@ class HeaderFooter * * @param string $pValue * - * @return HeaderFooter + * @return $this */ public function setOddHeader($pValue) { @@ -196,7 +196,7 @@ class HeaderFooter * * @param string $pValue * - * @return HeaderFooter + * @return $this */ public function setOddFooter($pValue) { @@ -220,7 +220,7 @@ class HeaderFooter * * @param string $pValue * - * @return HeaderFooter + * @return $this */ public function setEvenHeader($pValue) { @@ -244,7 +244,7 @@ class HeaderFooter * * @param string $pValue * - * @return HeaderFooter + * @return $this */ public function setEvenFooter($pValue) { @@ -268,7 +268,7 @@ class HeaderFooter * * @param string $pValue * - * @return HeaderFooter + * @return $this */ public function setFirstHeader($pValue) { @@ -292,7 +292,7 @@ class HeaderFooter * * @param string $pValue * - * @return HeaderFooter + * @return $this */ public function setFirstFooter($pValue) { @@ -316,7 +316,7 @@ class HeaderFooter * * @param bool $pValue * - * @return HeaderFooter + * @return $this */ public function setDifferentOddEven($pValue) { @@ -340,7 +340,7 @@ class HeaderFooter * * @param bool $pValue * - * @return HeaderFooter + * @return $this */ public function setDifferentFirst($pValue) { @@ -364,7 +364,7 @@ class HeaderFooter * * @param bool $pValue * - * @return HeaderFooter + * @return $this */ public function setScaleWithDocument($pValue) { @@ -388,7 +388,7 @@ class HeaderFooter * * @param bool $pValue * - * @return HeaderFooter + * @return $this */ public function setAlignWithMargins($pValue) { @@ -403,7 +403,7 @@ class HeaderFooter * @param HeaderFooterDrawing $image * @param string $location * - * @return HeaderFooter + * @return $this */ public function addImage(HeaderFooterDrawing $image, $location = self::IMAGE_HEADER_LEFT) { @@ -417,7 +417,7 @@ class HeaderFooter * * @param string $location * - * @return HeaderFooter + * @return $this */ public function removeImage($location = self::IMAGE_HEADER_LEFT) { @@ -433,7 +433,7 @@ class HeaderFooter * * @param HeaderFooterDrawing[] $images * - * @return HeaderFooter + * @return $this */ public function setImages(array $images) { diff --git a/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php b/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php index 6012e93e..f0935585 100644 --- a/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php +++ b/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php @@ -74,7 +74,7 @@ class MemoryDrawing extends BaseDrawing * * @param resource $value * - * @return MemoryDrawing + * @return $this */ public function setImageResource($value) { @@ -104,7 +104,7 @@ class MemoryDrawing extends BaseDrawing * * @param string $value see self::RENDERING_* * - * @return MemoryDrawing + * @return $this */ public function setRenderingFunction($value) { @@ -128,7 +128,7 @@ class MemoryDrawing extends BaseDrawing * * @param string $value see self::MIMETYPE_* * - * @return MemoryDrawing + * @return $this */ public function setMimeType($value) { diff --git a/src/PhpSpreadsheet/Worksheet/PageMargins.php b/src/PhpSpreadsheet/Worksheet/PageMargins.php index eb44a109..9ebfb648 100644 --- a/src/PhpSpreadsheet/Worksheet/PageMargins.php +++ b/src/PhpSpreadsheet/Worksheet/PageMargins.php @@ -68,7 +68,7 @@ class PageMargins * * @param float $pValue * - * @return PageMargins + * @return $this */ public function setLeft($pValue) { @@ -92,7 +92,7 @@ class PageMargins * * @param float $pValue * - * @return PageMargins + * @return $this */ public function setRight($pValue) { @@ -116,7 +116,7 @@ class PageMargins * * @param float $pValue * - * @return PageMargins + * @return $this */ public function setTop($pValue) { @@ -140,7 +140,7 @@ class PageMargins * * @param float $pValue * - * @return PageMargins + * @return $this */ public function setBottom($pValue) { @@ -164,7 +164,7 @@ class PageMargins * * @param float $pValue * - * @return PageMargins + * @return $this */ public function setHeader($pValue) { @@ -188,7 +188,7 @@ class PageMargins * * @param float $pValue * - * @return PageMargins + * @return $this */ public function setFooter($pValue) { diff --git a/src/PhpSpreadsheet/Worksheet/PageSetup.php b/src/PhpSpreadsheet/Worksheet/PageSetup.php index ab007f61..fa1810f3 100644 --- a/src/PhpSpreadsheet/Worksheet/PageSetup.php +++ b/src/PhpSpreadsheet/Worksheet/PageSetup.php @@ -272,7 +272,7 @@ class PageSetup * * @param int $pValue see self::PAPERSIZE_* * - * @return PageSetup + * @return $this */ public function setPaperSize($pValue) { @@ -296,7 +296,7 @@ class PageSetup * * @param string $pValue see self::ORIENTATION_* * - * @return PageSetup + * @return $this */ public function setOrientation($pValue) { @@ -325,7 +325,7 @@ class PageSetup * * @throws PhpSpreadsheetException * - * @return PageSetup + * @return $this */ public function setScale($pValue, $pUpdate = true) { @@ -358,7 +358,7 @@ class PageSetup * * @param bool $pValue * - * @return PageSetup + * @return $this */ public function setFitToPage($pValue) { @@ -383,7 +383,7 @@ class PageSetup * @param null|int $pValue * @param bool $pUpdate Update fitToPage so it applies rather than scaling * - * @return PageSetup + * @return $this */ public function setFitToHeight($pValue, $pUpdate = true) { @@ -411,7 +411,7 @@ class PageSetup * @param null|int $pValue * @param bool $pUpdate Update fitToPage so it applies rather than scaling * - * @return PageSetup + * @return $this */ public function setFitToWidth($pValue, $pUpdate = true) { @@ -454,7 +454,7 @@ class PageSetup * * @param array $pValue Containing start column and end column, empty array if option unset * - * @return PageSetup + * @return $this */ public function setColumnsToRepeatAtLeft(array $pValue) { @@ -469,7 +469,7 @@ class PageSetup * @param string $pStart eg: 'A' * @param string $pEnd eg: 'B' * - * @return PageSetup + * @return $this */ public function setColumnsToRepeatAtLeftByStartAndEnd($pStart, $pEnd) { @@ -509,7 +509,7 @@ class PageSetup * * @param array $pValue Containing start column and end column, empty array if option unset * - * @return PageSetup + * @return $this */ public function setRowsToRepeatAtTop(array $pValue) { @@ -524,7 +524,7 @@ class PageSetup * @param int $pStart eg: 1 * @param int $pEnd eg: 1 * - * @return PageSetup + * @return $this */ public function setRowsToRepeatAtTopByStartAndEnd($pStart, $pEnd) { @@ -548,7 +548,7 @@ class PageSetup * * @param bool $value * - * @return PageSetup + * @return $this */ public function setHorizontalCentered($value) { @@ -572,7 +572,7 @@ class PageSetup * * @param bool $value * - * @return PageSetup + * @return $this */ public function setVerticalCentered($value) { @@ -634,7 +634,7 @@ class PageSetup * Otherwise, the range identified by the value of $index will be removed from the series * Print areas are numbered from 1 * - * @return PageSetup + * @return $this */ public function clearPrintArea($index = 0) { @@ -671,7 +671,7 @@ class PageSetup * * @throws PhpSpreadsheetException * - * @return PageSetup + * @return $this */ public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE) { @@ -732,7 +732,7 @@ class PageSetup * * @throws PhpSpreadsheetException * - * @return PageSetup + * @return $this */ public function addPrintArea($value, $index = -1) { @@ -762,7 +762,7 @@ class PageSetup * * @throws PhpSpreadsheetException * - * @return PageSetup + * @return $this */ public function setPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE) { @@ -789,7 +789,7 @@ class PageSetup * * @throws PhpSpreadsheetException * - * @return PageSetup + * @return $this */ public function addPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = -1) { @@ -815,7 +815,7 @@ class PageSetup * * @param int $value * - * @return PageSetup + * @return $this */ public function setFirstPageNumber($value) { @@ -827,7 +827,7 @@ class PageSetup /** * Reset first page number. * - * @return PageSetup + * @return $this */ public function resetFirstPageNumber() { diff --git a/src/PhpSpreadsheet/Worksheet/Protection.php b/src/PhpSpreadsheet/Worksheet/Protection.php index 1815f45b..2fd3e919 100644 --- a/src/PhpSpreadsheet/Worksheet/Protection.php +++ b/src/PhpSpreadsheet/Worksheet/Protection.php @@ -172,7 +172,7 @@ class Protection * * @param bool $pValue * - * @return Protection + * @return $this */ public function setSheet($pValue) { @@ -196,7 +196,7 @@ class Protection * * @param bool $pValue * - * @return Protection + * @return $this */ public function setObjects($pValue) { @@ -220,7 +220,7 @@ class Protection * * @param bool $pValue * - * @return Protection + * @return $this */ public function setScenarios($pValue) { @@ -244,7 +244,7 @@ class Protection * * @param bool $pValue * - * @return Protection + * @return $this */ public function setFormatCells($pValue) { @@ -268,7 +268,7 @@ class Protection * * @param bool $pValue * - * @return Protection + * @return $this */ public function setFormatColumns($pValue) { @@ -292,7 +292,7 @@ class Protection * * @param bool $pValue * - * @return Protection + * @return $this */ public function setFormatRows($pValue) { @@ -316,7 +316,7 @@ class Protection * * @param bool $pValue * - * @return Protection + * @return $this */ public function setInsertColumns($pValue) { @@ -340,7 +340,7 @@ class Protection * * @param bool $pValue * - * @return Protection + * @return $this */ public function setInsertRows($pValue) { @@ -364,7 +364,7 @@ class Protection * * @param bool $pValue * - * @return Protection + * @return $this */ public function setInsertHyperlinks($pValue) { @@ -388,7 +388,7 @@ class Protection * * @param bool $pValue * - * @return Protection + * @return $this */ public function setDeleteColumns($pValue) { @@ -412,7 +412,7 @@ class Protection * * @param bool $pValue * - * @return Protection + * @return $this */ public function setDeleteRows($pValue) { @@ -436,7 +436,7 @@ class Protection * * @param bool $pValue * - * @return Protection + * @return $this */ public function setSelectLockedCells($pValue) { @@ -460,7 +460,7 @@ class Protection * * @param bool $pValue * - * @return Protection + * @return $this */ public function setSort($pValue) { @@ -484,7 +484,7 @@ class Protection * * @param bool $pValue * - * @return Protection + * @return $this */ public function setAutoFilter($pValue) { @@ -508,7 +508,7 @@ class Protection * * @param bool $pValue * - * @return Protection + * @return $this */ public function setPivotTables($pValue) { @@ -532,7 +532,7 @@ class Protection * * @param bool $pValue * - * @return Protection + * @return $this */ public function setSelectUnlockedCells($pValue) { @@ -557,7 +557,7 @@ class Protection * @param string $pValue * @param bool $pAlreadyHashed If the password has already been hashed, set this to true * - * @return Protection + * @return $this */ public function setPassword($pValue, $pAlreadyHashed = false) { diff --git a/src/PhpSpreadsheet/Worksheet/RowCellIterator.php b/src/PhpSpreadsheet/Worksheet/RowCellIterator.php index 8510d402..9746d640 100644 --- a/src/PhpSpreadsheet/Worksheet/RowCellIterator.php +++ b/src/PhpSpreadsheet/Worksheet/RowCellIterator.php @@ -59,7 +59,7 @@ class RowCellIterator extends CellIterator * * @throws PhpSpreadsheetException * - * @return RowCellIterator + * @return $this */ public function resetStart($startColumn = 'A') { @@ -77,7 +77,7 @@ class RowCellIterator extends CellIterator * * @throws PhpSpreadsheetException * - * @return RowCellIterator + * @return $this */ public function resetEnd($endColumn = null) { @@ -95,7 +95,7 @@ class RowCellIterator extends CellIterator * * @throws PhpSpreadsheetException * - * @return RowCellIterator + * @return $this */ public function seek($column = 'A') { diff --git a/src/PhpSpreadsheet/Worksheet/RowDimension.php b/src/PhpSpreadsheet/Worksheet/RowDimension.php index e4346404..c4a87bdb 100644 --- a/src/PhpSpreadsheet/Worksheet/RowDimension.php +++ b/src/PhpSpreadsheet/Worksheet/RowDimension.php @@ -56,7 +56,7 @@ class RowDimension extends Dimension * * @param int $pValue * - * @return RowDimension + * @return $this */ public function setRowIndex($pValue) { @@ -80,7 +80,7 @@ class RowDimension extends Dimension * * @param float $pValue * - * @return RowDimension + * @return $this */ public function setRowHeight($pValue) { @@ -104,7 +104,7 @@ class RowDimension extends Dimension * * @param bool $pValue * - * @return RowDimension + * @return $this */ public function setZeroHeight($pValue) { diff --git a/src/PhpSpreadsheet/Worksheet/RowIterator.php b/src/PhpSpreadsheet/Worksheet/RowIterator.php index 433cea6a..3b9d0e26 100644 --- a/src/PhpSpreadsheet/Worksheet/RowIterator.php +++ b/src/PhpSpreadsheet/Worksheet/RowIterator.php @@ -64,7 +64,7 @@ class RowIterator implements \Iterator * * @throws PhpSpreadsheetException * - * @return RowIterator + * @return $this */ public function resetStart($startRow = 1) { @@ -86,7 +86,7 @@ class RowIterator implements \Iterator * * @param int $endRow The row number at which to stop iterating * - * @return RowIterator + * @return $this */ public function resetEnd($endRow = null) { @@ -102,7 +102,7 @@ class RowIterator implements \Iterator * * @throws PhpSpreadsheetException * - * @return RowIterator + * @return $this */ public function seek($row = 1) { diff --git a/src/PhpSpreadsheet/Worksheet/SheetView.php b/src/PhpSpreadsheet/Worksheet/SheetView.php index 0a95f213..fa85bd27 100644 --- a/src/PhpSpreadsheet/Worksheet/SheetView.php +++ b/src/PhpSpreadsheet/Worksheet/SheetView.php @@ -79,7 +79,7 @@ class SheetView * * @throws PhpSpreadsheetException * - * @return SheetView + * @return $this */ public function setZoomScale($pValue) { @@ -112,7 +112,7 @@ class SheetView * * @throws PhpSpreadsheetException * - * @return SheetView + * @return $this */ public function setZoomScaleNormal($pValue) { @@ -165,7 +165,7 @@ class SheetView * * @throws PhpSpreadsheetException * - * @return SheetView + * @return $this */ public function setView($pValue) { diff --git a/src/PhpSpreadsheet/Worksheet/Worksheet.php b/src/PhpSpreadsheet/Worksheet/Worksheet.php index f01632bc..f3a5b4da 100644 --- a/src/PhpSpreadsheet/Worksheet/Worksheet.php +++ b/src/PhpSpreadsheet/Worksheet/Worksheet.php @@ -647,7 +647,7 @@ class Worksheet implements IComparable /** * Refresh column dimensions. * - * @return Worksheet + * @return $this */ public function refreshColumnDimensions() { @@ -666,7 +666,7 @@ class Worksheet implements IComparable /** * Refresh row dimensions. * - * @return Worksheet + * @return $this */ public function refreshRowDimensions() { @@ -707,7 +707,7 @@ class Worksheet implements IComparable /** * Calculate widths for auto-size columns. * - * @return Worksheet; + * @return $this */ public function calculateColumnWidths() { @@ -797,7 +797,7 @@ class Worksheet implements IComparable * * @param Spreadsheet $parent * - * @return Worksheet + * @return $this */ public function rebindParent(Spreadsheet $parent) { @@ -838,7 +838,7 @@ class Worksheet implements IComparable * @param bool $validate False to skip validation of new title. WARNING: This should only be set * at parse time (by Readers), where titles can be assumed to be valid. * - * @return Worksheet + * @return $this */ public function setTitle($pValue, $updateFormulaCellReferences = true, $validate = true) { @@ -913,7 +913,7 @@ class Worksheet implements IComparable * * @param string $value Sheet state (visible, hidden, veryHidden) * - * @return Worksheet + * @return $this */ public function setSheetState($value) { @@ -937,7 +937,7 @@ class Worksheet implements IComparable * * @param PageSetup $pValue * - * @return Worksheet + * @return $this */ public function setPageSetup(PageSetup $pValue) { @@ -961,7 +961,7 @@ class Worksheet implements IComparable * * @param PageMargins $pValue * - * @return Worksheet + * @return $this */ public function setPageMargins(PageMargins $pValue) { @@ -985,7 +985,7 @@ class Worksheet implements IComparable * * @param HeaderFooter $pValue * - * @return Worksheet + * @return $this */ public function setHeaderFooter(HeaderFooter $pValue) { @@ -1009,7 +1009,7 @@ class Worksheet implements IComparable * * @param SheetView $pValue * - * @return Worksheet + * @return $this */ public function setSheetView(SheetView $pValue) { @@ -1033,7 +1033,7 @@ class Worksheet implements IComparable * * @param Protection $pValue * - * @return Worksheet + * @return $this */ public function setProtection(Protection $pValue) { @@ -1119,7 +1119,7 @@ class Worksheet implements IComparable * @param string $pCoordinate Coordinate of the cell, eg: 'A1' * @param mixed $pValue Value of the cell * - * @return Worksheet + * @return $this */ public function setCellValue($pCoordinate, $pValue) { @@ -1135,7 +1135,7 @@ class Worksheet implements IComparable * @param int $row Numeric row coordinate of the cell * @param mixed $value Value of the cell * - * @return Worksheet + * @return $this */ public function setCellValueByColumnAndRow($columnIndex, $row, $value) { @@ -1151,7 +1151,7 @@ class Worksheet implements IComparable * @param mixed $pValue Value of the cell * @param string $pDataType Explicit data type, see DataType::TYPE_* * - * @return Worksheet + * @return $this */ public function setCellValueExplicit($pCoordinate, $pValue, $pDataType) { @@ -1169,7 +1169,7 @@ class Worksheet implements IComparable * @param mixed $value Value of the cell * @param string $dataType Explicit data type, see DataType::TYPE_* * - * @return Worksheet + * @return $this */ public function setCellValueExplicitByColumnAndRow($columnIndex, $row, $value, $dataType) { @@ -1480,7 +1480,7 @@ class Worksheet implements IComparable * * @param string $pCoordinate eg: 'A1' * - * @return Worksheet + * @return $this */ public function removeConditionalStyles($pCoordinate) { @@ -1505,7 +1505,7 @@ class Worksheet implements IComparable * @param string $pCoordinate eg: 'A1' * @param $pValue Conditional[] * - * @return Worksheet + * @return $this */ public function setConditionalStyles($pCoordinate, $pValue) { @@ -1545,7 +1545,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function duplicateStyle(Style $pCellStyle, $pRange) { @@ -1590,7 +1590,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function duplicateConditionalStyle(array $pCellStyle, $pRange = '') { @@ -1628,7 +1628,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function setBreak($pCoordinate, $pBreak) { @@ -1657,7 +1657,7 @@ class Worksheet implements IComparable * @param int $row Numeric row coordinate of the cell * @param int $break Break type (type of Worksheet::BREAK_*) * - * @return Worksheet + * @return $this */ public function setBreakByColumnAndRow($columnIndex, $row, $break) { @@ -1681,7 +1681,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function mergeCells($pRange) { @@ -1726,7 +1726,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function mergeCellsByColumnAndRow($columnIndex1, $row1, $columnIndex2, $row2) { @@ -1742,7 +1742,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function unmergeCells($pRange) { @@ -1772,7 +1772,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function unmergeCellsByColumnAndRow($columnIndex1, $row1, $columnIndex2, $row2) { @@ -1797,7 +1797,7 @@ class Worksheet implements IComparable * * @param array $pValue * - * @return Worksheet + * @return $this */ public function setMergeCells(array $pValue) { @@ -1813,7 +1813,7 @@ class Worksheet implements IComparable * @param string $pPassword Password to unlock the protection * @param bool $pAlreadyHashed If the password has already been hashed, set this to true * - * @return Worksheet + * @return $this */ public function protectCells($pRange, $pPassword, $pAlreadyHashed = false) { @@ -1838,7 +1838,7 @@ class Worksheet implements IComparable * @param string $password Password to unlock the protection * @param bool $alreadyHashed If the password has already been hashed, set this to true * - * @return Worksheet + * @return $this */ public function protectCellsByColumnAndRow($columnIndex1, $row1, $columnIndex2, $row2, $password, $alreadyHashed = false) { @@ -1854,7 +1854,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function unprotectCells($pRange) { @@ -1880,7 +1880,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function unprotectCellsByColumnAndRow($columnIndex1, $row1, $columnIndex2, $row2) { @@ -1917,7 +1917,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function setAutoFilter($pValue) { @@ -1940,7 +1940,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function setAutoFilterByColumnAndRow($columnIndex1, $row1, $columnIndex2, $row2) { @@ -1954,7 +1954,7 @@ class Worksheet implements IComparable /** * Remove autofilter. * - * @return Worksheet + * @return $this */ public function removeAutoFilter() { @@ -1987,7 +1987,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function freezePane($cell, $topLeftCell = null) { @@ -2012,7 +2012,7 @@ class Worksheet implements IComparable * @param int $columnIndex Numeric column coordinate of the cell * @param int $row Numeric row coordinate of the cell * - * @return Worksheet + * @return $this */ public function freezePaneByColumnAndRow($columnIndex, $row) { @@ -2022,7 +2022,7 @@ class Worksheet implements IComparable /** * Unfreeze Pane. * - * @return Worksheet + * @return $this */ public function unfreezePane() { @@ -2047,7 +2047,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function insertNewRowBefore($pBefore, $pNumRows = 1) { @@ -2069,7 +2069,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function insertNewColumnBefore($pBefore, $pNumCols = 1) { @@ -2091,7 +2091,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function insertNewColumnBeforeByIndex($beforeColumnIndex, $pNumCols = 1) { @@ -2110,7 +2110,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function removeRow($pRow, $pNumRows = 1) { @@ -2141,7 +2141,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function removeColumn($pColumn, $pNumCols = 1) { @@ -2181,7 +2181,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function removeColumnByIndex($columnIndex, $numColumns = 1) { @@ -2207,7 +2207,7 @@ class Worksheet implements IComparable * * @param bool $pValue Show gridlines (true/false) * - * @return Worksheet + * @return $this */ public function setShowGridlines($pValue) { @@ -2231,7 +2231,7 @@ class Worksheet implements IComparable * * @param bool $pValue Print gridlines (true/false) * - * @return Worksheet + * @return $this */ public function setPrintGridlines($pValue) { @@ -2255,7 +2255,7 @@ class Worksheet implements IComparable * * @param bool $pValue Show row and column headers (true/false) * - * @return Worksheet + * @return $this */ public function setShowRowColHeaders($pValue) { @@ -2279,7 +2279,7 @@ class Worksheet implements IComparable * * @param bool $pValue Show summary below (true/false) * - * @return Worksheet + * @return $this */ public function setShowSummaryBelow($pValue) { @@ -2303,7 +2303,7 @@ class Worksheet implements IComparable * * @param bool $pValue Show summary right (true/false) * - * @return Worksheet + * @return $this */ public function setShowSummaryRight($pValue) { @@ -2327,7 +2327,7 @@ class Worksheet implements IComparable * * @param Comment[] $pValue * - * @return Worksheet + * @return $this */ public function setComments(array $pValue) { @@ -2408,7 +2408,7 @@ class Worksheet implements IComparable * * @param string $pCoordinate Cell (i.e. A1) * - * @return Worksheet + * @return $this */ public function setSelectedCell($pCoordinate) { @@ -2420,7 +2420,7 @@ class Worksheet implements IComparable * * @param string $pCoordinate Cell range, examples: 'A1', 'B2:G5', 'A:C', '3:6' * - * @return Worksheet + * @return $this */ public function setSelectedCells($pCoordinate) { @@ -2458,7 +2458,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function setSelectedCellByColumnAndRow($columnIndex, $row) { @@ -2480,7 +2480,7 @@ class Worksheet implements IComparable * * @param bool $value Right-to-left true/false * - * @return Worksheet + * @return $this */ public function setRightToLeft($value) { @@ -2499,7 +2499,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function fromArray(array $source, $nullValue = null, $startCell = 'A1', $strictNullComparison = false) { @@ -2684,7 +2684,7 @@ class Worksheet implements IComparable /** * Run PhpSpreadsheet garbage collector. * - * @return Worksheet + * @return $this */ public function garbageCollect() { @@ -2784,7 +2784,7 @@ class Worksheet implements IComparable * @param string $pCellCoordinate Cell coordinate to insert hyperlink, eg: 'A1' * @param null|Hyperlink $pHyperlink * - * @return Worksheet + * @return $this */ public function setHyperlink($pCellCoordinate, Hyperlink $pHyperlink = null) { @@ -2845,7 +2845,7 @@ class Worksheet implements IComparable * @param string $pCellCoordinate Cell coordinate to insert data validation, eg: 'A1' * @param null|DataValidation $pDataValidation * - * @return Worksheet + * @return $this */ public function setDataValidation($pCellCoordinate, DataValidation $pDataValidation = null) { @@ -2933,7 +2933,7 @@ class Worksheet implements IComparable /** * Reset tab color. * - * @return Worksheet + * @return $this */ public function resetTabColor() { @@ -2956,7 +2956,7 @@ class Worksheet implements IComparable /** * Copy worksheet (!= clone!). * - * @return Worksheet + * @return static */ public function copy() { @@ -3007,7 +3007,7 @@ class Worksheet implements IComparable * * @throws Exception * - * @return Worksheet + * @return $this */ public function setCodeName($pValue, $validate = true) { diff --git a/src/PhpSpreadsheet/Writer/Csv.php b/src/PhpSpreadsheet/Writer/Csv.php index ae38ab73..1166bd25 100644 --- a/src/PhpSpreadsheet/Writer/Csv.php +++ b/src/PhpSpreadsheet/Writer/Csv.php @@ -147,7 +147,7 @@ class Csv extends BaseWriter * * @param string $pValue Delimiter, defaults to ',' * - * @return CSV + * @return $this */ public function setDelimiter($pValue) { @@ -171,7 +171,7 @@ class Csv extends BaseWriter * * @param string $pValue Enclosure, defaults to " * - * @return CSV + * @return $this */ public function setEnclosure($pValue) { @@ -198,7 +198,7 @@ class Csv extends BaseWriter * * @param string $pValue Line ending, defaults to OS line ending (PHP_EOL) * - * @return CSV + * @return $this */ public function setLineEnding($pValue) { @@ -222,7 +222,7 @@ class Csv extends BaseWriter * * @param bool $pValue Use UTF-8 byte-order mark? Defaults to false * - * @return CSV + * @return $this */ public function setUseBOM($pValue) { @@ -246,7 +246,7 @@ class Csv extends BaseWriter * * @param bool $pValue Use separator line? Defaults to false * - * @return CSV + * @return $this */ public function setIncludeSeparatorLine($pValue) { @@ -271,7 +271,7 @@ class Csv extends BaseWriter * @param bool $pValue Set the file to be written as a fully Excel compatible csv file * Note that this overrides other settings such as useBOM, enclosure and delimiter * - * @return CSV + * @return $this */ public function setExcelCompatibility($pValue) { @@ -295,7 +295,7 @@ class Csv extends BaseWriter * * @param int $pValue Sheet index * - * @return CSV + * @return $this */ public function setSheetIndex($pValue) { diff --git a/src/PhpSpreadsheet/Writer/Html.php b/src/PhpSpreadsheet/Writer/Html.php index 0f55f2f4..37d68e91 100644 --- a/src/PhpSpreadsheet/Writer/Html.php +++ b/src/PhpSpreadsheet/Writer/Html.php @@ -297,7 +297,7 @@ class Html extends BaseWriter * * @param int $pValue Sheet index * - * @return HTML + * @return $this */ public function setSheetIndex($pValue) { @@ -321,7 +321,7 @@ class Html extends BaseWriter * * @param bool $pValue Flag indicating whether the sheet navigation block should be generated or not * - * @return HTML + * @return $this */ public function setGenerateSheetNavigationBlock($pValue) { @@ -332,6 +332,8 @@ class Html extends BaseWriter /** * Write all sheets (resets sheetIndex to NULL). + * + * @return $this */ public function writeAllSheets() { @@ -1438,7 +1440,7 @@ class Html extends BaseWriter * * @param string $pValue * - * @return HTML + * @return $this */ public function setImagesRoot($pValue) { @@ -1462,7 +1464,7 @@ class Html extends BaseWriter * * @param bool $pValue * - * @return HTML + * @return $this */ public function setEmbedImages($pValue) { @@ -1486,7 +1488,7 @@ class Html extends BaseWriter * * @param bool $pValue * - * @return HTML + * @return $this */ public function setUseInlineCss($pValue) { @@ -1510,7 +1512,7 @@ class Html extends BaseWriter * * @param bool $pValue * - * @return HTML + * @return $this */ public function setUseEmbeddedCSS($pValue) { diff --git a/src/PhpSpreadsheet/Writer/Ods.php b/src/PhpSpreadsheet/Writer/Ods.php index 83fc2931..43659fa0 100644 --- a/src/PhpSpreadsheet/Writer/Ods.php +++ b/src/PhpSpreadsheet/Writer/Ods.php @@ -167,7 +167,7 @@ class Ods extends BaseWriter * * @param Spreadsheet $spreadsheet PhpSpreadsheet object * - * @return self + * @return $this */ public function setSpreadsheet(Spreadsheet $spreadsheet) { diff --git a/src/PhpSpreadsheet/Writer/Pdf.php b/src/PhpSpreadsheet/Writer/Pdf.php index b80083ae..d9184560 100644 --- a/src/PhpSpreadsheet/Writer/Pdf.php +++ b/src/PhpSpreadsheet/Writer/Pdf.php @@ -150,7 +150,7 @@ abstract class Pdf extends Html * * @param string $fontName * - * @return Pdf + * @return $this */ public function setFont($fontName) { diff --git a/src/PhpSpreadsheet/Writer/Xlsx.php b/src/PhpSpreadsheet/Writer/Xlsx.php index 58897639..1fa59e51 100644 --- a/src/PhpSpreadsheet/Writer/Xlsx.php +++ b/src/PhpSpreadsheet/Writer/Xlsx.php @@ -443,7 +443,7 @@ class Xlsx extends BaseWriter * * @param Spreadsheet $spreadsheet PhpSpreadsheet object * - * @return Xlsx + * @return $this */ public function setSpreadsheet(Spreadsheet $spreadsheet) { @@ -547,7 +547,7 @@ class Xlsx extends BaseWriter * * @param bool $pValue Office2003 compatibility? * - * @return Xlsx + * @return $this */ public function setOffice2003Compatibility($pValue) { From c2a205e82f9cf1cc9fab86b79e808d86dd680470 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Mon, 2 Mar 2020 20:09:03 +0700 Subject: [PATCH 15/38] 1.10.1 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64075749..bcbe3532 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com) and this project adheres to [Semantic Versioning](https://semver.org). -## [Unreleased] +## [1.11.0] - 2020-03-02 ### Added From 50d78ce7898ee3a540cefd9693085b3636e578e6 Mon Sep 17 00:00:00 2001 From: Marius Date: Thu, 30 Jan 2020 08:58:17 +0100 Subject: [PATCH 16/38] update doc on how to run the migrate tool as per this https://stackoverflow.com/questions/53215313/phpspreadsheet-how-do-i-use-auto-migration-tool clarify how to run the tool --- docs/topics/migration-from-PHPExcel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/topics/migration-from-PHPExcel.md b/docs/topics/migration-from-PHPExcel.md index b90db165..011b3770 100644 --- a/docs/topics/migration-from-PHPExcel.md +++ b/docs/topics/migration-from-PHPExcel.md @@ -14,7 +14,7 @@ installed with composer, it can be run like so: ``` sh cd /project/to/migrate/src -/project/to/migrate/vendor/phpoffice/phpspreadsheet/bin/migrate-from-phpexcel +php /project/to/migrate/vendor/phpoffice/phpspreadsheet/bin/migrate-from-phpexcel ``` **Important** The tool will irreversibly modify your sources, be sure to From a08415a7b5190fb90e6fc042a094ace2e17e4d32 Mon Sep 17 00:00:00 2001 From: Paul Kievits Date: Fri, 6 Mar 2020 10:34:51 +0100 Subject: [PATCH 17/38] Improved the ARABIC function to handle short-form roman numerals --- CHANGELOG.md | 4 ++ src/PhpSpreadsheet/Calculation/MathTrig.php | 66 ++++++++++++++------- tests/data/Calculation/MathTrig/ARABIC.php | 24 ++++++++ 3 files changed, 73 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcbe3532..16313206 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com) and this project adheres to [Semantic Versioning](https://semver.org). +## [Unreleased] + +- Improved the ARABIC function to also hande short-hand roman numerals + ## [1.11.0] - 2020-03-02 ### Added diff --git a/src/PhpSpreadsheet/Calculation/MathTrig.php b/src/PhpSpreadsheet/Calculation/MathTrig.php index 33bfee19..51f3b899 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig.php @@ -61,32 +61,15 @@ class MathTrig } // Convert the roman numeral to an arabic number - $lookup = [ - 'M' => 1000, 'CM' => 900, - 'D' => 500, 'CD' => 400, - 'C' => 100, 'XC' => 90, - 'L' => 50, 'XL' => 40, - 'X' => 10, 'IX' => 9, - 'V' => 5, 'IV' => 4, 'I' => 1, - ]; - $negativeNumber = $roman[0] === '-'; if ($negativeNumber) { $roman = substr($roman, 1); } - $arabic = 0; - for ($i = 0; $i < strlen($roman); ++$i) { - if (!isset($lookup[$roman[$i]])) { - return Functions::VALUE(); // Invalid character detected - } - - if ($i < (strlen($roman) - 1) && isset($lookup[substr($roman, $i, 2)])) { - $arabic += $lookup[substr($roman, $i, 2)]; // Detected a match on the next 2 characters - ++$i; - } else { - $arabic += $lookup[$roman[$i]]; // Detected a match on one character only - } + try { + $arabic = self::calculateArabic(str_split($roman)); + } catch (\Exception $e) { + return Functions::VALUE(); // Invalid character detected } if ($negativeNumber) { @@ -96,6 +79,47 @@ class MathTrig return $arabic; } + /** + * Recursively calculate the arabic value of a roman numeral. + * + * @param array $roman + * @param int $sum + * @param int $subtract + * + * @return int + */ + protected static function calculateArabic(array $roman, &$sum = 0, $subtract = 0) + { + $lookup = [ + 'M' => 1000, + 'D' => 500, + 'C' => 100, + 'L' => 50, + 'X' => 10, + 'V' => 5, + 'I' => 1, + ]; + + $numeral = array_shift($roman); + if (!isset($lookup[$numeral])) { + throw new \Exception('Invalid character detected'); + } + + $arabic = $lookup[$numeral]; + if (count($roman) > 0 && isset($lookup[$roman[0]]) && $arabic < $lookup[$roman[0]]) { + $subtract += $arabic; + } else { + $sum += ($arabic - $subtract); + $subtract = 0; + } + + if (count($roman) > 0) { + self::calculateArabic($roman, $sum, $subtract); + } + + return $sum; + } + /** * ATAN2. * diff --git a/tests/data/Calculation/MathTrig/ARABIC.php b/tests/data/Calculation/MathTrig/ARABIC.php index 3c397dc9..c4773beb 100644 --- a/tests/data/Calculation/MathTrig/ARABIC.php +++ b/tests/data/Calculation/MathTrig/ARABIC.php @@ -33,4 +33,28 @@ return [ -2018, '-MMXVIII', ], + [ + 499, + 'CDXCIX' + ], + [ + 499, + 'LDVLIV' + ], + [ + 499, + 'XDIX' + ], + [ + 499, + 'VDIV' + ], + [ + 499, + 'ID' + ], + [ + '#VALUE!', + 'WRONG' + ], ]; From a79b344d53faefdff36f06752e1bf85bfed57a28 Mon Sep 17 00:00:00 2001 From: youkan Date: Sat, 7 Mar 2020 14:48:54 +0900 Subject: [PATCH 18/38] Fix ROUNDUP and ROUNDDOWN for floating-point rounding error (#1404) Closes #1404 --- CHANGELOG.md | 1 + src/PhpSpreadsheet/Calculation/MathTrig.php | 10 ++++++---- tests/data/Calculation/MathTrig/ROUNDDOWN.php | 10 ++++++++++ tests/data/Calculation/MathTrig/ROUNDUP.php | 10 ++++++++++ 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16313206..211d9443 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Fix active cell when freeze pane is used [#1323](https://github.com/PHPOffice/PhpSpreadsheet/pull/1323) - Fix XLSX file loading with autofilter containing '$' [#1326](https://github.com/PHPOffice/PhpSpreadsheet/pull/1326) - PHPDoc - Use `@return $this` for fluent methods [#1362](https://github.com/PHPOffice/PhpSpreadsheet/pull/1362) +- Fix ROUNDUP and ROUNDDOWN for floating-point rounding error [#1404](https://github.com/PHPOffice/PhpSpreadsheet/pull/1404) ## [1.10.1] - 2019-12-02 diff --git a/src/PhpSpreadsheet/Calculation/MathTrig.php b/src/PhpSpreadsheet/Calculation/MathTrig.php index 51f3b899..73403686 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig.php @@ -1064,12 +1064,13 @@ class MathTrig $digits = Functions::flattenSingleValue($digits); if ((is_numeric($number)) && (is_numeric($digits))) { - $significance = pow(10, (int) $digits); if ($number < 0.0) { + $significance = pow(10, (int) $digits); + return floor($number * $significance) / $significance; } - return ceil($number * $significance) / $significance; + return round($number + 0.5 * pow(0.1, $digits), $digits, PHP_ROUND_HALF_DOWN); } return Functions::VALUE(); @@ -1091,12 +1092,13 @@ class MathTrig $digits = Functions::flattenSingleValue($digits); if ((is_numeric($number)) && (is_numeric($digits))) { - $significance = pow(10, (int) $digits); if ($number < 0.0) { + $significance = pow(10, (int) $digits); + return ceil($number * $significance) / $significance; } - return floor($number * $significance) / $significance; + return round($number - 0.5 * pow(0.1, $digits), $digits, PHP_ROUND_HALF_UP); } return Functions::VALUE(); diff --git a/tests/data/Calculation/MathTrig/ROUNDDOWN.php b/tests/data/Calculation/MathTrig/ROUNDDOWN.php index e8bb7c32..499c5a5b 100644 --- a/tests/data/Calculation/MathTrig/ROUNDDOWN.php +++ b/tests/data/Calculation/MathTrig/ROUNDDOWN.php @@ -61,6 +61,16 @@ return [ 31415.92654, -1, ], + [ + 4.44, + 4.4400, + 2, + ], + [ + 5.20, + 2.26 + 2.94, + 2, + ], [ '#VALUE!', 'ABC', diff --git a/tests/data/Calculation/MathTrig/ROUNDUP.php b/tests/data/Calculation/MathTrig/ROUNDUP.php index caa7ce37..c1782b2b 100644 --- a/tests/data/Calculation/MathTrig/ROUNDUP.php +++ b/tests/data/Calculation/MathTrig/ROUNDUP.php @@ -61,6 +61,16 @@ return [ 31415.92654, -1, ], + [ + 4.44, + 4.4400, + 2, + ], + [ + 5.20, + 2.26 + 2.94, + 2, + ], [ '#VALUE!', 'ABC', From 5daa38f4563a63389593a4cd10bdafc8336509b5 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Sat, 7 Mar 2020 21:04:37 +0700 Subject: [PATCH 19/38] Add missing sections --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 211d9443..ca24d6f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org). ## [Unreleased] +### Added + - Improved the ARABIC function to also hande short-hand roman numerals +### Fixed + +- Fix ROUNDUP and ROUNDDOWN for floating-point rounding error [#1404](https://github.com/PHPOffice/PhpSpreadsheet/pull/1404) + ## [1.11.0] - 2020-03-02 ### Added @@ -27,7 +33,6 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Fix active cell when freeze pane is used [#1323](https://github.com/PHPOffice/PhpSpreadsheet/pull/1323) - Fix XLSX file loading with autofilter containing '$' [#1326](https://github.com/PHPOffice/PhpSpreadsheet/pull/1326) - PHPDoc - Use `@return $this` for fluent methods [#1362](https://github.com/PHPOffice/PhpSpreadsheet/pull/1362) -- Fix ROUNDUP and ROUNDDOWN for floating-point rounding error [#1404](https://github.com/PHPOffice/PhpSpreadsheet/pull/1404) ## [1.10.1] - 2019-12-02 From 57c36e01d5c1a26f22e58f0c96dae02c834f9a54 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Sun, 5 Apr 2020 17:46:03 +0900 Subject: [PATCH 20/38] Replace Sami with phpDocumentor 3 Because Sami is deprecated and now raise errors. We lose API docs for multiple versions but we still have latest version with low maintenance cost. --- .sami.php | 24 ---------------------- .travis.yml | 15 ++++++-------- README.md | 2 +- docs/index.md | 2 +- docs/topics/recipes.md | 6 +++--- src/PhpSpreadsheet/Worksheet/PageSetup.php | 12 +++++------ 6 files changed, 17 insertions(+), 44 deletions(-) delete mode 100644 .sami.php diff --git a/.sami.php b/.sami.php deleted file mode 100644 index 9a2fca35..00000000 --- a/.sami.php +++ /dev/null @@ -1,24 +0,0 @@ -files() - ->name('*.php') - ->in($dir = __DIR__ . '/src'); -$versions = GitVersionCollection::create($dir) - ->addFromTags(function ($version) { - return preg_match('~^\d+\.\d+\.\d+$~', $version); - }) - ->add('master'); - -return new Sami($iterator, [ - 'title' => 'PhpSpreadsheet', - 'versions' => $versions, - 'build_dir' => __DIR__ . '/build/%version%', - 'cache_dir' => __DIR__ . '/cache/%version%', - 'remote_repository' => new GitHubRemoteRepository('PHPOffice/PhpSpreadsheet', dirname($dir)), -]); diff --git a/.travis.yml b/.travis.yml index 45d67ef8..82e25cee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,6 @@ php: cache: directories: - - cache - vendor - $HOME/.composer/cache @@ -41,19 +40,17 @@ jobs: - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover tests/coverage-clover.xml - - stage: API documentation - php: 7.2 + - stage: API documentations + if: tag is present + php: 7.4 before_script: - - curl -O https://get.sensiolabs.org/sami.phar + - curl -O https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.0.0-rc/phpDocumentor.phar script: - - git fetch origin master:master - - git fetch origin --tags - - php sami.phar update .sami.php - - echo '

If you are not automatically redirected, please go to the latest stable API documentation.

' > build/index.html + - php phpDocumentor.phar --directory src/ --target docs/api deploy: provider: pages skip-cleanup: true - local-dir: build + local-dir: docs/api github-token: $GITHUB_TOKEN on: all_branches: true diff --git a/README.md b/README.md index 71721220..df683a1e 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ PhpSpreadsheet is a library written in pure PHP and providing a set of classes t ## Documentation -Read more about it, including install instructions, in the [official documentation](https://phpspreadsheet.readthedocs.io). Or check out the [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master). +Read more about it, including install instructions, in the [official documentation](https://phpspreadsheet.readthedocs.io). Or check out the [API documentation](https://phpoffice.github.io/PhpSpreadsheet). Please ask your support questions on [StackOverflow](https://stackoverflow.com/questions/tagged/phpspreadsheet), or have a quick chat on [Gitter](https://gitter.im/PHPOffice/PhpSpreadsheet). diff --git a/docs/index.md b/docs/index.md index 7c276792..e7bb4660 100644 --- a/docs/index.md +++ b/docs/index.md @@ -89,7 +89,7 @@ architecture](./topics/architecture.md), [accessing cells](./topics/accessing-cells.md) and [reading and writing to files](./topics/reading-and-writing-to-file.md). -Or browse the [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master). +Or browse the [API documentation](https://phpoffice.github.io/PhpSpreadsheet). # Credits diff --git a/docs/topics/recipes.md b/docs/topics/recipes.md index 71269108..b0956b6e 100644 --- a/docs/topics/recipes.md +++ b/docs/topics/recipes.md @@ -3,12 +3,12 @@ The following pages offer you some widely-used PhpSpreadsheet recipes. Please note that these do NOT offer complete documentation on specific PhpSpreadsheet API functions, but just a bump to get you started. If you -need specific API functions, please refer to the [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master). +need specific API functions, please refer to the [API documentation](https://phpoffice.github.io/PhpSpreadsheet). For example, [setting a worksheet's page orientation and size ](#setting-a-worksheets-page-orientation-and-size) covers setting a page orientation to A4. Other paper formats, like US Letter, are not covered -in this document, but in the PhpSpreadsheet [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master). +in this document, but in the PhpSpreadsheet [API documentation](https://phpoffice.github.io/PhpSpreadsheet). ## Setting a spreadsheet's metadata @@ -301,7 +301,7 @@ $spreadsheet->getActiveSheet()->getPageSetup() ``` Note that there are additional page settings available. Please refer to -the [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master) for all possible options. +the [API documentation](https://phpoffice.github.io/PhpSpreadsheet) for all possible options. ### Page Setup: Scaling options diff --git a/src/PhpSpreadsheet/Worksheet/PageSetup.php b/src/PhpSpreadsheet/Worksheet/PageSetup.php index fa1810f3..38a09736 100644 --- a/src/PhpSpreadsheet/Worksheet/PageSetup.php +++ b/src/PhpSpreadsheet/Worksheet/PageSetup.php @@ -180,7 +180,7 @@ class PageSetup * Print scaling. Valid values range from 10 to 400 * This setting is overridden when fitToWidth and/or fitToHeight are in use * - * @var int? + * @var null|int */ private $scale = 100; @@ -196,7 +196,7 @@ class PageSetup * Fit To Height * Number of vertical pages to fit on. * - * @var int? + * @var null|int */ private $fitToHeight = 1; @@ -204,7 +204,7 @@ class PageSetup * Fit To Width * Number of horizontal pages to fit on. * - * @var int? + * @var null|int */ private $fitToWidth = 1; @@ -308,7 +308,7 @@ class PageSetup /** * Get Scale. * - * @return int? + * @return null|int */ public function getScale() { @@ -370,7 +370,7 @@ class PageSetup /** * Get Fit To Height. * - * @return int? + * @return null|int */ public function getFitToHeight() { @@ -398,7 +398,7 @@ class PageSetup /** * Get Fit To Width. * - * @return int? + * @return null|int */ public function getFitToWidth() { From 87f71e1930b497b36e3b9b1522117dfa87096d2b Mon Sep 17 00:00:00 2001 From: Matthijs Alles Date: Tue, 4 Feb 2020 13:19:23 +0100 Subject: [PATCH 21/38] Support whitespaces in CSS style in Xlsx Indentation in the xml leaves spaces in style string even after replacing newlines. Replacing the spaces ensures no spaces in keys of the resulting style-array Fixes #1347 --- CHANGELOG.md | 15 +---------- src/PhpSpreadsheet/Reader/Xlsx.php | 7 +++++- tests/PhpSpreadsheetTests/Reader/XlsxTest.php | 25 +++++++++++++++++++ 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca24d6f0..593700a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,20 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org). ## [Unreleased] -### Added - -- Improved the ARABIC function to also hande short-hand roman numerals - -### Fixed - -- Fix ROUNDUP and ROUNDDOWN for floating-point rounding error [#1404](https://github.com/PHPOffice/PhpSpreadsheet/pull/1404) - -## [1.11.0] - 2020-03-02 - -### Added - -- Added support for the BASE function -- Added support for the ARABIC function - Conditionals - Extend Support for (NOT)CONTAINSBLANKS [#1278](https://github.com/PHPOffice/PhpSpreadsheet/pull/1278) ### Fixed @@ -33,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Fix active cell when freeze pane is used [#1323](https://github.com/PHPOffice/PhpSpreadsheet/pull/1323) - Fix XLSX file loading with autofilter containing '$' [#1326](https://github.com/PHPOffice/PhpSpreadsheet/pull/1326) - PHPDoc - Use `@return $this` for fluent methods [#1362](https://github.com/PHPOffice/PhpSpreadsheet/pull/1362) +- Fix loading styles from vmlDrawings when containing whitespace [#1347](https://github.com/PHPOffice/PhpSpreadsheet/issues/1347) ## [1.10.1] - 2019-12-02 diff --git a/src/PhpSpreadsheet/Reader/Xlsx.php b/src/PhpSpreadsheet/Reader/Xlsx.php index 9b5b7db4..428014c3 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx.php +++ b/src/PhpSpreadsheet/Reader/Xlsx.php @@ -1828,7 +1828,7 @@ class Xlsx extends BaseReader private static function toCSSArray($style) { - $style = trim(str_replace(["\r", "\n"], '', $style), ';'); + $style = self::stripWhiteSpaceFromStyleString($style); $temp = explode(';', $style); $style = []; @@ -1857,6 +1857,11 @@ class Xlsx extends BaseReader return $style; } + public static function stripWhiteSpaceFromStyleString($string) + { + return trim(str_replace(["\r", "\n", ' '], '', $string), ';'); + } + private static function boolean($value) { if (is_object($value)) { diff --git a/tests/PhpSpreadsheetTests/Reader/XlsxTest.php b/tests/PhpSpreadsheetTests/Reader/XlsxTest.php index 1180aacc..f178e851 100644 --- a/tests/PhpSpreadsheetTests/Reader/XlsxTest.php +++ b/tests/PhpSpreadsheetTests/Reader/XlsxTest.php @@ -228,4 +228,29 @@ class XlsxTest extends TestCase // Fake assert. The only thing we need is to ensure the file is loaded without exception $this->assertNotNull($excel); } + + /** + * Test if all whitespace is removed from a style definition string. + * This is needed to parse it into properties with the correct keys. + * + * @param $string + * @dataProvider providerStripsWhiteSpaceFromStyleString + */ + public function testStripsWhiteSpaceFromStyleString($string) + { + $string = Xlsx::stripWhiteSpaceFromStyleString($string); + $this->assertEquals(preg_match('/\s/', $string), 0); + } + + public function providerStripsWhiteSpaceFromStyleString() + { + return [ + ['position:absolute;margin-left:424.5pt;margin-top:169.5pt;width:67.5pt; + height:13.5pt;z-index:5;mso-wrap-style:tight'], + ['position:absolute;margin-left:424.5pt;margin-top:169.5pt;width:67.5pt; +height:13.5pt;z-index:5;mso-wrap-style:tight'], + ['position:absolute; margin-left:424.5pt; margin-top:169.5pt; width:67.5pt; + height:13.5pt;z-index:5;mso-wrap-style:tight'], + ]; + } } From 6e76d4e8b52b229f72fe0b7ee299628bfb8ed1af Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Sun, 26 Apr 2020 10:24:14 +0900 Subject: [PATCH 22/38] Cleanup CHANGELOG accidental changes --- CHANGELOG.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 593700a4..3e65a1a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org). ## [Unreleased] +### Added + +- Improved the ARABIC function to also hande short-hand roman numerals + +### Fixed + +- Fix ROUNDUP and ROUNDDOWN for floating-point rounding error [#1404](https://github.com/PHPOffice/PhpSpreadsheet/pull/1404) +- Fix loading styles from vmlDrawings when containing whitespace [#1347](https://github.com/PHPOffice/PhpSpreadsheet/issues/1347) + +## [1.11.0] - 2020-03-02 + +### Added + +- Added support for the BASE function +- Added support for the ARABIC function - Conditionals - Extend Support for (NOT)CONTAINSBLANKS [#1278](https://github.com/PHPOffice/PhpSpreadsheet/pull/1278) ### Fixed @@ -19,7 +34,6 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Fix active cell when freeze pane is used [#1323](https://github.com/PHPOffice/PhpSpreadsheet/pull/1323) - Fix XLSX file loading with autofilter containing '$' [#1326](https://github.com/PHPOffice/PhpSpreadsheet/pull/1326) - PHPDoc - Use `@return $this` for fluent methods [#1362](https://github.com/PHPOffice/PhpSpreadsheet/pull/1362) -- Fix loading styles from vmlDrawings when containing whitespace [#1347](https://github.com/PHPOffice/PhpSpreadsheet/issues/1347) ## [1.10.1] - 2019-12-02 From 3dcc5ca7533180cba95ede7d2db5f9ce008ad082 Mon Sep 17 00:00:00 2001 From: Tim Gavryutenko <35343569+TimGa@users.noreply.github.com> Date: Sun, 26 Apr 2020 05:00:43 +0300 Subject: [PATCH 23/38] Fix removing last row incorrect behavior `$highestRow = $this->getHighestDataRow();` was calculated after `$this->getCellCollection()->removeRow($pRow + $r);` - this is the root reason for incorrect rows removal because removing last row will change '$this->getHighestDataRow()' value, but removing row from the middle will not change it. So, removing last row causes incorrect `$highestRow` value that is used for wiping out empty rows from the bottom of the table: ```php for ($r = 0; $r < $pNumRows; ++$r) { $this->getCellCollection()->removeRow($highestRow); --$highestRow; } ``` To prevent this incorrect behavior I've moved highest row calculation before row removal. But this still doesn't solve another problem when trying remove non existing rows: in this case the code above will remove `$pNumRows` rows from below of the table, e.g. if `$highestRow=4` and `$pNumRows=6`, than rows 4, 3, 2, 1, 0, -1 will be deleted. Obviously, this is not good, that is why I've added `$removedRowsCounter` to fix this issue. And finally, moved Exception to early if statement to get away from unnecessary 'if-else'. Fixes #1364 Closes #1365 --- CHANGELOG.md | 1 + src/PhpSpreadsheet/Worksheet/Worksheet.php | 31 ++-- .../Worksheet/WorksheetTest.php | 132 ++++++++++++++++++ 3 files changed, 151 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e65a1a8..391115a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Fix ROUNDUP and ROUNDDOWN for floating-point rounding error [#1404](https://github.com/PHPOffice/PhpSpreadsheet/pull/1404) - Fix loading styles from vmlDrawings when containing whitespace [#1347](https://github.com/PHPOffice/PhpSpreadsheet/issues/1347) +- Fix incorrect behavior when removing last row [#1365](https://github.com/PHPOffice/PhpSpreadsheet/pull/1365) ## [1.11.0] - 2020-03-02 diff --git a/src/PhpSpreadsheet/Worksheet/Worksheet.php b/src/PhpSpreadsheet/Worksheet/Worksheet.php index f3a5b4da..9a3f9647 100644 --- a/src/PhpSpreadsheet/Worksheet/Worksheet.php +++ b/src/PhpSpreadsheet/Worksheet/Worksheet.php @@ -2114,22 +2114,27 @@ class Worksheet implements IComparable */ public function removeRow($pRow, $pNumRows = 1) { - if ($pRow >= 1) { - for ($r = 0; $r < $pNumRows; ++$r) { - $this->getCellCollection()->removeRow($pRow + $r); - } - - $highestRow = $this->getHighestDataRow(); - $objReferenceHelper = ReferenceHelper::getInstance(); - $objReferenceHelper->insertNewBefore('A' . ($pRow + $pNumRows), 0, -$pNumRows, $this); - for ($r = 0; $r < $pNumRows; ++$r) { - $this->getCellCollection()->removeRow($highestRow); - --$highestRow; - } - } else { + if ($pRow < 1) { throw new Exception('Rows to be deleted should at least start from row 1.'); } + $highestRow = $this->getHighestDataRow(); + $removedRowsCounter = 0; + + for ($r = 0; $r < $pNumRows; ++$r) { + if ($pRow + $r <= $highestRow) { + $this->getCellCollection()->removeRow($pRow + $r); + ++$removedRowsCounter; + } + } + + $objReferenceHelper = ReferenceHelper::getInstance(); + $objReferenceHelper->insertNewBefore('A' . ($pRow + $pNumRows), 0, -$pNumRows, $this); + for ($r = 0; $r < $removedRowsCounter; ++$r) { + $this->getCellCollection()->removeRow($highestRow); + --$highestRow; + } + return $this; } diff --git a/tests/PhpSpreadsheetTests/Worksheet/WorksheetTest.php b/tests/PhpSpreadsheetTests/Worksheet/WorksheetTest.php index e1b4738b..d1e19df4 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/WorksheetTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/WorksheetTest.php @@ -272,4 +272,136 @@ class WorksheetTest extends TestCase self::assertSame($expectedHighestColumn, $worksheet->getHighestColumn()); self::assertSame($expectedData, $worksheet->toArray()); } + + public function removeRowsProvider() + { + return [ + 'Remove all rows except first one' => [ + [ + ['A1', 'B1', 'C1'], + ['A2', 'B2', 'C2'], + ['A3', 'B3', 'C3'], + ['A4', 'B4', 'C4'], + ], + 2, + 3, + [ + ['A1', 'B1', 'C1'], + ], + 1, + ], + 'Remove all rows except last one' => [ + [ + ['A1', 'B1', 'C1'], + ['A2', 'B2', 'C2'], + ['A3', 'B3', 'C3'], + ['A4', 'B4', 'C4'], + ], + 1, + 3, + [ + ['A4', 'B4', 'C4'], + ], + 1, + ], + 'Remove last row' => [ + [ + ['A1', 'B1', 'C1'], + ['A2', 'B2', 'C2'], + ['A3', 'B3', 'C3'], + ['A4', 'B4', 'C4'], + ], + 4, + 1, + [ + ['A1', 'B1', 'C1'], + ['A2', 'B2', 'C2'], + ['A3', 'B3', 'C3'], + ], + 3, + ], + 'Remove first row' => [ + [ + ['A1', 'B1', 'C1'], + ['A2', 'B2', 'C2'], + ['A3', 'B3', 'C3'], + ['A4', 'B4', 'C4'], + ], + 1, + 1, + [ + ['A2', 'B2', 'C2'], + ['A3', 'B3', 'C3'], + ['A4', 'B4', 'C4'], + ], + 3, + ], + 'Remove all rows except first and last' => [ + [ + ['A1', 'B1', 'C1'], + ['A2', 'B2', 'C2'], + ['A3', 'B3', 'C3'], + ['A4', 'B4', 'C4'], + ], + 2, + 2, + [ + ['A1', 'B1', 'C1'], + ['A4', 'B4', 'C4'], + ], + 2, + ], + 'Remove non existing rows' => [ + [ + ['A1', 'B1', 'C1'], + ['A2', 'B2', 'C2'], + ['A3', 'B3', 'C3'], + ['A4', 'B4', 'C4'], + ], + 2, + 10, + [ + ['A1', 'B1', 'C1'], + ], + 1, + ], + 'Remove only non existing rows' => [ + [ + ['A1', 'B1', 'C1'], + ['A2', 'B2', 'C2'], + ['A3', 'B3', 'C3'], + ['A4', 'B4', 'C4'], + ], + 5, + 10, + [ + ['A1', 'B1', 'C1'], + ['A2', 'B2', 'C2'], + ['A3', 'B3', 'C3'], + ['A4', 'B4', 'C4'], + ], + 4, + ], + ]; + } + + /** + * @dataProvider removeRowsProvider + */ + public function testRemoveRows( + array $initialData, + int $rowToRemove, + int $rowsQtyToRemove, + array $expectedData, + int $expectedHighestRow + ) { + $workbook = new Spreadsheet(); + $worksheet = $workbook->getActiveSheet(); + $worksheet->fromArray($initialData); + + $worksheet->removeRow($rowToRemove, $rowsQtyToRemove); + + self::assertSame($expectedData, $worksheet->toArray()); + self::assertSame($expectedHighestRow, $worksheet->getHighestRow()); + } } From 6788869a409735a8d057c24e280ddba0d0d27f32 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sun, 26 Apr 2020 05:09:56 -0700 Subject: [PATCH 24/38] =?UTF-8?q?Fix=20typo:=20occured=20=E2=86=92=20occur?= =?UTF-8?q?red=20(#1435)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/PhpSpreadsheet/Calculation/Calculation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php index 344bc323..f428c9b4 100644 --- a/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/src/PhpSpreadsheet/Calculation/Calculation.php @@ -3737,7 +3737,7 @@ class Calculation } elseif (isset(self::$operators[$opCharacter]) && !$expectingOperator) { return $this->raiseFormulaError("Formula Error: Unexpected operator '$opCharacter'"); } else { // I don't even want to know what you did to get here - return $this->raiseFormulaError('Formula Error: An unexpected error occured'); + return $this->raiseFormulaError('Formula Error: An unexpected error occurred'); } // Test for end of formula string if ($index == strlen($formula)) { From c4895b94687cd79b91a7d026ea1aed1b061385fe Mon Sep 17 00:00:00 2001 From: Owen Leibman Date: Fri, 17 Jan 2020 17:52:16 -0800 Subject: [PATCH 25/38] MATCH with a static array should return the position of the found value based on the values submitted. Returns #N/A, unless the element searched for is at the end of the array. The problem is in Calculation.php line 4231: if (!is_array($functionCall)) { foreach ($args as &$arg) { $arg = Functions::flattenSingleValue($arg); } unset($arg); } I believe this code is intended to handle functions where PhpSpreadsheet just passes the call on to PHP without implementing the code on its own, e.g. for atan or acos. In the bug report, the following code fails: $flat_rate = "=MATCH(6,{4,5,6,2}, 0)"; $sheet->getCell('A1')->setValue($flat_rate); The expected value is 3, but the actual result is "#N/A". The reason for this result is that the parser replaces the braces with calls to the MKMATRIX internal function, whose value for functioncall was: 'self::MKMATRIX'. Since this isn't an array, the flattening code is executed, and the unintended result occurs. The fix is to change the definition for functioncall in that case to [__CLASS__, 'mkMatrix'], avoiding the flattening. However, there is also another part to this bug. The flattening should be returning the first entry in the array, but is in fact returning the last. This explains why the bug report specified "unless ... end of the array". I confirmed that Excel does use the first item in the array rather than the last, e.g. =atan({1,2,3}) entered into a cell will return atan(1), not atan(3). The problem here is that flattenSingleValue, which says in its comments that it is supposed to be returning the first item, uses array_pop rather than array_shift. I have changed that as well. The same mistake was also present in Cell.php function getCalculatedValue. The correct behavior can be verified by entering =minverse({-2.5,1.5;2,-1}) into an Excel cell' Excel flattens the result ({2,3;4,5}) to 2, and so should PhpSpreadsheet. Fixes #1271 Closes #1332 --- CHANGELOG.md | 1 + .../Calculation/Calculation.php | 2 +- src/PhpSpreadsheet/Calculation/Functions.php | 2 +- src/PhpSpreadsheet/Cell/Cell.php | 2 +- .../Calculation/FormulaAsStringTest.php | 46 +++++++++++++++++++ tests/data/Calculation/FunctionsAsString.php | 24 ++++++++++ 6 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 tests/PhpSpreadsheetTests/Calculation/FormulaAsStringTest.php create mode 100644 tests/data/Calculation/FunctionsAsString.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 391115a6..d4fae5c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Fix ROUNDUP and ROUNDDOWN for floating-point rounding error [#1404](https://github.com/PHPOffice/PhpSpreadsheet/pull/1404) - Fix loading styles from vmlDrawings when containing whitespace [#1347](https://github.com/PHPOffice/PhpSpreadsheet/issues/1347) - Fix incorrect behavior when removing last row [#1365](https://github.com/PHPOffice/PhpSpreadsheet/pull/1365) +- MATCH with a static array should return the position of the found value based on the values submitted [#1332](https://github.com/PHPOffice/PhpSpreadsheet/pull/1332) ## [1.11.0] - 2020-03-02 diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php index f428c9b4..ae86a963 100644 --- a/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/src/PhpSpreadsheet/Calculation/Calculation.php @@ -2235,7 +2235,7 @@ class Calculation private static $controlFunctions = [ 'MKMATRIX' => [ 'argumentCount' => '*', - 'functionCall' => 'self::mkMatrix', + 'functionCall' => [__CLASS__, 'mkMatrix'], ], ]; diff --git a/src/PhpSpreadsheet/Calculation/Functions.php b/src/PhpSpreadsheet/Calculation/Functions.php index bb2170be..1862b008 100644 --- a/src/PhpSpreadsheet/Calculation/Functions.php +++ b/src/PhpSpreadsheet/Calculation/Functions.php @@ -646,7 +646,7 @@ class Functions public static function flattenSingleValue($value = '') { while (is_array($value)) { - $value = array_pop($value); + $value = array_shift($value); } return $value; diff --git a/src/PhpSpreadsheet/Cell/Cell.php b/src/PhpSpreadsheet/Cell/Cell.php index bae8261e..e618436e 100644 --- a/src/PhpSpreadsheet/Cell/Cell.php +++ b/src/PhpSpreadsheet/Cell/Cell.php @@ -266,7 +266,7 @@ class Cell // We don't yet handle array returns if (is_array($result)) { while (is_array($result)) { - $result = array_pop($result); + $result = array_shift($result); } } } catch (Exception $ex) { diff --git a/tests/PhpSpreadsheetTests/Calculation/FormulaAsStringTest.php b/tests/PhpSpreadsheetTests/Calculation/FormulaAsStringTest.php new file mode 100644 index 00000000..c51e520a --- /dev/null +++ b/tests/PhpSpreadsheetTests/Calculation/FormulaAsStringTest.php @@ -0,0 +1,46 @@ +getActiveSheet(); + $workSheet->setCellValue('A1', 10); + $workSheet->setCellValue('A2', 20); + $workSheet->setCellValue('A3', 30); + $workSheet->setCellValue('A4', 40); + $spreadsheet->addNamedRange(new \PhpOffice\PhpSpreadsheet\NamedRange('namedCell', $workSheet, 'A4')); + $workSheet->setCellValue('B1', 'uPPER'); + $workSheet->setCellValue('B2', '=TRUE()'); + $workSheet->setCellValue('B3', '=FALSE()'); + + $ws2 = $spreadsheet->createSheet(); + $ws2->setCellValue('A1', 100); + $ws2->setCellValue('A2', 200); + $ws2->setTitle('Sheet2'); + $spreadsheet->addNamedRange(new \PhpOffice\PhpSpreadsheet\NamedRange('A2B', $ws2, 'A2')); + + $spreadsheet->setActiveSheetIndex(0); + $cell2 = $workSheet->getCell('D1'); + $cell2->setValue($formula); + $result = $cell2->getCalculatedValue(); + self::assertEquals($expectedResult, $result); + } + + public function providerFunctionsAsString() + { + return require 'data/Calculation/FunctionsAsString.php'; + } +} diff --git a/tests/data/Calculation/FunctionsAsString.php b/tests/data/Calculation/FunctionsAsString.php new file mode 100644 index 00000000..85953472 --- /dev/null +++ b/tests/data/Calculation/FunctionsAsString.php @@ -0,0 +1,24 @@ + Date: Thu, 6 Feb 2020 08:53:25 +0100 Subject: [PATCH 26/38] Added support for the FLOOR.MATH and FLOOR.PRECISE functions --- CHANGELOG.md | 1 + .../Calculation/Calculation.php | 10 +++ src/PhpSpreadsheet/Calculation/MathTrig.php | 74 +++++++++++++++ .../Calculation/functionlist.txt | 2 + .../Functions/MathTrig/FloorMathTest.php | 31 +++++++ .../Functions/MathTrig/FloorPreciseTest.php | 31 +++++++ tests/data/Calculation/MathTrig/FLOORMATH.php | 89 +++++++++++++++++++ .../Calculation/MathTrig/FLOORPRECISE.php | 57 ++++++++++++ 8 files changed, 295 insertions(+) create mode 100644 tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorMathTest.php create mode 100644 tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorPreciseTest.php create mode 100644 tests/data/Calculation/MathTrig/FLOORMATH.php create mode 100644 tests/data/Calculation/MathTrig/FLOORPRECISE.php diff --git a/CHANGELOG.md b/CHANGELOG.md index d4fae5c4..6f4bae1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). ### Added - Improved the ARABIC function to also hande short-hand roman numerals +- Added support for the FLOOR.MATH and FLOOR.PRECISE functions [#1351](https://github.com/PHPOffice/PhpSpreadsheet/pull/1351) ### Fixed diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php index ae86a963..69f72033 100644 --- a/src/PhpSpreadsheet/Calculation/Calculation.php +++ b/src/PhpSpreadsheet/Calculation/Calculation.php @@ -914,6 +914,16 @@ class Calculation 'functionCall' => [MathTrig::class, 'FLOOR'], 'argumentCount' => '2', ], + 'FLOOR.MATH' => [ + 'category' => Category::CATEGORY_MATH_AND_TRIG, + 'functionCall' => [MathTrig::class, 'FLOORMATH'], + 'argumentCount' => '3', + ], + 'FLOOR.PRECISE' => [ + 'category' => Category::CATEGORY_MATH_AND_TRIG, + 'functionCall' => [MathTrig::class, 'FLOORPRECISE'], + 'argumentCount' => '2', + ], 'FORECAST' => [ 'category' => Category::CATEGORY_STATISTICAL, 'functionCall' => [Statistical::class, 'FORECAST'], diff --git a/src/PhpSpreadsheet/Calculation/MathTrig.php b/src/PhpSpreadsheet/Calculation/MathTrig.php index 73403686..590ad99b 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig.php @@ -438,6 +438,80 @@ class MathTrig return Functions::VALUE(); } + /** + * FLOOR.MATH. + * + * Round a number down to the nearest integer or to the nearest multiple of significance. + * + * Excel Function: + * FLOOR.MATH(number[,significance[,mode]]) + * + * @category Mathematical and Trigonometric Functions + * + * @param float $number Number to round + * @param float $significance Significance + * @param int $mode direction to round negative numbers + * + * @return float|string Rounded Number, or a string containing an error + */ + public static function FLOORMATH($number, $significance = null, $mode = 0) + { + $number = Functions::flattenSingleValue($number); + $significance = Functions::flattenSingleValue($significance); + $mode = Functions::flattenSingleValue($mode); + + if (is_numeric($number) && $significance === null) { + $significance = $number / abs($number); + } + + if (is_numeric($number) && is_numeric($significance) && is_numeric($mode)) { + if ($significance == 0.0) { + return Functions::DIV0(); + } elseif ($number == 0.0) { + return 0.0; + } elseif (self::SIGN($significance) == -1 || (self::SIGN($number) == -1 && !empty($mode))) { + return ceil($number / $significance) * $significance; + } + + return floor($number / $significance) * $significance; + } + + return Functions::VALUE(); + } + + /** + * FLOOR.PRECISE. + * + * Rounds number down, toward zero, to the nearest multiple of significance. + * + * Excel Function: + * FLOOR.PRECISE(number[,significance]) + * + * @category Mathematical and Trigonometric Functions + * + * @param float $number Number to round + * @param float $significance Significance + * + * @return float|string Rounded Number, or a string containing an error + */ + public static function FLOORPRECISE($number, $significance = 1) + { + $number = Functions::flattenSingleValue($number); + $significance = Functions::flattenSingleValue($significance); + + if ((is_numeric($number)) && (is_numeric($significance))) { + if ($significance == 0.0) { + return Functions::DIV0(); + } elseif ($number == 0.0) { + return 0.0; + } + + return floor($number / abs($significance)) * abs($significance); + } + + return Functions::VALUE(); + } + private static function evaluateGCD($a, $b) { return $b ? self::evaluateGCD($b, $a % $b) : $a; diff --git a/src/PhpSpreadsheet/Calculation/functionlist.txt b/src/PhpSpreadsheet/Calculation/functionlist.txt index 7776e6ea..77fd4ee0 100644 --- a/src/PhpSpreadsheet/Calculation/functionlist.txt +++ b/src/PhpSpreadsheet/Calculation/functionlist.txt @@ -139,6 +139,8 @@ FISHER FISHERINV FIXED FLOOR +FLOOR.MATH +FLOOR.PRECISE FORECAST FREQUENCY FTEST diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorMathTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorMathTest.php new file mode 100644 index 00000000..0e693e80 --- /dev/null +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorMathTest.php @@ -0,0 +1,31 @@ +assertEquals($expectedResult, $result, '', 1E-12); + } + + public function providerFLOORMATH() + { + return require 'data/Calculation/MathTrig/FLOORMATH.php'; + } +} diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorPreciseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorPreciseTest.php new file mode 100644 index 00000000..616cb43b --- /dev/null +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorPreciseTest.php @@ -0,0 +1,31 @@ +assertEquals($expectedResult, $result, '', 1E-12); + } + + public function providerFLOORPRECISE() + { + return require 'data/Calculation/MathTrig/FLOORPRECISE.php'; + } +} diff --git a/tests/data/Calculation/MathTrig/FLOORMATH.php b/tests/data/Calculation/MathTrig/FLOORMATH.php new file mode 100644 index 00000000..691b5245 --- /dev/null +++ b/tests/data/Calculation/MathTrig/FLOORMATH.php @@ -0,0 +1,89 @@ + Date: Fri, 14 Feb 2020 14:32:41 +0100 Subject: [PATCH 27/38] Load with styles should not default to black fill color Fixes #1353 Closes #1361 --- CHANGELOG.md | 1 + src/PhpSpreadsheet/Reader/Xlsx.php | 2 -- tests/PhpSpreadsheetTests/Reader/XlsxTest.php | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f4bae1a..a25c9c51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). - Fix loading styles from vmlDrawings when containing whitespace [#1347](https://github.com/PHPOffice/PhpSpreadsheet/issues/1347) - Fix incorrect behavior when removing last row [#1365](https://github.com/PHPOffice/PhpSpreadsheet/pull/1365) - MATCH with a static array should return the position of the found value based on the values submitted [#1332](https://github.com/PHPOffice/PhpSpreadsheet/pull/1332) +- Fix Xlsx Reader's handling of undefined fill color [#1353](https://github.com/PHPOffice/PhpSpreadsheet/pull/1353) ## [1.11.0] - 2020-03-02 diff --git a/src/PhpSpreadsheet/Reader/Xlsx.php b/src/PhpSpreadsheet/Reader/Xlsx.php index 428014c3..566e9fbb 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx.php +++ b/src/PhpSpreadsheet/Reader/Xlsx.php @@ -1620,8 +1620,6 @@ class Xlsx extends BaseReader $docStyle->getFill()->setFillType($patternType); if ($style->fill->patternFill->fgColor) { $docStyle->getFill()->getStartColor()->setARGB(self::readColor($style->fill->patternFill->fgColor, true)); - } else { - $docStyle->getFill()->getStartColor()->setARGB('FF000000'); } if ($style->fill->patternFill->bgColor) { $docStyle->getFill()->getEndColor()->setARGB(self::readColor($style->fill->patternFill->bgColor, true)); diff --git a/tests/PhpSpreadsheetTests/Reader/XlsxTest.php b/tests/PhpSpreadsheetTests/Reader/XlsxTest.php index f178e851..246b5a47 100644 --- a/tests/PhpSpreadsheetTests/Reader/XlsxTest.php +++ b/tests/PhpSpreadsheetTests/Reader/XlsxTest.php @@ -83,8 +83,8 @@ class XlsxTest extends TestCase { $expectedColours = [ 1 => ['A' => 'C00000', 'C' => 'FF0000', 'E' => 'FFC000'], - 3 => ['A' => '7030A0', 'C' => '000000', 'E' => 'FFFF00'], - 5 => ['A' => '002060', 'C' => '000000', 'E' => '92D050'], + 3 => ['A' => '7030A0', 'C' => 'FFFFFF', 'E' => 'FFFF00'], + 5 => ['A' => '002060', 'C' => 'FFFFFF', 'E' => '92D050'], 7 => ['A' => '0070C0', 'C' => '00B0F0', 'E' => '00B050'], ]; From f9f9f4cacfe1398f3ab0f1b709e71bbea044b6d2 Mon Sep 17 00:00:00 2001 From: n-longcape Date: Thu, 12 Mar 2020 12:37:07 +0900 Subject: [PATCH 28/38] Fix ROUNDUP and ROUNDDOWN for negative number Closes #1417 --- CHANGELOG.md | 1 + src/PhpSpreadsheet/Calculation/MathTrig.php | 8 ++------ tests/data/Calculation/MathTrig/ROUNDDOWN.php | 10 ++++++++++ tests/data/Calculation/MathTrig/ROUNDUP.php | 10 ++++++++++ 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a25c9c51..1fa12b3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org). ### Fixed - Fix ROUNDUP and ROUNDDOWN for floating-point rounding error [#1404](https://github.com/PHPOffice/PhpSpreadsheet/pull/1404) +- Fix ROUNDUP and ROUNDDOWN for negative number [#1417](https://github.com/PHPOffice/PhpSpreadsheet/pull/1417) - Fix loading styles from vmlDrawings when containing whitespace [#1347](https://github.com/PHPOffice/PhpSpreadsheet/issues/1347) - Fix incorrect behavior when removing last row [#1365](https://github.com/PHPOffice/PhpSpreadsheet/pull/1365) - MATCH with a static array should return the position of the found value based on the values submitted [#1332](https://github.com/PHPOffice/PhpSpreadsheet/pull/1332) diff --git a/src/PhpSpreadsheet/Calculation/MathTrig.php b/src/PhpSpreadsheet/Calculation/MathTrig.php index 590ad99b..f94c8fcc 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig.php @@ -1139,9 +1139,7 @@ class MathTrig if ((is_numeric($number)) && (is_numeric($digits))) { if ($number < 0.0) { - $significance = pow(10, (int) $digits); - - return floor($number * $significance) / $significance; + return round($number - 0.5 * pow(0.1, $digits), $digits, PHP_ROUND_HALF_DOWN); } return round($number + 0.5 * pow(0.1, $digits), $digits, PHP_ROUND_HALF_DOWN); @@ -1167,9 +1165,7 @@ class MathTrig if ((is_numeric($number)) && (is_numeric($digits))) { if ($number < 0.0) { - $significance = pow(10, (int) $digits); - - return ceil($number * $significance) / $significance; + return round($number + 0.5 * pow(0.1, $digits), $digits, PHP_ROUND_HALF_UP); } return round($number - 0.5 * pow(0.1, $digits), $digits, PHP_ROUND_HALF_UP); diff --git a/tests/data/Calculation/MathTrig/ROUNDDOWN.php b/tests/data/Calculation/MathTrig/ROUNDDOWN.php index 499c5a5b..b1b3ac71 100644 --- a/tests/data/Calculation/MathTrig/ROUNDDOWN.php +++ b/tests/data/Calculation/MathTrig/ROUNDDOWN.php @@ -71,6 +71,16 @@ return [ 2.26 + 2.94, 2, ], + [ + -4.44, + -4.4400, + 2, + ], + [ + -5.20, + -2.26 - 2.94, + 2, + ], [ '#VALUE!', 'ABC', diff --git a/tests/data/Calculation/MathTrig/ROUNDUP.php b/tests/data/Calculation/MathTrig/ROUNDUP.php index c1782b2b..f522e83f 100644 --- a/tests/data/Calculation/MathTrig/ROUNDUP.php +++ b/tests/data/Calculation/MathTrig/ROUNDUP.php @@ -66,11 +66,21 @@ return [ 4.4400, 2, ], + [ + -4.44, + -4.4400, + 2, + ], [ 5.20, 2.26 + 2.94, 2, ], + [ + -5.20, + -2.26 - 2.94, + 2, + ], [ '#VALUE!', 'ABC', From f79611d6dc1f6b7e8e30b738fc371b392001dbfd Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Mon, 27 Apr 2020 17:12:48 +0900 Subject: [PATCH 29/38] 1.12.0 --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fa12b3d..897a8e51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com) and this project adheres to [Semantic Versioning](https://semver.org). -## [Unreleased] +## [1.12.0] - 2020-04-27 ### Added -- Improved the ARABIC function to also hande short-hand roman numerals +- Improved the ARABIC function to also handle short-hand roman numerals - Added support for the FLOOR.MATH and FLOOR.PRECISE functions [#1351](https://github.com/PHPOffice/PhpSpreadsheet/pull/1351) ### Fixed From b1a78634856516a6b92f3387479b2b4bc519da15 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Mon, 27 Apr 2020 18:26:51 +0900 Subject: [PATCH 30/38] Force doc deploy just for this once --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 82e25cee..2a0d7cf6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,6 @@ jobs: - php ocular.phar code-coverage:upload --format=php-clover tests/coverage-clover.xml - stage: API documentations - if: tag is present php: 7.4 before_script: - curl -O https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.0.0-rc/phpDocumentor.phar @@ -52,6 +51,3 @@ jobs: skip-cleanup: true local-dir: docs/api github-token: $GITHUB_TOKEN - on: - all_branches: true - condition: $TRAVIS_BRANCH =~ ^master$ From 4e6d6838e02bf0f5e8253ec53ea06d7431411ad4 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Mon, 27 Apr 2020 18:29:05 +0900 Subject: [PATCH 31/38] Deploy doc only when tags on master --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 2a0d7cf6..a9b8c84a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,6 +41,7 @@ jobs: - php ocular.phar code-coverage:upload --format=php-clover tests/coverage-clover.xml - stage: API documentations + if: tag is present AND branch = master php: 7.4 before_script: - curl -O https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.0.0-rc/phpDocumentor.phar From 8ea48ecb40eb70bff9e771b1a1ced72299f3de14 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Mon, 27 Apr 2020 18:33:44 +0900 Subject: [PATCH 32/38] Run code style and coverage with PHP 7.4 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a9b8c84a..d357904a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,13 +24,13 @@ jobs: include: - stage: Code style - php: 7.2 + php: 7.4 script: - ./vendor/bin/php-cs-fixer fix --diff --verbose --dry-run - ./vendor/bin/phpcs --report-width=200 samples/ src/ tests/ --ignore=samples/Header.php --standard=PSR2 -n - stage: Coverage - php: 7.2 + php: 7.4 script: - pecl install pcov - composer require pcov/clobber --dev From 03c587fe0b3164ffeb850e82936fad78ebbb980a Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Mon, 27 Apr 2020 18:42:32 +0900 Subject: [PATCH 33/38] Drop PHP 7.1 This is according to our formal, published, policy to only support eol PHP after 6 months. See https://phpspreadsheet.readthedocs.io/en/latest/#php-version-support --- .travis.yml | 1 - CHANGELOG.md | 6 ++++++ composer.json | 4 ++-- composer.lock | 4 ++-- docs/index.md | 5 +++-- samples/index.php | 2 +- src/PhpSpreadsheet/Settings.php | 4 ---- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index d357904a..f4abffd1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: php dist: bionic php: - - 7.1 - 7.2 - 7.3 - 7.4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 897a8e51..0f5c002c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com) and this project adheres to [Semantic Versioning](https://semver.org). +## [Unreleased] + +### Changed + +- Drop support for PHP 7.1, according to https://phpspreadsheet.readthedocs.io/en/latest/#php-version-support + ## [1.12.0] - 2020-04-27 ### Added diff --git a/composer.json b/composer.json index cfff1cb1..52a6466c 100644 --- a/composer.json +++ b/composer.json @@ -35,11 +35,11 @@ "php-cs-fixer fix --ansi" ], "versions": [ - "phpcs --report-width=200 samples/ src/ tests/ --ignore=samples/Header.php --standard=PHPCompatibility --runtime-set testVersion 7.1- -n" + "phpcs --report-width=200 samples/ src/ tests/ --ignore=samples/Header.php --standard=PHPCompatibility --runtime-set testVersion 7.2- -n" ] }, "require": { - "php": "^7.1", + "php": "^7.2", "ext-ctype": "*", "ext-dom": "*", "ext-gd": "*", diff --git a/composer.lock b/composer.lock index 9299919f..182d5832 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0fd32acfbb0d21f168f495840ffc8d7e", + "content-hash": "83ef345a065e12287e792d660b49619b", "packages": [ { "name": "markbaker/complex", @@ -3484,7 +3484,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.1", + "php": "^7.2", "ext-ctype": "*", "ext-dom": "*", "ext-gd": "*", diff --git a/docs/index.md b/docs/index.md index e7bb4660..808fb759 100644 --- a/docs/index.md +++ b/docs/index.md @@ -25,13 +25,14 @@ spreadsheet file formats, like Excel and LibreOffice Calc. ## Software requirements -PHP version 7.1 or newer to develop using PhpSpreadsheet. Other requirements, such as PHP extensions, are enforced by +PHP version 7.2 or newer to develop using PhpSpreadsheet. Other requirements, such as PHP extensions, are enforced by composer. See the `require` section of [the composer.json file](https://github.com/PHPOffice/PhpSpreadsheet/blob/master/composer.json) for details. ### PHP version support -Support for PHP versions will only be maintained for a period of six months beyond the end-of-life of that PHP version +Support for PHP versions will only be maintained for a period of six months beyond the +[end of life of that PHP version](https://www.php.net/eol.php). ## Installation diff --git a/samples/index.php b/samples/index.php index 598caef4..b0b75434 100644 --- a/samples/index.php +++ b/samples/index.php @@ -3,7 +3,7 @@ require_once 'Header.php'; $requirements = [ - 'PHP 7.1.0' => version_compare(PHP_VERSION, '7.1.0', '>='), + 'PHP 7.2.0' => version_compare(PHP_VERSION, '7.2.0', '>='), 'PHP extension XML' => extension_loaded('xml'), 'PHP extension xmlwriter' => extension_loaded('xmlwriter'), 'PHP extension mbstring' => extension_loaded('mbstring'), diff --git a/src/PhpSpreadsheet/Settings.php b/src/PhpSpreadsheet/Settings.php index 03fa6ac2..d9d74cb0 100644 --- a/src/PhpSpreadsheet/Settings.php +++ b/src/PhpSpreadsheet/Settings.php @@ -28,8 +28,6 @@ class Settings * Allow/disallow libxml_disable_entity_loader() call when not thread safe. * Default behaviour is to do the check, but if you're running PHP versions * 7.2 < 7.2.1 - * 7.1 < 7.1.13 - * 7.0 < 7.0.27 * then you may need to disable this check to prevent unwanted behaviour in other threads * SECURITY WARNING: Changing this flag is not recommended. * @@ -119,8 +117,6 @@ class Settings * Allow/disallow libxml_disable_entity_loader() call when not thread safe. * Default behaviour is to do the check, but if you're running PHP versions * 7.2 < 7.2.1 - * 7.1 < 7.1.13 - * 7.0 < 7.0.27 * then you may need to disable this check to prevent unwanted behaviour in other threads * SECURITY WARNING: Changing this flag to false is not recommended. * From 973011921d63c2a004cd355a4999937443d169c4 Mon Sep 17 00:00:00 2001 From: Collie-IT <40590185+Collie-IT@users.noreply.github.com> Date: Mon, 27 Apr 2020 12:01:36 +0200 Subject: [PATCH 34/38] Add Missing Operator NOTBETWEEN (#1390) --- src/PhpSpreadsheet/Style/Conditional.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PhpSpreadsheet/Style/Conditional.php b/src/PhpSpreadsheet/Style/Conditional.php index ec8c858b..2b096a34 100644 --- a/src/PhpSpreadsheet/Style/Conditional.php +++ b/src/PhpSpreadsheet/Style/Conditional.php @@ -27,6 +27,7 @@ class Conditional implements IComparable const OPERATOR_CONTAINSTEXT = 'containsText'; const OPERATOR_NOTCONTAINS = 'notContains'; const OPERATOR_BETWEEN = 'between'; + const OPERATOR_NOTBETWEEN = 'notBetween'; /** * Condition type. From a7986520f999c4e4dad17c59ae07b8549079456a Mon Sep 17 00:00:00 2001 From: Gennadiy Litvinyuk Date: Mon, 27 Apr 2020 12:02:49 +0200 Subject: [PATCH 35/38] Removed unnecessary object creation. (#1430) --- samples/Basic/01_Simple.php | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/Basic/01_Simple.php b/samples/Basic/01_Simple.php index 89aca6d0..69309794 100644 --- a/samples/Basic/01_Simple.php +++ b/samples/Basic/01_Simple.php @@ -4,7 +4,6 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet; require __DIR__ . '/../Header.php'; -$spreadsheet = new Spreadsheet(); $helper->log('Create new Spreadsheet object'); $spreadsheet = new Spreadsheet(); From f1a019e49281891752f07d950e230678094bfea2 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Mon, 27 Apr 2020 19:28:36 +0900 Subject: [PATCH 36/38] Upgrad PHP deps --- composer.json | 4 +- composer.lock | 745 ++++++++++-------- .../Calculation/CalculationTest.php | 4 +- .../Calculation/FinancialTest.php | 72 +- .../Functions/DateTime/DateDifTest.php | 4 +- .../Functions/DateTime/DateTest.php | 7 +- .../Functions/DateTime/DateValueTest.php | 7 +- .../Functions/DateTime/DayTest.php | 6 +- .../Functions/DateTime/Days360Test.php | 4 +- .../Functions/DateTime/DaysTest.php | 4 +- .../Functions/DateTime/EDateTest.php | 7 +- .../Functions/DateTime/EoMonthTest.php | 7 +- .../Functions/DateTime/HourTest.php | 4 +- .../Functions/DateTime/IsoWeekNumTest.php | 4 +- .../Functions/DateTime/MinuteTest.php | 4 +- .../Functions/DateTime/MonthTest.php | 4 +- .../Functions/DateTime/NetworkDaysTest.php | 4 +- .../Functions/DateTime/SecondTest.php | 4 +- .../Functions/DateTime/TimeTest.php | 6 +- .../Functions/DateTime/TimeValueTest.php | 7 +- .../Functions/DateTime/WeekDayTest.php | 4 +- .../Functions/DateTime/WeekNumTest.php | 4 +- .../Functions/DateTime/WorkDayTest.php | 4 +- .../Functions/DateTime/YearFracTest.php | 4 +- .../Functions/DateTime/YearTest.php | 4 +- .../Functions/Engineering/BesselITest.php | 4 +- .../Functions/Engineering/BesselJTest.php | 4 +- .../Functions/Engineering/BesselKTest.php | 4 +- .../Functions/Engineering/BesselYTest.php | 4 +- .../Functions/Engineering/Bin2DecTest.php | 2 +- .../Functions/Engineering/Bin2HexTest.php | 2 +- .../Functions/Engineering/Bin2OctTest.php | 2 +- .../Functions/Engineering/BitAndTest.php | 2 +- .../Functions/Engineering/BitLShiftTest.php | 2 +- .../Functions/Engineering/BitOrTest.php | 2 +- .../Functions/Engineering/BitRShiftTest.php | 2 +- .../Functions/Engineering/BitXorTest.php | 2 +- .../Functions/Engineering/ComplexTest.php | 2 +- .../Functions/Engineering/ConvertUoMTest.php | 2 +- .../Functions/Engineering/Dec2BinTest.php | 2 +- .../Functions/Engineering/Dec2HexTest.php | 2 +- .../Functions/Engineering/Dec2OctTest.php | 2 +- .../Functions/Engineering/DeltaTest.php | 2 +- .../Functions/Engineering/ErfCTest.php | 5 +- .../Functions/Engineering/ErfPreciseTest.php | 5 +- .../Functions/Engineering/ErfTest.php | 5 +- .../Functions/Engineering/GeStepTest.php | 2 +- .../Functions/Engineering/Hex2BinTest.php | 2 +- .../Functions/Engineering/Hex2DecTest.php | 2 +- .../Functions/Engineering/Hex2OctTest.php | 2 +- .../Functions/Engineering/ImAbsTest.php | 4 +- .../Functions/Engineering/ImArgumentTest.php | 4 +- .../Functions/Engineering/ImConjugateTest.php | 4 +- .../Functions/Engineering/ImCosTest.php | 4 +- .../Functions/Engineering/ImCoshTest.php | 4 +- .../Functions/Engineering/ImCotTest.php | 4 +- .../Functions/Engineering/ImCscTest.php | 4 +- .../Functions/Engineering/ImCschTest.php | 4 +- .../Functions/Engineering/ImDivTest.php | 4 +- .../Functions/Engineering/ImExpTest.php | 4 +- .../Functions/Engineering/ImLnTest.php | 4 +- .../Functions/Engineering/ImLog10Test.php | 4 +- .../Functions/Engineering/ImLog2Test.php | 4 +- .../Functions/Engineering/ImPowerTest.php | 4 +- .../Functions/Engineering/ImProductTest.php | 4 +- .../Functions/Engineering/ImRealTest.php | 4 +- .../Functions/Engineering/ImSecTest.php | 4 +- .../Functions/Engineering/ImSechTest.php | 4 +- .../Functions/Engineering/ImSinTest.php | 4 +- .../Functions/Engineering/ImSinhTest.php | 4 +- .../Functions/Engineering/ImSqrtTest.php | 4 +- .../Functions/Engineering/ImSubTest.php | 4 +- .../Functions/Engineering/ImSumTest.php | 4 +- .../Functions/Engineering/ImTanTest.php | 4 +- .../Functions/Engineering/ImaginaryTest.php | 4 +- .../Functions/Engineering/Oct2BinTest.php | 2 +- .../Functions/Engineering/Oct2DecTest.php | 2 +- .../Functions/Engineering/Oct2HexTest.php | 2 +- .../Engineering/ParseComplexTest.php | 2 +- .../Functions/Financial/AccrintMTest.php | 4 +- .../Functions/Financial/AccrintTest.php | 4 +- .../Calculation/Functions/Logical/AndTest.php | 2 +- .../Functions/Logical/FalseTest.php | 2 +- .../Functions/Logical/IfErrorTest.php | 2 +- .../Functions/Logical/IfNaTest.php | 2 +- .../Calculation/Functions/Logical/IfTest.php | 2 +- .../Calculation/Functions/Logical/NotTest.php | 2 +- .../Calculation/Functions/Logical/OrTest.php | 2 +- .../Functions/Logical/SwitchTest.php | 2 +- .../Functions/Logical/TrueTest.php | 2 +- .../Calculation/Functions/Logical/XorTest.php | 2 +- .../Functions/LookupRef/ChooseTest.php | 2 +- .../Functions/LookupRef/ColumnsTest.php | 2 +- .../Functions/LookupRef/HLookupTest.php | 2 +- .../Functions/LookupRef/IndexTest.php | 2 +- .../Functions/LookupRef/LookupTest.php | 2 +- .../Functions/LookupRef/MatchTest.php | 2 +- .../Functions/LookupRef/RowsTest.php | 2 +- .../Functions/LookupRef/VLookupTest.php | 2 +- .../Functions/MathTrig/AcotTest.php | 4 +- .../Functions/MathTrig/AcothTest.php | 4 +- .../Functions/MathTrig/ArabicTest.php | 2 +- .../Functions/MathTrig/Atan2Test.php | 4 +- .../Functions/MathTrig/BaseTest.php | 2 +- .../Functions/MathTrig/CeilingTest.php | 4 +- .../Functions/MathTrig/CombinTest.php | 4 +- .../Functions/MathTrig/CotTest.php | 4 +- .../Functions/MathTrig/CothTest.php | 4 +- .../Functions/MathTrig/CscTest.php | 4 +- .../Functions/MathTrig/CschTest.php | 4 +- .../Functions/MathTrig/EvenTest.php | 4 +- .../Functions/MathTrig/FactDoubleTest.php | 4 +- .../Functions/MathTrig/FactTest.php | 4 +- .../Functions/MathTrig/FloorMathTest.php | 4 +- .../Functions/MathTrig/FloorPreciseTest.php | 4 +- .../Functions/MathTrig/FloorTest.php | 4 +- .../Functions/MathTrig/GcdTest.php | 4 +- .../Functions/MathTrig/IntTest.php | 2 +- .../Functions/MathTrig/LcmTest.php | 4 +- .../Functions/MathTrig/LogTest.php | 4 +- .../Functions/MathTrig/MInverseTest.php | 4 +- .../Functions/MathTrig/MMultTest.php | 4 +- .../Functions/MathTrig/MRoundTest.php | 4 +- .../Functions/MathTrig/MdeTermTest.php | 4 +- .../Functions/MathTrig/ModTest.php | 4 +- .../Functions/MathTrig/MultinomialTest.php | 4 +- .../Functions/MathTrig/OddTest.php | 4 +- .../Functions/MathTrig/PowerTest.php | 4 +- .../Functions/MathTrig/ProductTest.php | 4 +- .../Functions/MathTrig/QuotientTest.php | 4 +- .../Functions/MathTrig/RomanTest.php | 2 +- .../Functions/MathTrig/RoundDownTest.php | 4 +- .../Functions/MathTrig/RoundUpTest.php | 4 +- .../Functions/MathTrig/SecTest.php | 4 +- .../Functions/MathTrig/SechTest.php | 4 +- .../Functions/MathTrig/SeriesSumTest.php | 4 +- .../Functions/MathTrig/SignTest.php | 4 +- .../Functions/MathTrig/SqrtPiTest.php | 4 +- .../Functions/MathTrig/SubTotalTest.php | 8 +- .../Functions/MathTrig/SumIfTest.php | 4 +- .../Functions/MathTrig/SumIfsTest.php | 4 +- .../Functions/MathTrig/SumProductTest.php | 4 +- .../Functions/MathTrig/SumSqTest.php | 4 +- .../Functions/MathTrig/SumX2MY2Test.php | 4 +- .../Functions/MathTrig/SumX2PY2Test.php | 4 +- .../Functions/MathTrig/SumXMY2Test.php | 4 +- .../Functions/MathTrig/TruncTest.php | 4 +- .../Functions/Statistical/AveDevTest.php | 4 +- .../Functions/Statistical/AverageATest.php | 4 +- .../Functions/Statistical/AverageIfTest.php | 4 +- .../Functions/Statistical/AverageTest.php | 4 +- .../Functions/Statistical/BetaDistTest.php | 4 +- .../Functions/Statistical/BetaInvTest.php | 4 +- .../Functions/Statistical/BinomDistTest.php | 4 +- .../Functions/Statistical/ChiDistTest.php | 4 +- .../Functions/Statistical/ChiInvTest.php | 4 +- .../Functions/Statistical/ConfidenceTest.php | 4 +- .../Functions/Statistical/CorrelTest.php | 4 +- .../Functions/Statistical/CountATest.php | 4 +- .../Functions/Statistical/CountBlankTest.php | 4 +- .../Functions/Statistical/CountIfTest.php | 4 +- .../Functions/Statistical/CountIfsTest.php | 4 +- .../Functions/Statistical/CountTest.php | 10 +- .../Functions/Statistical/CovarTest.php | 4 +- .../Functions/Statistical/ExponDistTest.php | 4 +- .../Functions/Statistical/FisherInvTest.php | 4 +- .../Functions/Statistical/FisherTest.php | 4 +- .../Functions/Statistical/ForecastTest.php | 4 +- .../Functions/Statistical/GammaDistTest.php | 4 +- .../Functions/Statistical/GammaInvTest.php | 4 +- .../Functions/Statistical/GammaLnTest.php | 4 +- .../Functions/Statistical/GeoMeanTest.php | 4 +- .../Functions/Statistical/HarMeanTest.php | 4 +- .../Functions/Statistical/InterceptTest.php | 4 +- .../Functions/Statistical/MaxIfsTest.php | 4 +- .../Functions/Statistical/MedianTest.php | 4 +- .../Functions/Statistical/MinIfsTest.php | 4 +- .../Functions/Statistical/PermutTest.php | 4 +- .../Functions/Statistical/RsqTest.php | 4 +- .../Functions/Statistical/SlopeTest.php | 4 +- .../Functions/Statistical/SteyxTest.php | 4 +- .../Functions/TextData/CharTest.php | 4 +- .../Functions/TextData/CleanTest.php | 4 +- .../Functions/TextData/CodeTest.php | 4 +- .../Functions/TextData/ConcatenateTest.php | 4 +- .../Functions/TextData/DollarTest.php | 4 +- .../Functions/TextData/ExactTest.php | 4 +- .../Functions/TextData/FindTest.php | 4 +- .../Functions/TextData/FixedTest.php | 4 +- .../Functions/TextData/LeftTest.php | 4 +- .../Functions/TextData/LenTest.php | 4 +- .../Functions/TextData/LowerTest.php | 4 +- .../Functions/TextData/MidTest.php | 4 +- .../Functions/TextData/NumberValueTest.php | 4 +- .../Functions/TextData/ProperTest.php | 4 +- .../Functions/TextData/ReplaceTest.php | 4 +- .../Functions/TextData/RightTest.php | 4 +- .../Functions/TextData/SearchTest.php | 4 +- .../Functions/TextData/SubstituteTest.php | 4 +- .../Calculation/Functions/TextData/TTest.php | 4 +- .../Functions/TextData/TextJoinTest.php | 4 +- .../Functions/TextData/TextTest.php | 4 +- .../Functions/TextData/TrimTest.php | 4 +- .../Functions/TextData/UpperTest.php | 4 +- .../Functions/TextData/ValueTest.php | 6 +- .../Calculation/FunctionsTest.php | 32 +- .../Calculation/LookupRefTest.php | 4 +- .../PhpSpreadsheetTests/Helper/SampleTest.php | 12 - tests/PhpSpreadsheetTests/Reader/HtmlTest.php | 12 +- .../Reader/Security/XmlScannerTest.php | 2 +- .../PhpSpreadsheetTests/Reader/Xlsx2Test.php | 2 +- tests/PhpSpreadsheetTests/Reader/XlsxTest.php | 3 - .../ReferenceHelperTest.php | 2 +- tests/PhpSpreadsheetTests/SettingsTest.php | 4 +- tests/PhpSpreadsheetTests/Shared/DateTest.php | 8 +- .../Shared/StringHelperTest.php | 2 +- tests/PhpSpreadsheetTests/SpreadsheetTest.php | 2 +- .../Style/NumberFormatTest.php | 2 +- .../Worksheet/AutoFilter/Column/RuleTest.php | 2 +- .../Worksheet/AutoFilter/ColumnTest.php | 2 +- .../Worksheet/AutoFilterTest.php | 2 +- .../Worksheet/ColumnCellIteratorTest.php | 2 +- .../Worksheet/ColumnIteratorTest.php | 2 +- .../Worksheet/ColumnTest.php | 2 +- .../Worksheet/RowCellIteratorTest.php | 2 +- .../Worksheet/RowIteratorTest.php | 2 +- .../PhpSpreadsheetTests/Worksheet/RowTest.php | 2 +- .../Writer/Ods/ContentTest.php | 6 +- .../Writer/Xls/FormulaErrTest.php | 4 +- .../Writer/Xls/WorkbookTest.php | 4 +- .../Writer/Xlsx/LocaleFloatsTest.php | 4 +- .../Writer/Xlsx/UnparsedDataTest.php | 16 +- 232 files changed, 901 insertions(+), 813 deletions(-) diff --git a/composer.json b/composer.json index 52a6466c..b3be69b0 100644 --- a/composer.json +++ b/composer.json @@ -58,12 +58,12 @@ "psr/simple-cache": "^1.0" }, "require-dev": { - "dompdf/dompdf": "^0.8.3", + "dompdf/dompdf": "^0.8.5", "friendsofphp/php-cs-fixer": "^2.16", "jpgraph/jpgraph": "^4.0", "mpdf/mpdf": "^8.0", "phpcompatibility/php-compatibility": "^9.3", - "phpunit/phpunit": "^7.5", + "phpunit/phpunit": "^8.5", "squizlabs/php_codesniffer": "^3.5", "tecnickcom/tcpdf": "^6.3" }, diff --git a/composer.lock b/composer.lock index 182d5832..0575eefe 100644 --- a/composer.lock +++ b/composer.lock @@ -4,34 +4,34 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "83ef345a065e12287e792d660b49619b", + "content-hash": "9c60146d8c78c13d2610a2cec23339a2", "packages": [ { "name": "markbaker/complex", - "version": "1.4.7", + "version": "1.4.8", "source": { "type": "git", "url": "https://github.com/MarkBaker/PHPComplex.git", - "reference": "1ea674a8308baf547cbcbd30c5fcd6d301b7c000" + "reference": "8eaa40cceec7bf0518187530b2e63871be661b72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/1ea674a8308baf547cbcbd30c5fcd6d301b7c000", - "reference": "1ea674a8308baf547cbcbd30c5fcd6d301b7c000", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/8eaa40cceec7bf0518187530b2e63871be661b72", + "reference": "8eaa40cceec7bf0518187530b2e63871be661b72", "shasum": "" }, "require": { "php": "^5.6.0|^7.0.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3", - "phpcompatibility/php-compatibility": "^8.0", + "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", + "phpcompatibility/php-compatibility": "^9.0", "phpdocumentor/phpdocumentor": "2.*", "phploc/phploc": "2.*", "phpmd/phpmd": "2.*", "phpunit/phpunit": "^4.8.35|^5.4.0", "sebastian/phpcpd": "2.*", - "squizlabs/php_codesniffer": "^3.3.0" + "squizlabs/php_codesniffer": "^3.4.0" }, "type": "library", "autoload": { @@ -99,7 +99,7 @@ "complex", "mathematics" ], - "time": "2018-10-13T23:28:42+00:00" + "time": "2020-03-11T20:15:49+00:00" }, { "name": "markbaker/matrix", @@ -222,24 +222,23 @@ "packages-dev": [ { "name": "composer/semver", - "version": "1.5.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e" + "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/46d9139568ccb8d9e7cdd4539cab7347568a5e2e", - "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e", + "url": "https://api.github.com/repos/composer/semver/zipball/c6bea70230ef4dd483e6bbcab6005f682ed3a8de", + "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", - "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + "phpunit/phpunit": "^4.5 || ^5.0.5" }, "type": "library", "extra": { @@ -280,20 +279,20 @@ "validation", "versioning" ], - "time": "2019-03-19T17:25:45+00:00" + "time": "2020-01-13T12:06:48+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "cbe23383749496fe0f373345208b79568e4bc248" + "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/cbe23383749496fe0f373345208b79568e4bc248", - "reference": "cbe23383749496fe0f373345208b79568e4bc248", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/1ab9842d69e64fb3a01be6b656501032d1b78cb7", + "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7", "shasum": "" }, "require": { @@ -324,24 +323,25 @@ "Xdebug", "performance" ], - "time": "2019-11-06T16:40:04+00:00" + "time": "2020-03-01T12:26:26+00:00" }, { "name": "doctrine/annotations", - "version": "v1.8.0", + "version": "1.10.2", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc" + "reference": "b9d758e831c70751155c698c2f7df4665314a1cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/904dca4eb10715b92569fbcd79e201d5c349b6bc", - "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/b9d758e831c70751155c698c2f7df4665314a1cb", + "reference": "b9d758e831c70751155c698c2f7df4665314a1cb", "shasum": "" }, "require": { "doctrine/lexer": "1.*", + "ext-tokenizer": "*", "php": "^7.1" }, "require-dev": { @@ -351,7 +351,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.9.x-dev" } }, "autoload": { @@ -392,20 +392,20 @@ "docblock", "parser" ], - "time": "2019-10-01T18:55:10+00:00" + "time": "2020-04-20T09:18:32+00:00" }, { "name": "doctrine/instantiator", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "a2c590166b2133a4633738648b6b064edae0814a" + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a", - "reference": "a2c590166b2133a4633738648b6b064edae0814a", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", "shasum": "" }, "require": { @@ -448,32 +448,34 @@ "constructor", "instantiate" ], - "time": "2019-03-17T17:37:11+00:00" + "time": "2019-10-21T16:45:58+00:00" }, { "name": "doctrine/lexer", - "version": "1.0.2", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8" + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8", - "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^7.2" }, "require-dev": { - "phpunit/phpunit": "^4.5" + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan": "^0.11.8", + "phpunit/phpunit": "^8.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -486,14 +488,14 @@ "MIT" ], "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, { "name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com" }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" @@ -508,32 +510,32 @@ "parser", "php" ], - "time": "2019-06-08T11:03:04+00:00" + "time": "2019-10-30T14:39:59+00:00" }, { "name": "dompdf/dompdf", - "version": "v0.8.3", + "version": "v0.8.5", "source": { "type": "git", "url": "https://github.com/dompdf/dompdf.git", - "reference": "75f13c700009be21a1965dc2c5b68a8708c22ba2" + "reference": "6782abfc090b132134cd6cea0ec6d76f0fce2c56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dompdf/dompdf/zipball/75f13c700009be21a1965dc2c5b68a8708c22ba2", - "reference": "75f13c700009be21a1965dc2c5b68a8708c22ba2", + "url": "https://api.github.com/repos/dompdf/dompdf/zipball/6782abfc090b132134cd6cea0ec6d76f0fce2c56", + "reference": "6782abfc090b132134cd6cea0ec6d76f0fce2c56", "shasum": "" }, "require": { "ext-dom": "*", "ext-mbstring": "*", - "phenx/php-font-lib": "0.5.*", - "phenx/php-svg-lib": "0.3.*", - "php": ">=5.4.0" + "phenx/php-font-lib": "^0.5.1", + "phenx/php-svg-lib": "^0.3.3", + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8|^5.5|^6.5", - "squizlabs/php_codesniffer": "2.*" + "phpunit/phpunit": "^7.5", + "squizlabs/php_codesniffer": "^3.5" }, "suggest": { "ext-gd": "Needed to process images", @@ -574,20 +576,20 @@ ], "description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter", "homepage": "https://github.com/dompdf/dompdf", - "time": "2018-12-14T02:40:31+00:00" + "time": "2020-02-20T03:52:51+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.16.1", + "version": "v2.16.3", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "c8afb599858876e95e8ebfcd97812d383fa23f02" + "reference": "83baf823a33a1cbd5416c8626935cf3f843c10b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/c8afb599858876e95e8ebfcd97812d383fa23f02", - "reference": "c8afb599858876e95e8ebfcd97812d383fa23f02", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/83baf823a33a1cbd5416c8626935cf3f843c10b0", + "reference": "83baf823a33a1cbd5416c8626935cf3f843c10b0", "shasum": "" }, "require": { @@ -623,6 +625,7 @@ "symfony/yaml": "^3.0 || ^4.0 || ^5.0" }, "suggest": { + "ext-dom": "For handling output formats in XML", "ext-mbstring": "For handling non-UTF8 characters in cache signature.", "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", @@ -645,6 +648,7 @@ "tests/Test/IntegrationCaseFactory.php", "tests/Test/IntegrationCaseFactoryInterface.php", "tests/Test/InternalIntegrationCaseFactory.php", + "tests/Test/IsIdenticalConstraint.php", "tests/TestCase.php" ] }, @@ -663,7 +667,7 @@ } ], "description": "A tool to automatically fix PHP code style", - "time": "2019-11-25T22:10:32+00:00" + "time": "2020-04-15T18:51:10+00:00" }, { "name": "jpgraph/jpgraph", @@ -707,16 +711,16 @@ }, { "name": "mpdf/mpdf", - "version": "v8.0.4", + "version": "v8.0.5", "source": { "type": "git", "url": "https://github.com/mpdf/mpdf.git", - "reference": "d3147a0d790b6d11936fd9c73fa31a7ed45e3f6f" + "reference": "bad32aa9cd5958175aef185c02e032ddbadc56ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mpdf/mpdf/zipball/d3147a0d790b6d11936fd9c73fa31a7ed45e3f6f", - "reference": "d3147a0d790b6d11936fd9c73fa31a7ed45e3f6f", + "url": "https://api.github.com/repos/mpdf/mpdf/zipball/bad32aa9cd5958175aef185c02e032ddbadc56ea", + "reference": "bad32aa9cd5958175aef185c02e032ddbadc56ea", "shasum": "" }, "require": { @@ -772,20 +776,20 @@ "php", "utf-8" ], - "time": "2019-11-28T09:39:33+00:00" + "time": "2020-02-05T08:43:46+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.9.3", + "version": "1.9.5", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", "shasum": "" }, "require": { @@ -820,7 +824,7 @@ "object", "object graph" ], - "time": "2019-08-09T12:45:53+00:00" + "time": "2020-01-17T21:11:47+00:00" }, { "name": "paragonie/random_compat", @@ -971,20 +975,20 @@ }, { "name": "phenx/php-font-lib", - "version": "0.5.1", + "version": "0.5.2", "source": { "type": "git", "url": "https://github.com/PhenX/php-font-lib.git", - "reference": "760148820110a1ae0936e5cc35851e25a938bc97" + "reference": "ca6ad461f032145fff5971b5985e5af9e7fa88d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PhenX/php-font-lib/zipball/760148820110a1ae0936e5cc35851e25a938bc97", - "reference": "760148820110a1ae0936e5cc35851e25a938bc97", + "url": "https://api.github.com/repos/PhenX/php-font-lib/zipball/ca6ad461f032145fff5971b5985e5af9e7fa88d8", + "reference": "ca6ad461f032145fff5971b5985e5af9e7fa88d8", "shasum": "" }, "require-dev": { - "phpunit/phpunit": "^4.8" + "phpunit/phpunit": "^4.8.35 || ^5 || ^6 || ^7" }, "type": "library", "autoload": { @@ -1004,7 +1008,7 @@ ], "description": "A library to read, parse, export and make subsets of different types of font files.", "homepage": "https://github.com/PhenX/php-font-lib", - "time": "2017-09-13T16:14:37+00:00" + "time": "2020-03-08T15:31:32+00:00" }, { "name": "phenx/php-svg-lib", @@ -1099,16 +1103,16 @@ }, { "name": "phpcompatibility/php-compatibility", - "version": "9.3.2", + "version": "9.3.5", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "bfca2be3992f40e92206e5a7ebe5eaee37280b58" + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/bfca2be3992f40e92206e5a7ebe5eaee37280b58", - "reference": "bfca2be3992f40e92206e5a7ebe5eaee37280b58", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", "shasum": "" }, "require": { @@ -1153,28 +1157,25 @@ "phpcs", "standards" ], - "time": "2019-10-16T21:24:24+00:00" + "time": "2019-12-27T09:44:58+00:00" }, { "name": "phpdocumentor/reflection-common", - "version": "2.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" + "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/6568f4687e5b41b054365f9ae03fcb1ed5f2069b", + "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b", "shasum": "" }, "require": { "php": ">=7.1" }, - "require-dev": { - "phpunit/phpunit": "~6" - }, "type": "library", "extra": { "branch-alias": { @@ -1205,44 +1206,42 @@ "reflection", "static analysis" ], - "time": "2018-08-07T13:53:10+00:00" + "time": "2020-04-27T09:25:28+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.2", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e" + "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", + "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", "shasum": "" }, "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", - "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", - "webmozart/assert": "^1.0" + "ext-filter": "^7.1", + "php": "^7.2", + "phpdocumentor/reflection-common": "^2.0", + "phpdocumentor/type-resolver": "^1.0", + "webmozart/assert": "^1" }, "require-dev": { - "doctrine/instantiator": "^1.0.5", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" + "doctrine/instantiator": "^1", + "mockery/mockery": "^1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-master": "5.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1253,33 +1252,36 @@ { "name": "Mike van Riel", "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-09-12T14:27:41+00:00" + "time": "2020-02-22T12:28:44+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.0.1", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" + "reference": "7462d5f123dfc080dfdf26897032a6513644fc95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95", + "reference": "7462d5f123dfc080dfdf26897032a6513644fc95", "shasum": "" }, "require": { - "php": "^7.1", + "php": "^7.2", "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "^7.1", - "mockery/mockery": "~1", - "phpunit/phpunit": "^7.0" + "ext-tokenizer": "^7.2", + "mockery/mockery": "~1" }, "type": "library", "extra": { @@ -1303,37 +1305,37 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2019-08-22T18:11:29+00:00" + "time": "2020-02-18T18:59:58+00:00" }, { "name": "phpspec/prophecy", - "version": "1.9.0", + "version": "v1.10.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" + "reference": "451c3cd1418cf640de218914901e51b064abb093" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", + "reference": "451c3cd1418cf640de218914901e51b064abb093", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" }, "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", + "phpspec/phpspec": "^2.5 || ^3.2", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-master": "1.10.x-dev" } }, "autoload": { @@ -1366,44 +1368,44 @@ "spy", "stub" ], - "time": "2019-10-03T11:07:50+00:00" + "time": "2020-03-05T15:02:03+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "6.1.4", + "version": "7.0.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f1884187926fbb755a9aaf0b3836ad3165b478bf", + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.1", - "phpunit/php-file-iterator": "^2.0", + "php": "^7.2", + "phpunit/php-file-iterator": "^2.0.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.0", + "phpunit/php-token-stream": "^3.1.1", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.1 || ^4.0", + "sebastian/environment": "^4.2.2", "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" + "theseer/tokenizer": "^1.1.3" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^8.2.2" }, "suggest": { - "ext-xdebug": "^2.6.0" + "ext-xdebug": "^2.7.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.1-dev" + "dev-master": "7.0-dev" } }, "autoload": { @@ -1429,7 +1431,7 @@ "testing", "xunit" ], - "time": "2018-10-31T16:06:48+00:00" + "time": "2019-11-20T13:55:58+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1622,53 +1624,52 @@ }, { "name": "phpunit/phpunit", - "version": "7.5.17", + "version": "8.5.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "4c92a15296e58191a4cd74cff3b34fc8e374174a" + "reference": "8474e22d7d642f665084ba5ec780626cbd1efd23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4c92a15296e58191a4cd74cff3b34fc8e374174a", - "reference": "4c92a15296e58191a4cd74cff3b34fc8e374174a", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8474e22d7d642f665084ba5ec780626cbd1efd23", + "reference": "8474e22d7d642f665084ba5ec780626cbd1efd23", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.1", + "doctrine/instantiator": "^1.2.0", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.7", - "phar-io/manifest": "^1.0.2", - "phar-io/version": "^2.0", - "php": "^7.1", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0.7", - "phpunit/php-file-iterator": "^2.0.1", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.9.1", + "phar-io/manifest": "^1.0.3", + "phar-io/version": "^2.0.1", + "php": "^7.2", + "phpspec/prophecy": "^1.8.1", + "phpunit/php-code-coverage": "^7.0.7", + "phpunit/php-file-iterator": "^2.0.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1", - "sebastian/comparator": "^3.0", - "sebastian/diff": "^3.0", - "sebastian/environment": "^4.0", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", + "phpunit/php-timer": "^2.1.2", + "sebastian/comparator": "^3.0.2", + "sebastian/diff": "^3.0.2", + "sebastian/environment": "^4.2.2", + "sebastian/exporter": "^3.1.1", + "sebastian/global-state": "^3.0.0", "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0", + "sebastian/resource-operations": "^2.0.1", + "sebastian/type": "^1.1.3", "sebastian/version": "^2.0.1" }, - "conflict": { - "phpunit/phpunit-mock-objects": "*" - }, "require-dev": { "ext-pdo": "*" }, "suggest": { "ext-soap": "*", "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0" + "phpunit/php-invoker": "^2.0.0" }, "bin": [ "phpunit" @@ -1676,7 +1677,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.5-dev" + "dev-master": "8.5-dev" } }, "autoload": { @@ -1702,7 +1703,7 @@ "testing", "xunit" ], - "time": "2019-10-28T10:37:36+00:00" + "time": "2020-04-23T04:39:42+00:00" }, { "name": "psr/container", @@ -1754,17 +1755,63 @@ "time": "2017-02-14T16:28:37+00:00" }, { - "name": "psr/log", - "version": "1.1.2", + "name": "psr/event-dispatcher", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", - "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", "shasum": "" }, "require": { @@ -1798,7 +1845,7 @@ "psr", "psr-3" ], - "time": "2019-11-01T11:05:21+00:00" + "time": "2020-03-23T09:12:05+00:00" }, { "name": "sabberworm/php-css-parser", @@ -2012,16 +2059,16 @@ }, { "name": "sebastian/environment", - "version": "4.2.2", + "version": "4.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404" + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/f2a2c8e1c97c11ace607a7a667d73d47c19fe404", - "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", "shasum": "" }, "require": { @@ -2061,7 +2108,7 @@ "environment", "hhvm" ], - "time": "2019-05-05T09:05:15+00:00" + "time": "2019-11-20T08:46:58+00:00" }, { "name": "sebastian/exporter", @@ -2132,23 +2179,26 @@ }, { "name": "sebastian/global-state", - "version": "2.0.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", + "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.2", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "ext-dom": "*", + "phpunit/phpunit": "^8.0" }, "suggest": { "ext-uopz": "*" @@ -2156,7 +2206,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2179,7 +2229,7 @@ "keywords": [ "global state" ], - "time": "2017-04-27T15:39:26+00:00" + "time": "2019-02-01T05:30:01+00:00" }, { "name": "sebastian/object-enumerator", @@ -2368,6 +2418,52 @@ "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "time": "2018-10-04T04:07:39+00:00" }, + { + "name": "sebastian/type", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/3aaaa15fa71d27650d62a948be022fe3b48541a3", + "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3", + "shasum": "" + }, + "require": { + "php": "^7.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "time": "2019-07-02T08:10:15+00:00" + }, { "name": "sebastian/version", "version": "2.0.1", @@ -2413,33 +2509,33 @@ }, { "name": "setasign/fpdi", - "version": "v2.2.0", + "version": "v2.3.2", "source": { "type": "git", "url": "https://github.com/Setasign/FPDI.git", - "reference": "3c266002f8044f61b17329f7cd702d44d73f0f7f" + "reference": "527761458f504882ab844f15754523825647f291" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Setasign/FPDI/zipball/3c266002f8044f61b17329f7cd702d44d73f0f7f", - "reference": "3c266002f8044f61b17329f7cd702d44d73f0f7f", + "url": "https://api.github.com/repos/Setasign/FPDI/zipball/527761458f504882ab844f15754523825647f291", + "reference": "527761458f504882ab844f15754523825647f291", "shasum": "" }, "require": { "ext-zlib": "*", "php": "^5.6 || ^7.0" }, + "conflict": { + "setasign/tfpdf": "<1.31" + }, "require-dev": { "phpunit/phpunit": "~5.7", "setasign/fpdf": "~1.8", - "setasign/tfpdf": "1.25", + "setasign/tfpdf": "1.31", "tecnickcom/tcpdf": "~6.2" }, "suggest": { - "setasign/fpdf": "FPDI will extend this class but as it is also possible to use TCPDF or tFPDF as an alternative. There's no fixed dependency configured.", - "setasign/fpdi-fpdf": "Use this package to automatically evaluate dependencies to FPDF.", - "setasign/fpdi-tcpdf": "Use this package to automatically evaluate dependencies to TCPDF.", - "setasign/fpdi-tfpdf": "Use this package to automatically evaluate dependencies to tFPDF." + "setasign/fpdf": "FPDI will extend this class but as it is also possible to use TCPDF or tFPDF as an alternative. There's no fixed dependency configured." }, "type": "library", "autoload": { @@ -2470,20 +2566,20 @@ "fpdi", "pdf" ], - "time": "2019-01-30T14:11:19+00:00" + "time": "2020-03-23T15:53:59+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.2", + "version": "3.5.5", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7" + "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/65b12cdeaaa6cd276d4c3033a95b9b88b12701e7", - "reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/73e2e7f57d958e7228fce50dc0c61f58f017f9f6", + "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6", "shasum": "" }, "require": { @@ -2521,44 +2617,45 @@ "phpcs", "standards" ], - "time": "2019-10-28T04:36:32+00:00" + "time": "2020-04-17T01:09:41+00:00" }, { "name": "symfony/console", - "version": "v4.3.6", + "version": "v5.0.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "136c4bd62ea871d00843d1bc0316de4c4a84bb78" + "reference": "5fa1caadc8cdaa17bcfb25219f3b53fe294a9935" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/136c4bd62ea871d00843d1bc0316de4c4a84bb78", - "reference": "136c4bd62ea871d00843d1bc0316de4c4a84bb78", + "url": "https://api.github.com/repos/symfony/console/zipball/5fa1caadc8cdaa17bcfb25219f3b53fe294a9935", + "reference": "5fa1caadc8cdaa17bcfb25219f3b53fe294a9935", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^7.2.5", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", - "symfony/service-contracts": "^1.1" + "symfony/service-contracts": "^1.1|^2" }, "conflict": { - "symfony/dependency-injection": "<3.4", - "symfony/event-dispatcher": "<4.3", - "symfony/process": "<3.3" + "symfony/dependency-injection": "<4.4", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" }, "provide": { "psr/log-implementation": "1.0" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "^4.3", - "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.4|~4.0", - "symfony/var-dumper": "^4.3" + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" }, "suggest": { "psr/log": "For using the console logger", @@ -2569,7 +2666,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -2596,41 +2693,41 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-10-30T12:58:49+00:00" + "time": "2020-03-30T11:42:42+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.3.6", + "version": "v5.0.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "6229f58993e5a157f6096fc7145c0717d0be8807" + "reference": "24f40d95385774ed5c71dbf014edd047e2f2f3dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/6229f58993e5a157f6096fc7145c0717d0be8807", - "reference": "6229f58993e5a157f6096fc7145c0717d0be8807", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/24f40d95385774ed5c71dbf014edd047e2f2f3dc", + "reference": "24f40d95385774ed5c71dbf014edd047e2f2f3dc", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/event-dispatcher-contracts": "^1.1" + "php": "^7.2.5", + "symfony/event-dispatcher-contracts": "^2" }, "conflict": { - "symfony/dependency-injection": "<3.4" + "symfony/dependency-injection": "<4.4" }, "provide": { "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "1.1" + "symfony/event-dispatcher-implementation": "2.0" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/expression-language": "~3.4|~4.0", - "symfony/http-foundation": "^3.4|^4.0", - "symfony/service-contracts": "^1.1", - "symfony/stopwatch": "~3.4|~4.0" + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/expression-language": "^4.4|^5.0", + "symfony/http-foundation": "^4.4|^5.0", + "symfony/service-contracts": "^1.1|^2", + "symfony/stopwatch": "^4.4|^5.0" }, "suggest": { "symfony/dependency-injection": "", @@ -2639,7 +2736,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -2666,33 +2763,33 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2019-10-01T16:40:32+00:00" + "time": "2020-03-27T16:56:45+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v1.1.7", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "c43ab685673fb6c8d84220c77897b1d6cdbe1d18" + "reference": "af23c2584d4577d54661c434446fb8fbed6025dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/c43ab685673fb6c8d84220c77897b1d6cdbe1d18", - "reference": "c43ab685673fb6c8d84220c77897b1d6cdbe1d18", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/af23c2584d4577d54661c434446fb8fbed6025dd", + "reference": "af23c2584d4577d54661c434446fb8fbed6025dd", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.2.5", + "psr/event-dispatcher": "^1" }, "suggest": { - "psr/event-dispatcher": "", "symfony/event-dispatcher-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -2724,30 +2821,30 @@ "interoperability", "standards" ], - "time": "2019-09-17T09:54:03+00:00" + "time": "2019-11-18T17:27:11+00:00" }, { "name": "symfony/filesystem", - "version": "v4.3.6", + "version": "v5.0.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263" + "reference": "ca3b87dd09fff9b771731637f5379965fbfab420" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/9abbb7ef96a51f4d7e69627bc6f63307994e4263", - "reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/ca3b87dd09fff9b771731637f5379965fbfab420", + "reference": "ca3b87dd09fff9b771731637f5379965fbfab420", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^7.2.5", "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -2774,29 +2871,29 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2019-08-20T14:07:54+00:00" + "time": "2020-03-27T16:56:45+00:00" }, { "name": "symfony/finder", - "version": "v4.3.6", + "version": "v5.0.7", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "72a068f77e317ae77c0a0495236ad292cfb5ce6f" + "reference": "600a52c29afc0d1caa74acbec8d3095ca7e9910d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/72a068f77e317ae77c0a0495236ad292cfb5ce6f", - "reference": "72a068f77e317ae77c0a0495236ad292cfb5ce6f", + "url": "https://api.github.com/repos/symfony/finder/zipball/600a52c29afc0d1caa74acbec8d3095ca7e9910d", + "reference": "600a52c29afc0d1caa74acbec8d3095ca7e9910d", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.2.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -2823,29 +2920,29 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-10-30T12:53:54+00:00" + "time": "2020-03-27T16:56:45+00:00" }, { "name": "symfony/options-resolver", - "version": "v4.3.6", + "version": "v5.0.7", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "f46c7fc8e207bd8a2188f54f8738f232533765a4" + "reference": "09dccfffd24b311df7f184aa80ee7b61ad61ed8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/f46c7fc8e207bd8a2188f54f8738f232533765a4", - "reference": "f46c7fc8e207bd8a2188f54f8738f232533765a4", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/09dccfffd24b311df7f184aa80ee7b61ad61ed8d", + "reference": "09dccfffd24b311df7f184aa80ee7b61ad61ed8d", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.2.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -2877,20 +2974,20 @@ "configuration", "options" ], - "time": "2019-10-28T20:59:01+00:00" + "time": "2020-03-27T16:56:45+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.12.0", + "version": "v1.15.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/4719fa9c18b0464d399f1a63bf624b42b6fa8d14", + "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14", "shasum": "" }, "require": { @@ -2902,7 +2999,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.15-dev" } }, "autoload": { @@ -2935,20 +3032,20 @@ "polyfill", "portable" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2020-02-27T09:26:54+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.12.0", + "version": "v1.15.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" + "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/81ffd3a9c6d707be22e3012b827de1c9775fc5ac", + "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac", "shasum": "" }, "require": { @@ -2960,7 +3057,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.15-dev" } }, "autoload": { @@ -2994,20 +3091,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2020-03-09T19:04:49+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.12.0", + "version": "v1.15.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "54b4c428a0054e254223797d2713c31e08610831" + "reference": "2a18e37a489803559284416df58c71ccebe50bf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/54b4c428a0054e254223797d2713c31e08610831", - "reference": "54b4c428a0054e254223797d2713c31e08610831", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/2a18e37a489803559284416df58c71ccebe50bf0", + "reference": "2a18e37a489803559284416df58c71ccebe50bf0", "shasum": "" }, "require": { @@ -3017,7 +3114,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.15-dev" } }, "autoload": { @@ -3053,20 +3150,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2020-02-27T09:26:54+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.12.0", + "version": "v1.15.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "04ce3335667451138df4307d6a9b61565560199e" + "reference": "37b0976c78b94856543260ce09b460a7bc852747" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/04ce3335667451138df4307d6a9b61565560199e", - "reference": "04ce3335667451138df4307d6a9b61565560199e", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/37b0976c78b94856543260ce09b460a7bc852747", + "reference": "37b0976c78b94856543260ce09b460a7bc852747", "shasum": "" }, "require": { @@ -3075,7 +3172,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.15-dev" } }, "autoload": { @@ -3108,20 +3205,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2020-02-27T09:26:54+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.12.0", + "version": "v1.15.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188" + "reference": "0f27e9f464ea3da33cbe7ca3bdf4eb66def9d0f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/2ceb49eaccb9352bff54d22570276bb75ba4a188", - "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f27e9f464ea3da33cbe7ca3bdf4eb66def9d0f7", + "reference": "0f27e9f464ea3da33cbe7ca3bdf4eb66def9d0f7", "shasum": "" }, "require": { @@ -3130,7 +3227,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.15-dev" } }, "autoload": { @@ -3166,29 +3263,29 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2020-02-27T09:26:54+00:00" }, { "name": "symfony/process", - "version": "v4.3.6", + "version": "v5.0.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "3b2e0cb029afbb0395034509291f21191d1a4db0" + "reference": "c5ca4a0fc16a0c888067d43fbcfe1f8a53d8e70e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/3b2e0cb029afbb0395034509291f21191d1a4db0", - "reference": "3b2e0cb029afbb0395034509291f21191d1a4db0", + "url": "https://api.github.com/repos/symfony/process/zipball/c5ca4a0fc16a0c888067d43fbcfe1f8a53d8e70e", + "reference": "c5ca4a0fc16a0c888067d43fbcfe1f8a53d8e70e", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.2.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -3215,24 +3312,24 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-10-28T17:07:32+00:00" + "time": "2020-03-27T16:56:45+00:00" }, { "name": "symfony/service-contracts", - "version": "v1.1.8", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf" + "reference": "144c5e51266b281231e947b51223ba14acf1a749" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffc7f5692092df31515df2a5ecf3b7302b3ddacf", - "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", + "reference": "144c5e51266b281231e947b51223ba14acf1a749", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^7.2.5", "psr/container": "^1.0" }, "suggest": { @@ -3241,7 +3338,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -3273,30 +3370,30 @@ "interoperability", "standards" ], - "time": "2019-10-14T12:27:06+00:00" + "time": "2019-11-18T17:27:11+00:00" }, { "name": "symfony/stopwatch", - "version": "v4.3.6", + "version": "v5.0.7", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "1e4ff456bd625be5032fac9be4294e60442e9b71" + "reference": "a1d86d30d4522423afc998f32404efa34fcf5a73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/1e4ff456bd625be5032fac9be4294e60442e9b71", - "reference": "1e4ff456bd625be5032fac9be4294e60442e9b71", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/a1d86d30d4522423afc998f32404efa34fcf5a73", + "reference": "a1d86d30d4522423afc998f32404efa34fcf5a73", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/service-contracts": "^1.0" + "php": "^7.2.5", + "symfony/service-contracts": "^1.0|^2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -3323,20 +3420,20 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2019-08-07T11:52:19+00:00" + "time": "2020-03-27T16:56:45+00:00" }, { "name": "tecnickcom/tcpdf", - "version": "6.3.2", + "version": "6.3.5", "source": { "type": "git", "url": "https://github.com/tecnickcom/TCPDF.git", - "reference": "9fde7bb9b404b945e7ea88fb7eccd23d9a4e324b" + "reference": "19a535eaa7fb1c1cac499109deeb1a7a201b4549" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/9fde7bb9b404b945e7ea88fb7eccd23d9a4e324b", - "reference": "9fde7bb9b404b945e7ea88fb7eccd23d9a4e324b", + "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/19a535eaa7fb1c1cac499109deeb1a7a201b4549", + "reference": "19a535eaa7fb1c1cac499109deeb1a7a201b4549", "shasum": "" }, "require": { @@ -3365,7 +3462,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0" + "LGPL-3.0-only" ], "authors": [ { @@ -3385,7 +3482,7 @@ "pdf417", "qrcode" ], - "time": "2019-09-20T09:35:01+00:00" + "time": "2020-02-14T14:20:12+00:00" }, { "name": "theseer/tokenizer", @@ -3429,31 +3526,29 @@ }, { "name": "webmozart/assert", - "version": "1.5.0", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" + "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", + "url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6", + "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6", "shasum": "" }, "require": { "php": "^5.3.3 || ^7.0", "symfony/polyfill-ctype": "^1.8" }, + "conflict": { + "vimeo/psalm": "<3.9.1" + }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -3475,7 +3570,7 @@ "check", "validate" ], - "time": "2019-08-24T08:43:50+00:00" + "time": "2020-04-18T12:12:48+00:00" } ], "aliases": [], diff --git a/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php b/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php index 59b8cd0e..14cd993a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php @@ -9,12 +9,12 @@ use PHPUnit\Framework\TestCase; class CalculationTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } - public function tearDown() + protected function tearDown(): void { $calculation = Calculation::getInstance(); $calculation->setLocale('en_us'); diff --git a/tests/PhpSpreadsheetTests/Calculation/FinancialTest.php b/tests/PhpSpreadsheetTests/Calculation/FinancialTest.php index e9418454..27eb3d61 100644 --- a/tests/PhpSpreadsheetTests/Calculation/FinancialTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/FinancialTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class FinancialTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class FinancialTest extends TestCase public function testAMORDEGRC($expectedResult, ...$args) { $result = Financial::AMORDEGRC(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerAMORDEGRC() @@ -37,7 +37,7 @@ class FinancialTest extends TestCase public function testAMORLINC($expectedResult, ...$args) { $result = Financial::AMORLINC(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerAMORLINC() @@ -53,7 +53,7 @@ class FinancialTest extends TestCase public function testCOUPDAYBS($expectedResult, ...$args) { $result = Financial::COUPDAYBS(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerCOUPDAYBS() @@ -69,7 +69,7 @@ class FinancialTest extends TestCase public function testCOUPDAYS($expectedResult, ...$args) { $result = Financial::COUPDAYS(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerCOUPDAYS() @@ -85,7 +85,7 @@ class FinancialTest extends TestCase public function testCOUPDAYSNC($expectedResult, ...$args) { $result = Financial::COUPDAYSNC(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerCOUPDAYSNC() @@ -101,7 +101,7 @@ class FinancialTest extends TestCase public function testCOUPNCD($expectedResult, ...$args) { $result = Financial::COUPNCD(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerCOUPNCD() @@ -117,7 +117,7 @@ class FinancialTest extends TestCase public function testCOUPNUM($expectedResult, ...$args) { $result = Financial::COUPNUM(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerCOUPNUM() @@ -133,7 +133,7 @@ class FinancialTest extends TestCase public function testCOUPPCD($expectedResult, ...$args) { $result = Financial::COUPPCD(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerCOUPPCD() @@ -149,7 +149,7 @@ class FinancialTest extends TestCase public function testCUMIPMT($expectedResult, ...$args) { $result = Financial::CUMIPMT(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerCUMIPMT() @@ -165,7 +165,7 @@ class FinancialTest extends TestCase public function testCUMPRINC($expectedResult, ...$args) { $result = Financial::CUMPRINC(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerCUMPRINC() @@ -181,7 +181,7 @@ class FinancialTest extends TestCase public function testDB($expectedResult, ...$args) { $result = Financial::DB(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerDB() @@ -197,7 +197,7 @@ class FinancialTest extends TestCase public function testDDB($expectedResult, ...$args) { $result = Financial::DDB(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerDDB() @@ -213,7 +213,7 @@ class FinancialTest extends TestCase public function testDISC($expectedResult, ...$args) { $result = Financial::DISC(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerDISC() @@ -229,7 +229,7 @@ class FinancialTest extends TestCase public function testDOLLARDE($expectedResult, ...$args) { $result = Financial::DOLLARDE(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerDOLLARDE() @@ -245,7 +245,7 @@ class FinancialTest extends TestCase public function testDOLLARFR($expectedResult, ...$args) { $result = Financial::DOLLARFR(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerDOLLARFR() @@ -261,7 +261,7 @@ class FinancialTest extends TestCase public function testEFFECT($expectedResult, ...$args) { $result = Financial::EFFECT(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerEFFECT() @@ -277,7 +277,7 @@ class FinancialTest extends TestCase public function testFV($expectedResult, ...$args) { $result = Financial::FV(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerFV() @@ -293,7 +293,7 @@ class FinancialTest extends TestCase public function testFVSCHEDULE($expectedResult, ...$args) { $result = Financial::FVSCHEDULE(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerFVSCHEDULE() @@ -309,7 +309,7 @@ class FinancialTest extends TestCase public function testINTRATE($expectedResult, ...$args) { $result = Financial::INTRATE(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerINTRATE() @@ -325,7 +325,7 @@ class FinancialTest extends TestCase public function testIPMT($expectedResult, ...$args) { $result = Financial::IPMT(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerIPMT() @@ -341,7 +341,7 @@ class FinancialTest extends TestCase public function testIRR($expectedResult, ...$args) { $result = Financial::IRR(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerIRR() @@ -357,7 +357,7 @@ class FinancialTest extends TestCase public function testISPMT($expectedResult, ...$args) { $result = Financial::ISPMT(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerISPMT() @@ -373,7 +373,7 @@ class FinancialTest extends TestCase public function testMIRR($expectedResult, ...$args) { $result = Financial::MIRR(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerMIRR() @@ -389,7 +389,7 @@ class FinancialTest extends TestCase public function testNOMINAL($expectedResult, ...$args) { $result = Financial::NOMINAL(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerNOMINAL() @@ -405,7 +405,7 @@ class FinancialTest extends TestCase public function testNPER($expectedResult, ...$args) { $result = Financial::NPER(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerNPER() @@ -421,7 +421,7 @@ class FinancialTest extends TestCase public function testNPV($expectedResult, ...$args) { $result = Financial::NPV(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerNPV() @@ -439,7 +439,7 @@ class FinancialTest extends TestCase $this->markTestIncomplete('TODO: This test should be fixed'); $result = Financial::PRICE(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerPRICE() @@ -455,7 +455,7 @@ class FinancialTest extends TestCase public function testPRICEDISC($expectedResult, array $args) { $result = Financial::PRICEDISC(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerPRICEDISC() @@ -471,7 +471,7 @@ class FinancialTest extends TestCase public function testPV($expectedResult, array $args) { $result = Financial::PV(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerPV() @@ -489,7 +489,7 @@ class FinancialTest extends TestCase $this->markTestIncomplete('TODO: This test should be fixed'); $result = Financial::RATE(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerRATE() @@ -506,7 +506,7 @@ class FinancialTest extends TestCase public function testXIRR($expectedResult, $message, ...$args) { $result = Financial::XIRR(...$args); - self::assertEquals($expectedResult, $result, $message, Financial::FINANCIAL_PRECISION); + self::assertEqualsWithDelta($expectedResult, $result, Financial::FINANCIAL_PRECISION, $message); } public function providerXIRR() @@ -522,7 +522,7 @@ class FinancialTest extends TestCase public function testPDURATION($expectedResult, array $args) { $result = Financial::PDURATION(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerPDURATION() @@ -538,7 +538,7 @@ class FinancialTest extends TestCase public function testRRI($expectedResult, array $args) { $result = Financial::RRI(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerRRI() @@ -554,7 +554,7 @@ class FinancialTest extends TestCase public function testSLN($expectedResult, array $args) { $result = Financial::SLN(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerSLN() @@ -570,7 +570,7 @@ class FinancialTest extends TestCase public function testSYD($expectedResult, array $args) { $result = Financial::SYD(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerSYD() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateDifTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateDifTest.php index 9c61dcc9..adbc5221 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateDifTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateDifTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class DateDifTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -27,7 +27,7 @@ class DateDifTest extends TestCase public function testDATEDIF($expectedResult, $startDate, $endDate, $unit) { $result = DateTime::DATEDIF($startDate, $endDate, $unit); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerDATEDIF() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateTest.php index 447e504e..ef3d60ee 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class DateTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -27,7 +27,7 @@ class DateTest extends TestCase public function testDATE($expectedResult, $year, $month, $day) { $result = DateTime::DATE($year, $month, $day); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerDATE() @@ -40,7 +40,8 @@ class DateTest extends TestCase Functions::setReturnDateType(Functions::RETURNDATE_UNIX_TIMESTAMP); $result = DateTime::DATE(2012, 1, 31); - $this->assertEquals(1327968000, $result, '', 1E-8); + $this->assertEquals(1327968000, $result); + $this->assertEqualsWithDelta(1327968000, $result, 1E-8); } public function testDATEtoDateTimeObject() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateValueTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateValueTest.php index 236da6c7..3c5d7a56 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateValueTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateValueTest.php @@ -10,7 +10,7 @@ use PHPUnit\Framework\TestCase; class DateValueTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -26,7 +26,7 @@ class DateValueTest extends TestCase public function testDATEVALUE($expectedResult, $dateValue) { $result = DateTime::DATEVALUE($dateValue); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerDATEVALUE() @@ -39,7 +39,8 @@ class DateValueTest extends TestCase Functions::setReturnDateType(Functions::RETURNDATE_UNIX_TIMESTAMP); $result = DateTime::DATEVALUE('2012-1-31'); - $this->assertEquals(1327968000, $result, '', 1E-8); + $this->assertEquals(1327968000, $result); + $this->assertEqualsWithDelta(1327968000, $result, 1E-8); } public function testDATEVALUEtoDateTimeObject() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DayTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DayTest.php index 6bd5ba71..1b2bf430 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DayTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DayTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class DayTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -26,12 +26,12 @@ class DayTest extends TestCase public function testDAY($expectedResultExcel, $expectedResultOpenOffice, $dateTimeValue) { $resultExcel = DateTime::DAYOFMONTH($dateTimeValue); - $this->assertEquals($expectedResultExcel, $resultExcel, '', 1E-8); + $this->assertEqualsWithDelta($expectedResultExcel, $resultExcel, 1E-8); Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); $resultOpenOffice = DateTime::DAYOFMONTH($dateTimeValue); - $this->assertEquals($expectedResultOpenOffice, $resultOpenOffice, '', 1E-8); + $this->assertEqualsWithDelta($expectedResultOpenOffice, $resultOpenOffice, 1E-8); } public function providerDAY() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/Days360Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/Days360Test.php index ec067aca..aa1da823 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/Days360Test.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/Days360Test.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class Days360Test extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -27,7 +27,7 @@ class Days360Test extends TestCase public function testDAYS360($expectedResult, $startDate, $endDate, $method) { $result = DateTime::DAYS360($startDate, $endDate, $method); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerDAYS360() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DaysTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DaysTest.php index 6e63b1db..0d805245 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DaysTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DaysTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class DaysTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -26,7 +26,7 @@ class DaysTest extends TestCase public function testDAYS($expectedResult, $endDate, $startDate) { $result = DateTime::DAYS($endDate, $startDate); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerDAYS() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EDateTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EDateTest.php index eead7441..fbd4dee4 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EDateTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EDateTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class EDateTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -26,7 +26,7 @@ class EDateTest extends TestCase public function testEDATE($expectedResult, $dateValue, $adjustmentMonths) { $result = DateTime::EDATE($dateValue, $adjustmentMonths); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerEDATE() @@ -39,7 +39,8 @@ class EDateTest extends TestCase Functions::setReturnDateType(Functions::RETURNDATE_UNIX_TIMESTAMP); $result = DateTime::EDATE('2012-1-26', -1); - $this->assertEquals(1324857600, $result, '', 1E-8); + $this->assertEquals(1324857600, $result); + $this->assertEqualsWithDelta(1324857600, $result, 1E-8); } public function testEDATEtoDateTimeObject() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EoMonthTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EoMonthTest.php index 5e1c52a1..deb67992 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EoMonthTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EoMonthTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class EoMonthTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -26,7 +26,7 @@ class EoMonthTest extends TestCase public function testEOMONTH($expectedResult, $dateValue, $adjustmentMonths) { $result = DateTime::EOMONTH($dateValue, $adjustmentMonths); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerEOMONTH() @@ -39,7 +39,8 @@ class EoMonthTest extends TestCase Functions::setReturnDateType(Functions::RETURNDATE_UNIX_TIMESTAMP); $result = DateTime::EOMONTH('2012-1-26', -1); - $this->assertEquals(1325289600, $result, '', 1E-8); + $this->assertEquals(1325289600, $result); + $this->assertEqualsWithDelta(1325289600, $result, 1E-8); } public function testEOMONTHtoDateTimeObject() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/HourTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/HourTest.php index a7a4d0fa..dc693101 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/HourTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/HourTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class HourTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -25,7 +25,7 @@ class HourTest extends TestCase public function testHOUR($expectedResult, $dateTimeValue) { $result = DateTime::HOUROFDAY($dateTimeValue); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerHOUR() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/IsoWeekNumTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/IsoWeekNumTest.php index 39c9f036..61a8427a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/IsoWeekNumTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/IsoWeekNumTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class IsoWeekNumTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -25,7 +25,7 @@ class IsoWeekNumTest extends TestCase public function testISOWEEKNUM($expectedResult, $dateValue) { $result = DateTime::ISOWEEKNUM($dateValue); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerISOWEEKNUM() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MinuteTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MinuteTest.php index c4327079..986ce480 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MinuteTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MinuteTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class MinuteTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -25,7 +25,7 @@ class MinuteTest extends TestCase public function testMINUTE($expectedResult, $dateTimeValue) { $result = DateTime::MINUTE($dateTimeValue); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerMINUTE() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MonthTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MonthTest.php index 2bec0557..d0060af1 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MonthTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MonthTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class MonthTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -25,7 +25,7 @@ class MonthTest extends TestCase public function testMONTH($expectedResult, $dateTimeValue) { $result = DateTime::MONTHOFYEAR($dateTimeValue); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerMONTH() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/NetworkDaysTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/NetworkDaysTest.php index e1aa446f..f4340d9c 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/NetworkDaysTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/NetworkDaysTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class NetworkDaysTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -24,7 +24,7 @@ class NetworkDaysTest extends TestCase public function testNETWORKDAYS($expectedResult, ...$args) { $result = DateTime::NETWORKDAYS(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerNETWORKDAYS() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/SecondTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/SecondTest.php index 40418706..aa1dba7e 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/SecondTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/SecondTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class SecondTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -25,7 +25,7 @@ class SecondTest extends TestCase public function testSECOND($expectedResult, $dateTimeValue) { $result = DateTime::SECOND($dateTimeValue); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerSECOND() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeTest.php index 8debe7a1..3be26786 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class TimeTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -24,7 +24,7 @@ class TimeTest extends TestCase public function testTIME($expectedResult, ...$args) { $result = DateTime::TIME(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerTIME() @@ -37,7 +37,7 @@ class TimeTest extends TestCase Functions::setReturnDateType(Functions::RETURNDATE_PHP_NUMERIC); $result = DateTime::TIME(7, 30, 20); - $this->assertEquals(27020, $result, '', 1E-8); + $this->assertEqualsWithDelta(27020, $result, 1E-8); } public function testTIMEtoDateTimeObject() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeValueTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeValueTest.php index 52fe18f6..263e665e 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeValueTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeValueTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class TimeValueTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -25,7 +25,7 @@ class TimeValueTest extends TestCase public function testTIMEVALUE($expectedResult, $timeValue) { $result = DateTime::TIMEVALUE($timeValue); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerTIMEVALUE() @@ -38,7 +38,8 @@ class TimeValueTest extends TestCase Functions::setReturnDateType(Functions::RETURNDATE_UNIX_TIMESTAMP); $result = DateTime::TIMEVALUE('7:30:20'); - $this->assertEquals(23420, $result, '', 1E-8); + $this->assertEquals(23420, $result); + $this->assertEqualsWithDelta(23420, $result, 1E-8); } public function testTIMEVALUEtoDateTimeObject() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekDayTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekDayTest.php index 9636e7e7..72c8ac23 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekDayTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekDayTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class WeekDayTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -24,7 +24,7 @@ class WeekDayTest extends TestCase public function testWEEKDAY($expectedResult, ...$args) { $result = DateTime::WEEKDAY(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerWEEKDAY() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekNumTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekNumTest.php index f310aa18..a7c3260d 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekNumTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekNumTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class WeekNumTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -24,7 +24,7 @@ class WeekNumTest extends TestCase public function testWEEKNUM($expectedResult, ...$args) { $result = DateTime::WEEKNUM(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerWEEKNUM() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WorkDayTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WorkDayTest.php index d735203c..2edc8609 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WorkDayTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WorkDayTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class WorkDayTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -24,7 +24,7 @@ class WorkDayTest extends TestCase public function testWORKDAY($expectedResult, ...$args) { $result = DateTime::WORKDAY(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerWORKDAY() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearFracTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearFracTest.php index 60c35819..2d87c532 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearFracTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearFracTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class YearFracTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -24,7 +24,7 @@ class YearFracTest extends TestCase public function testYEARFRAC($expectedResult, ...$args) { $result = DateTime::YEARFRAC(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerYEARFRAC() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearTest.php index 8b59e0aa..3545140f 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class YearTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -25,7 +25,7 @@ class YearTest extends TestCase public function testYEAR($expectedResult, $dateTimeValue) { $result = DateTime::YEAR($dateTimeValue); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerYEAR() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselITest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselITest.php index adaddd6e..e6fa2924 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselITest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselITest.php @@ -10,7 +10,7 @@ class BesselITest extends TestCase { const BESSEL_PRECISION = 1E-8; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -23,7 +23,7 @@ class BesselITest extends TestCase public function testBESSELI($expectedResult, ...$args) { $result = Engineering::BESSELI(...$args); - $this->assertEquals($expectedResult, $result, '', self::BESSEL_PRECISION); + $this->assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION); } public function providerBESSELI() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselJTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselJTest.php index 4787fa1a..1458ece9 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselJTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselJTest.php @@ -10,7 +10,7 @@ class BesselJTest extends TestCase { const BESSEL_PRECISION = 1E-8; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -23,7 +23,7 @@ class BesselJTest extends TestCase public function testBESSELJ($expectedResult, ...$args) { $result = Engineering::BESSELJ(...$args); - $this->assertEquals($expectedResult, $result, '', self::BESSEL_PRECISION); + $this->assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION); } public function providerBESSEJ() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselKTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselKTest.php index 865244af..f2ab0529 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselKTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselKTest.php @@ -10,7 +10,7 @@ class BesselKTest extends TestCase { const BESSEL_PRECISION = 1E-8; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -23,7 +23,7 @@ class BesselKTest extends TestCase public function testBESSELK($expectedResult, ...$args) { $result = Engineering::BESSELK(...$args); - $this->assertEquals($expectedResult, $result, '', self::BESSEL_PRECISION); + $this->assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION); } public function providerBESSELK() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselYTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselYTest.php index e79b9871..66af44c9 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselYTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselYTest.php @@ -10,7 +10,7 @@ class BesselYTest extends TestCase { const BESSEL_PRECISION = 1E-8; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -23,7 +23,7 @@ class BesselYTest extends TestCase public function testBESSELY($expectedResult, ...$args) { $result = Engineering::BESSELY(...$args); - $this->assertEquals($expectedResult, $result, '', self::BESSEL_PRECISION); + $this->assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION); } public function providerBESSELY() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2DecTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2DecTest.php index 917493eb..61fe3423 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2DecTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2DecTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class Bin2DecTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2HexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2HexTest.php index 1366a7a9..77e9722d 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2HexTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2HexTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class Bin2HexTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2OctTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2OctTest.php index acec8843..a8f7095e 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2OctTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2OctTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class Bin2OctTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitAndTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitAndTest.php index 7e2d6ae7..e60aa79b 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitAndTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitAndTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class BitAndTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitLShiftTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitLShiftTest.php index 8ae9db68..47703c51 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitLShiftTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitLShiftTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class BitLShiftTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitOrTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitOrTest.php index 4719d1ba..19a5a6b1 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitOrTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitOrTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class BitOrTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitRShiftTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitRShiftTest.php index 07b6b542..597fa333 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitRShiftTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitRShiftTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class BitRShiftTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitXorTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitXorTest.php index ca29c064..fc3df893 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitXorTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitXorTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class BitXorTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ComplexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ComplexTest.php index d7686fb0..dbdd8257 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ComplexTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ComplexTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class ComplexTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ConvertUoMTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ConvertUoMTest.php index f09479ad..593bfc65 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ConvertUoMTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ConvertUoMTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class ConvertUoMTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2BinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2BinTest.php index 3856c213..f5c8f089 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2BinTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2BinTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class Dec2BinTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2HexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2HexTest.php index bc9781dc..2bdeff25 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2HexTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2HexTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class Dec2HexTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2OctTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2OctTest.php index 4b225b7f..93fa46c7 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2OctTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2OctTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class Dec2OctTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/DeltaTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/DeltaTest.php index daf30e71..241530ac 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/DeltaTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/DeltaTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class DeltaTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfCTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfCTest.php index 36d89f2e..7dbb4158 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfCTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfCTest.php @@ -10,7 +10,7 @@ class ErfCTest extends TestCase { const ERF_PRECISION = 1E-12; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -23,7 +23,8 @@ class ErfCTest extends TestCase public function testERFC($expectedResult, ...$args) { $result = Engineering::ERFC(...$args); - $this->assertEquals($expectedResult, $result, '', self::ERF_PRECISION); + $this->assertEquals($expectedResult, $result); + $this->assertEqualsWithDelta($expectedResult, $result, self::ERF_PRECISION); } public function providerERFC() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfPreciseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfPreciseTest.php index 6511b5d5..f42ebde1 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfPreciseTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfPreciseTest.php @@ -10,7 +10,7 @@ class ErfPreciseTest extends TestCase { const ERF_PRECISION = 1E-12; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -23,7 +23,8 @@ class ErfPreciseTest extends TestCase public function testERFPRECISE($expectedResult, ...$args) { $result = Engineering::ERFPRECISE(...$args); - $this->assertEquals($expectedResult, $result, '', self::ERF_PRECISION); + $this->assertEquals($expectedResult, $result); + $this->assertEqualsWithDelta($expectedResult, $result, self::ERF_PRECISION); } public function providerERFPRECISE() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfTest.php index 709131fa..fbc004fa 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfTest.php @@ -10,7 +10,7 @@ class ErfTest extends TestCase { const ERF_PRECISION = 1E-12; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -23,7 +23,8 @@ class ErfTest extends TestCase public function testERF($expectedResult, ...$args) { $result = Engineering::ERF(...$args); - $this->assertEquals($expectedResult, $result, '', self::ERF_PRECISION); + $this->assertEquals($expectedResult, $result); + $this->assertEqualsWithDelta($expectedResult, $result, self::ERF_PRECISION); } public function providerERF() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/GeStepTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/GeStepTest.php index 1a6b63b6..b96dbcec 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/GeStepTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/GeStepTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class GeStepTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2BinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2BinTest.php index bb7b62bd..4e779fba 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2BinTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2BinTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class Hex2BinTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2DecTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2DecTest.php index 38f2a28a..acefad65 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2DecTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2DecTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class Hex2DecTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2OctTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2OctTest.php index 0ae0f44d..2db814d6 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2OctTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2OctTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class Hex2OctTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImAbsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImAbsTest.php index e52d32b2..fb68d580 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImAbsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImAbsTest.php @@ -10,7 +10,7 @@ class ImAbsTest extends TestCase { const COMPLEX_PRECISION = 1E-8; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -24,7 +24,7 @@ class ImAbsTest extends TestCase public function testIMABS($expectedResult, $value) { $result = Engineering::IMABS($value); - $this->assertEquals($expectedResult, $result, '', self::COMPLEX_PRECISION); + $this->assertEqualsWithDelta($expectedResult, $result, self::COMPLEX_PRECISION); } public function providerIMABS() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImArgumentTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImArgumentTest.php index 85e61352..ffc051ef 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImArgumentTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImArgumentTest.php @@ -10,7 +10,7 @@ class ImArgumentTest extends TestCase { const COMPLEX_PRECISION = 1E-8; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -24,7 +24,7 @@ class ImArgumentTest extends TestCase public function testIMARGUMENT($expectedResult, $value) { $result = Engineering::IMARGUMENT($value); - $this->assertEquals($expectedResult, $result, '', self::COMPLEX_PRECISION); + $this->assertEqualsWithDelta($expectedResult, $result, self::COMPLEX_PRECISION); } public function providerIMARGUMENT() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImConjugateTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImConjugateTest.php index 189cc593..d431429a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImConjugateTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImConjugateTest.php @@ -16,13 +16,13 @@ class ImConjugateTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCosTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCosTest.php index d8dc2232..1e7a0ac0 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCosTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCosTest.php @@ -16,13 +16,13 @@ class ImCosTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCoshTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCoshTest.php index baa7e94a..ada76b62 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCoshTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCoshTest.php @@ -16,13 +16,13 @@ class ImCoshTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCotTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCotTest.php index 9e5e6dd6..91089820 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCotTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCotTest.php @@ -16,13 +16,13 @@ class ImCotTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCscTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCscTest.php index c7e11bad..151216db 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCscTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCscTest.php @@ -16,13 +16,13 @@ class ImCscTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCschTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCschTest.php index 14bdd30a..5ce9d6bc 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCschTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCschTest.php @@ -16,13 +16,13 @@ class ImCschTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImDivTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImDivTest.php index c3e4fb60..ee75c996 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImDivTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImDivTest.php @@ -16,13 +16,13 @@ class ImDivTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImExpTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImExpTest.php index cfc7d4fe..8d38fe57 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImExpTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImExpTest.php @@ -16,13 +16,13 @@ class ImExpTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLnTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLnTest.php index d9d44660..54bf5db0 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLnTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLnTest.php @@ -16,13 +16,13 @@ class ImLnTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog10Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog10Test.php index c748ed41..69930da5 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog10Test.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog10Test.php @@ -16,13 +16,13 @@ class ImLog10Test extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog2Test.php index fceda8fd..aee9f442 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog2Test.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog2Test.php @@ -16,13 +16,13 @@ class ImLog2Test extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImPowerTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImPowerTest.php index f9dd0380..63211439 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImPowerTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImPowerTest.php @@ -16,13 +16,13 @@ class ImPowerTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImProductTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImProductTest.php index b95c6002..d13d1a6c 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImProductTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImProductTest.php @@ -16,13 +16,13 @@ class ImProductTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImRealTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImRealTest.php index 317745a9..013e6d93 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImRealTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImRealTest.php @@ -10,7 +10,7 @@ class ImRealTest extends TestCase { const COMPLEX_PRECISION = 1E-8; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -24,7 +24,7 @@ class ImRealTest extends TestCase public function testIMREAL($expectedResult, $value) { $result = Engineering::IMREAL($value); - $this->assertEquals($expectedResult, $result, '', self::COMPLEX_PRECISION); + $this->assertEqualsWithDelta($expectedResult, $result, self::COMPLEX_PRECISION); } public function providerIMREAL() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSecTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSecTest.php index 852e4acb..4f2957fa 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSecTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSecTest.php @@ -16,13 +16,13 @@ class ImSecTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSechTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSechTest.php index 63a87e04..6b842566 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSechTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSechTest.php @@ -16,13 +16,13 @@ class ImSechTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinTest.php index 4bb0aaeb..ca3ceb22 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinTest.php @@ -16,13 +16,13 @@ class ImSinTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinhTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinhTest.php index 7640e9b4..b30d8280 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinhTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinhTest.php @@ -16,13 +16,13 @@ class ImSinhTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSqrtTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSqrtTest.php index ae4c4452..0bff1eef 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSqrtTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSqrtTest.php @@ -16,13 +16,13 @@ class ImSqrtTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSubTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSubTest.php index 902be213..0daa1827 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSubTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSubTest.php @@ -16,13 +16,13 @@ class ImSubTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSumTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSumTest.php index 07f7e11d..c4fbc3e7 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSumTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSumTest.php @@ -16,13 +16,13 @@ class ImSumTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImTanTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImTanTest.php index cb8b961f..c3e5eb1c 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImTanTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImTanTest.php @@ -16,13 +16,13 @@ class ImTanTest extends TestCase */ protected $complexAssert; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); $this->complexAssert = new ComplexAssert(); } - public function tearDown() + protected function tearDown(): void { $this->complexAssert = null; } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImaginaryTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImaginaryTest.php index b2e85968..6f9e67cf 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImaginaryTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImaginaryTest.php @@ -10,7 +10,7 @@ class ImaginaryTest extends TestCase { const COMPLEX_PRECISION = 1E-8; - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -24,7 +24,7 @@ class ImaginaryTest extends TestCase public function testIMAGINARY($expectedResult, $value) { $result = Engineering::IMAGINARY($value); - $this->assertEquals($expectedResult, $result, '', self::COMPLEX_PRECISION); + $this->assertEqualsWithDelta($expectedResult, $result, self::COMPLEX_PRECISION); } public function providerIMAGINARY() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2BinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2BinTest.php index e737b120..97558b65 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2BinTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2BinTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class Oct2BinTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2DecTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2DecTest.php index 6d14e546..ed51ab48 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2DecTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2DecTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class Oct2DecTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2HexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2HexTest.php index 5a2252f0..35764d2b 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2HexTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2HexTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class Oct2HexTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ParseComplexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ParseComplexTest.php index e438ec39..bc1437a3 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ParseComplexTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ParseComplexTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class ParseComplexTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AccrintMTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AccrintMTest.php index a89d74f1..84f45962 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AccrintMTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AccrintMTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class AccrintMTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class AccrintMTest extends TestCase public function testACCRINTM($expectedResult, ...$args) { $result = Financial::ACCRINTM(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerACCRINTM() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AccrintTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AccrintTest.php index 31bc3cc5..55ee6747 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AccrintTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AccrintTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class AccrintTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class AccrintTest extends TestCase public function testACCRINT($expectedResult, ...$args) { $result = Financial::ACCRINT(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerACCRINT() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/AndTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/AndTest.php index 69ae43af..74c426ea 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/AndTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/AndTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class AndTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/FalseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/FalseTest.php index cbd2a8f4..c546554e 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/FalseTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/FalseTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class FalseTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfErrorTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfErrorTest.php index 678dcc6e..20d71025 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfErrorTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfErrorTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class IfErrorTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfNaTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfNaTest.php index 16f0314f..02181b64 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfNaTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfNaTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class IfNaTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfTest.php index d3a7623f..6f0b4087 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class IfTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/NotTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/NotTest.php index 1aab0cd1..5dd40fdc 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/NotTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/NotTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class NotTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/OrTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/OrTest.php index a47b83bc..a91fc5b0 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/OrTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/OrTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class OrTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/SwitchTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/SwitchTest.php index aa3b7525..d85ca4f3 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/SwitchTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/SwitchTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class SwitchTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/TrueTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/TrueTest.php index 075820a9..77166db0 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/TrueTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/TrueTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class TrueTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/XorTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/XorTest.php index 8a41f0d0..dc264f52 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/XorTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/XorTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class XorTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ChooseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ChooseTest.php index c1e043e0..9e720566 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ChooseTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ChooseTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class ChooseTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnsTest.php index 06872eec..f34a3f64 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnsTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class ColumnsTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/HLookupTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/HLookupTest.php index cb1f08fa..2baaa4f8 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/HLookupTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/HLookupTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class HLookupTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexTest.php index 0da7de1b..972e7511 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class IndexTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/LookupTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/LookupTest.php index 0c5e610e..f643783d 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/LookupTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/LookupTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class LookupTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MatchTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MatchTest.php index 42c7b3bb..3c956b66 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MatchTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MatchTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class MatchTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowsTest.php index 46dd9851..0a97382f 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowsTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class RowsTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/VLookupTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/VLookupTest.php index ea9afa20..cf4b3059 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/VLookupTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/VLookupTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class VLookupTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcotTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcotTest.php index 898c1939..e77c4ffb 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcotTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcotTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class AcotTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -22,7 +22,7 @@ class AcotTest extends TestCase public function testACOT($expectedResult, $number) { $result = MathTrig::ACOT($number); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerACOT() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcothTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcothTest.php index abc899b3..695df010 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcothTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcothTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class AcothTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -22,7 +22,7 @@ class AcothTest extends TestCase public function testACOTH($expectedResult, $number) { $result = MathTrig::ACOTH($number); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerACOTH() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ArabicTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ArabicTest.php index f3f5c965..10135e11 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ArabicTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ArabicTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class ArabicTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Atan2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Atan2Test.php index db11c89c..dc965305 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Atan2Test.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Atan2Test.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class Atan2Test extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -23,7 +23,7 @@ class Atan2Test extends TestCase public function testATAN2($expectedResult, $x, $y) { $result = MathTrig::ATAN2($x, $y); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerATAN2() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php index 3aaf68b5..1368df19 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class BaseTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingTest.php index ec0b32e0..f60fae72 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class CeilingTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class CeilingTest extends TestCase public function testCEILING($expectedResult, ...$args) { $result = MathTrig::CEILING(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerCEILING() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinTest.php index 7d1002a2..d3a4ee44 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class CombinTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class CombinTest extends TestCase public function testCOMBIN($expectedResult, ...$args) { $result = MathTrig::COMBIN(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerCOMBIN() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CotTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CotTest.php index cd524725..6263c9fd 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CotTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CotTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class CotTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -22,7 +22,7 @@ class CotTest extends TestCase public function testCOT($expectedResult, $angle) { $result = MathTrig::COT($angle); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerCOT() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CothTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CothTest.php index 2ed5515d..2dfa57a5 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CothTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CothTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class CothTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -22,7 +22,7 @@ class CothTest extends TestCase public function testCOTH($expectedResult, $angle) { $result = MathTrig::COTH($angle); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerCOTH() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CscTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CscTest.php index f84415a3..1b0cdbf7 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CscTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CscTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class CscTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -22,7 +22,7 @@ class CscTest extends TestCase public function testCSC($expectedResult, $angle) { $result = MathTrig::CSC($angle); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerCSC() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CschTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CschTest.php index 98b02f3a..82e286da 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CschTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CschTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class CschTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -22,7 +22,7 @@ class CschTest extends TestCase public function testCSCH($expectedResult, $angle) { $result = MathTrig::CSCH($angle); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerCSCH() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/EvenTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/EvenTest.php index 65ed5f54..3bd84ddd 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/EvenTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/EvenTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class EvenTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -22,7 +22,7 @@ class EvenTest extends TestCase public function testEVEN($expectedResult, $value) { $result = MathTrig::EVEN($value); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerEVEN() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactDoubleTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactDoubleTest.php index 5605e40c..2dfe8fad 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactDoubleTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactDoubleTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class FactDoubleTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -22,7 +22,7 @@ class FactDoubleTest extends TestCase public function testFACTDOUBLE($expectedResult, $value) { $result = MathTrig::FACTDOUBLE($value); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerFACTDOUBLE() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactTest.php index 38c95ab1..0f3294e3 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class FactTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -22,7 +22,7 @@ class FactTest extends TestCase public function testFACT($expectedResult, $value) { $result = MathTrig::FACT($value); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerFACT() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorMathTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorMathTest.php index 0e693e80..63b694f3 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorMathTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorMathTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class FloorMathTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class FloorMathTest extends TestCase public function testFLOORMATH($expectedResult, ...$args) { $result = MathTrig::FLOORMATH(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerFLOORMATH() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorPreciseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorPreciseTest.php index 616cb43b..e84e596a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorPreciseTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorPreciseTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class FloorPreciseTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class FloorPreciseTest extends TestCase public function testFLOOR($expectedResult, ...$args) { $result = MathTrig::FLOORPRECISE(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerFLOORPRECISE() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorTest.php index e43ba3d1..60ff5bb7 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class FloorTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class FloorTest extends TestCase public function testFLOOR($expectedResult, ...$args) { $result = MathTrig::FLOOR(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerFLOOR() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/GcdTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/GcdTest.php index d066f405..d6f588d1 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/GcdTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/GcdTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class GcdTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class GcdTest extends TestCase public function testGCD($expectedResult, ...$args) { $result = MathTrig::GCD(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerGCD() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/IntTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/IntTest.php index 58ba3e44..3a287aa3 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/IntTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/IntTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class IntTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LcmTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LcmTest.php index 6be79feb..a5cc2312 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LcmTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LcmTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class LcmTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class LcmTest extends TestCase public function testLCM($expectedResult, ...$args) { $result = MathTrig::LCM(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerLCM() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LogTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LogTest.php index eccec454..2e54654e 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LogTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LogTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class LogTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class LogTest extends TestCase public function testLOG($expectedResult, ...$args) { $result = MathTrig::logBase(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerLOG() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MInverseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MInverseTest.php index d61ceaf8..2a4f1af0 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MInverseTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MInverseTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class MInverseTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class MInverseTest extends TestCase public function testMINVERSE($expectedResult, ...$args) { $result = MathTrig::MINVERSE(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerMINVERSE() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MMultTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MMultTest.php index 1e2d65b7..337abbea 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MMultTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MMultTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class MMultTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class MMultTest extends TestCase public function testMMULT($expectedResult, ...$args) { $result = MathTrig::MMULT(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerMMULT() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MRoundTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MRoundTest.php index c02e70ba..ca14bc1c 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MRoundTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MRoundTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class MRoundTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class MRoundTest extends TestCase public function testMROUND($expectedResult, ...$args) { $result = MathTrig::MROUND(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerMROUND() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MdeTermTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MdeTermTest.php index 4b2d3279..84911aaf 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MdeTermTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MdeTermTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class MdeTermTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class MdeTermTest extends TestCase public function testMDETERM($expectedResult, ...$args) { $result = MathTrig::MDETERM(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerMDETERM() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ModTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ModTest.php index fa60000e..8d166618 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ModTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ModTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class ModTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class ModTest extends TestCase public function testMOD($expectedResult, ...$args) { $result = MathTrig::MOD(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerMOD() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MultinomialTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MultinomialTest.php index 3c8d1916..1f751351 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MultinomialTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MultinomialTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class MultinomialTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class MultinomialTest extends TestCase public function testMULTINOMIAL($expectedResult, ...$args) { $result = MathTrig::MULTINOMIAL(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerMULTINOMIAL() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/OddTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/OddTest.php index 1183dd57..8ba4beaf 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/OddTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/OddTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class OddTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -22,7 +22,7 @@ class OddTest extends TestCase public function testODD($expectedResult, $value) { $result = MathTrig::ODD($value); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerODD() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/PowerTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/PowerTest.php index 7d86ebf8..9df08b5f 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/PowerTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/PowerTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class PowerTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class PowerTest extends TestCase public function testPOWER($expectedResult, ...$args) { $result = MathTrig::POWER(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerPOWER() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ProductTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ProductTest.php index bd99fd0e..fecc806a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ProductTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ProductTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class ProductTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class ProductTest extends TestCase public function testPRODUCT($expectedResult, ...$args) { $result = MathTrig::PRODUCT(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerPRODUCT() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/QuotientTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/QuotientTest.php index ac96f079..e81414fe 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/QuotientTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/QuotientTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class QuotientTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class QuotientTest extends TestCase public function testQUOTIENT($expectedResult, ...$args) { $result = MathTrig::QUOTIENT(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerQUOTIENT() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RomanTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RomanTest.php index 6a09e458..edc72289 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RomanTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RomanTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class RomanTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundDownTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundDownTest.php index a3368827..4d95dac7 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundDownTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundDownTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class RoundDownTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class RoundDownTest extends TestCase public function testROUNDDOWN($expectedResult, ...$args) { $result = MathTrig::ROUNDDOWN(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerROUNDDOWN() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundUpTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundUpTest.php index ba36c776..143aa653 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundUpTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundUpTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class RoundUpTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class RoundUpTest extends TestCase public function testROUNDUP($expectedResult, ...$args) { $result = MathTrig::ROUNDUP(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerROUNDUP() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SecTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SecTest.php index c2742346..944c3e37 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SecTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SecTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class SecTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -22,7 +22,7 @@ class SecTest extends TestCase public function testSEC($expectedResult, $angle) { $result = MathTrig::SEC($angle); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerSEC() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SechTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SechTest.php index c9ff29bf..42fecb0b 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SechTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SechTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class SechTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -22,7 +22,7 @@ class SechTest extends TestCase public function testSECH($expectedResult, $angle) { $result = MathTrig::SECH($angle); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerSECH() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SeriesSumTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SeriesSumTest.php index ef8ee62e..7923fbc1 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SeriesSumTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SeriesSumTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class SeriesSumTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class SeriesSumTest extends TestCase public function testSERIESSUM($expectedResult, ...$args) { $result = MathTrig::SERIESSUM(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerSERIESSUM() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SignTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SignTest.php index e6f7becd..c0ff7b5e 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SignTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SignTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class SignTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -22,7 +22,7 @@ class SignTest extends TestCase public function testSIGN($expectedResult, $value) { $result = MathTrig::SIGN($value); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerSIGN() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtPiTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtPiTest.php index 58b2a3dc..19a182c5 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtPiTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtPiTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class SqrtPiTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -22,7 +22,7 @@ class SqrtPiTest extends TestCase public function testSQRTPI($expectedResult, $value) { $result = MathTrig::SQRTPI($value); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerSQRTPI() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SubTotalTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SubTotalTest.php index 91f66263..2711c657 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SubTotalTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SubTotalTest.php @@ -12,7 +12,7 @@ use PHPUnit\Framework\TestCase; class SubTotalTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -49,7 +49,7 @@ class SubTotalTest extends TestCase array_push($args, $cellReference); $result = MathTrig::SUBTOTAL(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerSUBTOTAL() @@ -120,7 +120,7 @@ class SubTotalTest extends TestCase array_push($args, $cellReference); $result = MathTrig::SUBTOTAL(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerHiddenSUBTOTAL() @@ -188,7 +188,7 @@ class SubTotalTest extends TestCase array_push($args, $cellReference); $result = MathTrig::SUBTOTAL(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerNestedSUBTOTAL() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfTest.php index 51755dc8..359fef44 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class SumIfTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class SumIfTest extends TestCase public function testSUMIF($expectedResult, ...$args) { $result = MathTrig::SUMIF(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerSUMIF() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfsTest.php index 9336cec8..9127705a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfsTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class SumIfsTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class SumIfsTest extends TestCase public function testSUMIFS($expectedResult, ...$args) { $result = MathTrig::SUMIFS(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerSUMIFS() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumProductTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumProductTest.php index 13558661..c409ee18 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumProductTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumProductTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class SumProductTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class SumProductTest extends TestCase public function testSUMPRODUCT($expectedResult, ...$args) { $result = MathTrig::SUMPRODUCT(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerSUMPRODUCT() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumSqTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumSqTest.php index 91c6ec15..bfd2d874 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumSqTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumSqTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class SumSqTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class SumSqTest extends TestCase public function testSUMSQ($expectedResult, ...$args) { $result = MathTrig::SUMSQ(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerSUMSQ() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2MY2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2MY2Test.php index b8904612..937043ee 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2MY2Test.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2MY2Test.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class SumX2MY2Test extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class SumX2MY2Test extends TestCase public function testSUMX2MY2($expectedResult, ...$args) { $result = MathTrig::SUMX2MY2(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerSUMX2MY2() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2PY2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2PY2Test.php index ce016e6f..c58f28a2 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2PY2Test.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2PY2Test.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class SumX2PY2Test extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class SumX2PY2Test extends TestCase public function testSUMX2PY2($expectedResult, ...$args) { $result = MathTrig::SUMX2PY2(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerSUMX2PY2() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumXMY2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumXMY2Test.php index 67e3c80d..a4a6e8a1 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumXMY2Test.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumXMY2Test.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class SumXMY2Test extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class SumXMY2Test extends TestCase public function testSUMXMY2($expectedResult, ...$args) { $result = MathTrig::SUMXMY2(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerSUMXMY2() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TruncTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TruncTest.php index fec38428..b5bb6e43 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TruncTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TruncTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class TruncTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class TruncTest extends TestCase public function testTRUNC($expectedResult, ...$args) { $result = MathTrig::TRUNC(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerTRUNC() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AveDevTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AveDevTest.php index 9866082f..94f214a3 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AveDevTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AveDevTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class AveDevTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class AveDevTest extends TestCase public function testAVEDEV($expectedResult, ...$args) { $result = Statistical::AVEDEV(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerAVEDEV() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageATest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageATest.php index b0c6ff81..526875f3 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageATest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageATest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class AverageATest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class AverageATest extends TestCase public function testAVERAGEA($expectedResult, ...$args) { $result = Statistical::AVERAGEA(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerAVERAGEA() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageIfTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageIfTest.php index 25462c7f..0d7863bf 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageIfTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageIfTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class AverageIfTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class AverageIfTest extends TestCase public function testAVERAGEIF($expectedResult, ...$args) { $result = Statistical::AVERAGEIF(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerAVERAGEIF() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageTest.php index 87d7bed8..30503a3a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class AverageTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class AverageTest extends TestCase public function testAVERAGE($expectedResult, ...$args) { $result = Statistical::AVERAGE(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerAVERAGE() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BetaDistTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BetaDistTest.php index d40d0c3a..6b1aed82 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BetaDistTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BetaDistTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class BetaDistTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class BetaDistTest extends TestCase public function testBETADIST($expectedResult, ...$args) { $result = Statistical::BETADIST(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerBETADIST() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BetaInvTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BetaInvTest.php index 3721c50d..b0fc38d7 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BetaInvTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BetaInvTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class BetaInvTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class BetaInvTest extends TestCase public function testBETAINV($expectedResult, ...$args) { $result = Statistical::BETAINV(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerBETAINV() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BinomDistTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BinomDistTest.php index c9cfcf8e..c16ff6c2 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BinomDistTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BinomDistTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class BinomDistTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class BinomDistTest extends TestCase public function testBINOMDIST($expectedResult, ...$args) { $result = Statistical::BINOMDIST(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerBINOMDIST() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiDistTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiDistTest.php index 1e2eb13a..3d027c23 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiDistTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiDistTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class ChiDistTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class ChiDistTest extends TestCase public function testCHIDIST($expectedResult, ...$args) { $result = Statistical::CHIDIST(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerCHIDIST() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiInvTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiInvTest.php index c99c8f9c..d176ee78 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiInvTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiInvTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class ChiInvTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class ChiInvTest extends TestCase public function testCHIINV($expectedResult, ...$args) { $result = Statistical::CHIINV(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerCHIINV() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ConfidenceTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ConfidenceTest.php index 5f6bb2e8..5d4472d4 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ConfidenceTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ConfidenceTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class ConfidenceTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class ConfidenceTest extends TestCase public function testCONFIDENCE($expectedResult, ...$args) { $result = Statistical::CONFIDENCE(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerCONFIDENCE() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CorrelTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CorrelTest.php index cefdff7b..c489d4c8 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CorrelTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CorrelTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class CorrelTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class CorrelTest extends TestCase public function testCORREL($expectedResult, array $xargs, array $yargs) { $result = Statistical::CORREL($xargs, $yargs); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerCORREL() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountATest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountATest.php index 51538a2c..4edb1874 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountATest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountATest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class CountATest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class CountATest extends TestCase public function testCOUNTA($expectedResult, ...$args) { $result = Statistical::COUNTA(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerCOUNTA() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountBlankTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountBlankTest.php index 86979d87..5bd008e8 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountBlankTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountBlankTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class CountBlankTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class CountBlankTest extends TestCase public function testCOUNTBLANK($expectedResult, ...$args) { $result = Statistical::COUNTBLANK(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerCOUNTBLANK() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountIfTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountIfTest.php index 92c39865..ec3a25b3 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountIfTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountIfTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class CountIfTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class CountIfTest extends TestCase public function testCOUNTIF($expectedResult, ...$args) { $result = Statistical::COUNTIF(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerCOUNTIF() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountIfsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountIfsTest.php index 472d9d61..0170c277 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountIfsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountIfsTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class CountIfsTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class CountIfsTest extends TestCase public function testCOUNTIFS($expectedResult, ...$args) { $result = Statistical::COUNTIFS(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerCOUNTIFS() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountTest.php index 73c20d25..798bcbd9 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class CountTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class CountTest extends TestCase public function testBasicCOUNT($expectedResult, ...$args) { $result = Statistical::COUNT(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerBasicCOUNT() @@ -37,7 +37,7 @@ class CountTest extends TestCase public function testExcelCOUNT($expectedResult, ...$args) { $result = Statistical::COUNT(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerExcelCOUNT() @@ -55,7 +55,7 @@ class CountTest extends TestCase Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); $result = Statistical::COUNT(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerOpenOfficeCOUNT() @@ -73,7 +73,7 @@ class CountTest extends TestCase Functions::setCompatibilityMode(Functions::COMPATIBILITY_GNUMERIC); $result = Statistical::COUNT(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerGnumericCOUNT() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CovarTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CovarTest.php index 7d70283a..7658d445 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CovarTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CovarTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class CovarTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class CovarTest extends TestCase public function testCOVAR($expectedResult, ...$args) { $result = Statistical::COVAR(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerCOVAR() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ExponDistTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ExponDistTest.php index 9d61356f..a9184edd 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ExponDistTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ExponDistTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class ExponDistTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class ExponDistTest extends TestCase public function testEXPONDIST($expectedResult, ...$args) { $result = Statistical::EXPONDIST(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerEXPONDIST() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FisherInvTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FisherInvTest.php index a6c2f695..0488d504 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FisherInvTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FisherInvTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class FisherInvTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -22,7 +22,7 @@ class FisherInvTest extends TestCase public function testFISHERINV($expectedResult, $value) { $result = Statistical::FISHERINV($value); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerFISHERINV() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FisherTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FisherTest.php index ec5d928c..25ca6b48 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FisherTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FisherTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class FisherTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -22,7 +22,7 @@ class FisherTest extends TestCase public function testFISHER($expectedResult, $value) { $result = Statistical::FISHER($value); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerFISHER() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ForecastTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ForecastTest.php index 2fcb1e54..e0227ad7 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ForecastTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ForecastTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class ForecastTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class ForecastTest extends TestCase public function testFORECAST($expectedResult, ...$args) { $result = Statistical::FORECAST(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerFORECAST() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaDistTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaDistTest.php index 51235f90..325f662d 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaDistTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaDistTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class GammaDistTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class GammaDistTest extends TestCase public function testGAMMADIST($expectedResult, ...$args) { $result = Statistical::GAMMADIST(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerGAMMADIST() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaInvTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaInvTest.php index 2cb243fc..76f5e30c 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaInvTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaInvTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class GammaInvTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class GammaInvTest extends TestCase public function testGAMMAINV($expectedResult, ...$args) { $result = Statistical::GAMMAINV(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerGAMMAINV() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaLnTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaLnTest.php index 436996ba..11363b1f 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaLnTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaLnTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class GammaLnTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -22,7 +22,7 @@ class GammaLnTest extends TestCase public function testGAMMALN($expectedResult, $value) { $result = Statistical::GAMMALN($value); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerGAMMALN() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GeoMeanTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GeoMeanTest.php index b927bdac..cbb7b33d 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GeoMeanTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GeoMeanTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class GeoMeanTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class GeoMeanTest extends TestCase public function testGEOMEAN($expectedResult, ...$args) { $result = Statistical::GEOMEAN(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerGEOMEAN() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/HarMeanTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/HarMeanTest.php index 5b57ee38..5777204d 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/HarMeanTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/HarMeanTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class HarMeanTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class HarMeanTest extends TestCase public function testHARMEAN($expectedResult, ...$args) { $result = Statistical::HARMEAN(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerHARMEAN() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/InterceptTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/InterceptTest.php index b66bd766..9362e692 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/InterceptTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/InterceptTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class InterceptTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class InterceptTest extends TestCase public function testINTERCEPT($expectedResult, array $xargs, array $yargs) { $result = Statistical::INTERCEPT($xargs, $yargs); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerINTERCEPT() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MaxIfsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MaxIfsTest.php index 5e4ae376..06fc2263 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MaxIfsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MaxIfsTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class MaxIfsTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class MaxIfsTest extends TestCase public function testMAXIFS($expectedResult, ...$args) { $result = Statistical::MAXIFS(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerMAXIFS() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MedianTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MedianTest.php index bc6139ce..29497689 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MedianTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MedianTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class MedianTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class MedianTest extends TestCase public function testMEDIAN($expectedResult, ...$args) { $result = Statistical::MEDIAN(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerMEDIAN() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MinIfsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MinIfsTest.php index b0ab4088..4721043f 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MinIfsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MinIfsTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class MinIfsTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class MinIfsTest extends TestCase public function testMINIFS($expectedResult, ...$args) { $result = Statistical::MINIFS(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerMINIFS() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PermutTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PermutTest.php index 8f4eeb69..4e0c9da9 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PermutTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PermutTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class PermutTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class PermutTest extends TestCase public function testPERMUT($expectedResult, ...$args) { $result = Statistical::PERMUT(...$args); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerPERMUT() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/RsqTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/RsqTest.php index cf91b314..229c221f 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/RsqTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/RsqTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class RsqTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class RsqTest extends TestCase public function testRSQ($expectedResult, array $xargs, array $yargs) { $result = Statistical::RSQ($xargs, $yargs); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerRSQ() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SlopeTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SlopeTest.php index b62fede3..4bdaef02 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SlopeTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SlopeTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class SlopeTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class SlopeTest extends TestCase public function testSLOPE($expectedResult, array $xargs, array $yargs) { $result = Statistical::SLOPE($xargs, $yargs); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerSLOPE() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SteyxTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SteyxTest.php index fe8d2ae5..271c2175 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SteyxTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SteyxTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class SteyxTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -21,7 +21,7 @@ class SteyxTest extends TestCase public function testSTEYX($expectedResult, array $xargs, array $yargs) { $result = Statistical::STEYX($xargs, $yargs); - $this->assertEquals($expectedResult, $result, '', 1E-12); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-12); } public function providerSTEYX() diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CharTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CharTest.php index 7ae50fa7..66bbdc20 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CharTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CharTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class CharTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class CharTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CleanTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CleanTest.php index 3286e6fd..0f0e391a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CleanTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CleanTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class CleanTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class CleanTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CodeTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CodeTest.php index a22c1401..99f7dcf5 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CodeTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CodeTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class CodeTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class CodeTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ConcatenateTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ConcatenateTest.php index 46ea0cb7..7b93f56e 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ConcatenateTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ConcatenateTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class ConcatenateTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class ConcatenateTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/DollarTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/DollarTest.php index af49a7d0..827860bc 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/DollarTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/DollarTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class DollarTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class DollarTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ExactTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ExactTest.php index 8c47be47..ddf685c4 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ExactTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ExactTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class ExactTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class ExactTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/FindTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/FindTest.php index 86ae5e77..495339ab 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/FindTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/FindTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class FindTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class FindTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/FixedTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/FixedTest.php index d46f0e48..af9b02ca 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/FixedTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/FixedTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class FixedTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class FixedTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LeftTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LeftTest.php index 18d6c258..b42a4ac3 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LeftTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LeftTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class LeftTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class LeftTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LenTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LenTest.php index ad3dc00c..ad5bffb6 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LenTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LenTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class LenTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class LenTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LowerTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LowerTest.php index 52fd3afe..5651e7ae 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LowerTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LowerTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class LowerTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class LowerTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/MidTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/MidTest.php index d0db50e0..cda1dc01 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/MidTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/MidTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class MidTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class MidTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/NumberValueTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/NumberValueTest.php index 9de91f7e..3ffd147d 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/NumberValueTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/NumberValueTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class NumberValueTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class NumberValueTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ProperTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ProperTest.php index 4e1b0b76..0aaf968f 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ProperTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ProperTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class ProperTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class ProperTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ReplaceTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ReplaceTest.php index dd4411a0..e7592a1f 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ReplaceTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ReplaceTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class ReplaceTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class ReplaceTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/RightTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/RightTest.php index 64fb0e5b..3ec883f4 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/RightTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/RightTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class RightTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class RightTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/SearchTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/SearchTest.php index c77742b6..c8b3040b 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/SearchTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/SearchTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class SearchTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class SearchTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/SubstituteTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/SubstituteTest.php index 2fdb1091..a88ee81d 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/SubstituteTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/SubstituteTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class SubstituteTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class SubstituteTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TTest.php index 90104a17..4cdf3fb4 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class TTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class TTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextJoinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextJoinTest.php index 690db346..c4c929db 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextJoinTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextJoinTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class TextJoinTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class TextJoinTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextTest.php index dbcd0900..306530a5 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class TextTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class TextTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TrimTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TrimTest.php index 2a9fe94e..aa896427 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TrimTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TrimTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class TrimTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class TrimTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/UpperTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/UpperTest.php index 60c894d6..cdfdb49f 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/UpperTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/UpperTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class UpperTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class UpperTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ValueTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ValueTest.php index b6c29f3d..f60a12a9 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ValueTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ValueTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class ValueTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -17,7 +17,7 @@ class ValueTest extends TestCase StringHelper::setCurrencyCode('$'); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); StringHelper::setDecimalSeparator('.'); @@ -38,7 +38,7 @@ class ValueTest extends TestCase StringHelper::setCurrencyCode('$'); $result = TextData::VALUE($value); - $this->assertEquals($expectedResult, $result, '', 1E-8); + $this->assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerVALUE() diff --git a/tests/PhpSpreadsheetTests/Calculation/FunctionsTest.php b/tests/PhpSpreadsheetTests/Calculation/FunctionsTest.php index 2e8e7e9d..b0c8eb87 100644 --- a/tests/PhpSpreadsheetTests/Calculation/FunctionsTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/FunctionsTest.php @@ -10,13 +10,13 @@ use PHPUnit\Framework\TestCase; class FunctionsTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); } - public function tearDown() + protected function tearDown(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); Functions::setReturnDateType(Functions::RETURNDATE_EXCEL); @@ -114,7 +114,7 @@ class FunctionsTest extends TestCase public function testIsBlank($expectedResult, ...$args) { $result = Functions::isBlank(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerIsBlank() @@ -130,7 +130,7 @@ class FunctionsTest extends TestCase public function testIsErr($expectedResult, ...$args) { $result = Functions::isErr(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerIsErr() @@ -146,7 +146,7 @@ class FunctionsTest extends TestCase public function testIsError($expectedResult, ...$args) { $result = Functions::isError(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerIsError() @@ -162,7 +162,7 @@ class FunctionsTest extends TestCase public function testErrorType($expectedResult, ...$args) { $result = Functions::errorType(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerErrorType() @@ -178,7 +178,7 @@ class FunctionsTest extends TestCase public function testIsLogical($expectedResult, ...$args) { $result = Functions::isLogical(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerIsLogical() @@ -194,7 +194,7 @@ class FunctionsTest extends TestCase public function testIsNa($expectedResult, ...$args) { $result = Functions::isNa(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerIsNa() @@ -210,7 +210,7 @@ class FunctionsTest extends TestCase public function testIsNumber($expectedResult, ...$args) { $result = Functions::isNumber(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerIsNumber() @@ -226,7 +226,7 @@ class FunctionsTest extends TestCase public function testIsText($expectedResult, ...$args) { $result = Functions::isText(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerIsText() @@ -242,7 +242,7 @@ class FunctionsTest extends TestCase public function testIsNonText($expectedResult, ...$args) { $result = Functions::isNonText(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerIsNonText() @@ -258,7 +258,7 @@ class FunctionsTest extends TestCase public function testIsEven($expectedResult, ...$args) { $result = Functions::isEven(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerIsEven() @@ -274,7 +274,7 @@ class FunctionsTest extends TestCase public function testIsOdd($expectedResult, ...$args) { $result = Functions::isOdd(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerIsOdd() @@ -290,7 +290,7 @@ class FunctionsTest extends TestCase public function testTYPE($expectedResult, ...$args) { $result = Functions::TYPE(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerTYPE() @@ -306,7 +306,7 @@ class FunctionsTest extends TestCase public function testN($expectedResult, ...$args) { $result = Functions::n(...$args); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerN() @@ -359,7 +359,7 @@ class FunctionsTest extends TestCase } $result = Functions::isFormula($reference, $ourCell); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerIsFormula() diff --git a/tests/PhpSpreadsheetTests/Calculation/LookupRefTest.php b/tests/PhpSpreadsheetTests/Calculation/LookupRefTest.php index 9d7da8dd..5694d859 100644 --- a/tests/PhpSpreadsheetTests/Calculation/LookupRefTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/LookupRefTest.php @@ -14,7 +14,7 @@ use PHPUnit\Framework\TestCase; */ class LookupRefTest extends TestCase { - public function setUp() + protected function setUp(): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } @@ -66,7 +66,7 @@ class LookupRefTest extends TestCase } $result = LookupRef::FORMULATEXT($reference, $ourCell); - self::assertEquals($expectedResult, $result, '', 1E-8); + self::assertEqualsWithDelta($expectedResult, $result, 1E-8); } public function providerFormulaText() diff --git a/tests/PhpSpreadsheetTests/Helper/SampleTest.php b/tests/PhpSpreadsheetTests/Helper/SampleTest.php index 121ec148..e97941f7 100644 --- a/tests/PhpSpreadsheetTests/Helper/SampleTest.php +++ b/tests/PhpSpreadsheetTests/Helper/SampleTest.php @@ -32,18 +32,6 @@ class SampleTest extends TestCase 'Chart/32_Chart_read_write_HTML.php', // idem ]; - // TCPDF does not support PHP 7.2 - if (version_compare(PHP_VERSION, '7.2.0') >= 0) { - $skipped[] = 'Pdf/21_Pdf_TCPDF.php'; - } - - // DomPDF does not support PHP 7.3 - if (version_compare(PHP_VERSION, '7.2.99') >= 0) { - $skipped[] = 'Basic/26_Utf8.php'; - $skipped[] = 'Pdf/21_Pdf_Domdf.php'; - $skipped[] = 'Pdf/21_Pdf_mPDF.php'; - } - // Unfortunately some tests are too long be ran with code-coverage // analysis on Travis, so we need to exclude them global $argv; diff --git a/tests/PhpSpreadsheetTests/Reader/HtmlTest.php b/tests/PhpSpreadsheetTests/Reader/HtmlTest.php index c692e537..a91fe73d 100644 --- a/tests/PhpSpreadsheetTests/Reader/HtmlTest.php +++ b/tests/PhpSpreadsheetTests/Reader/HtmlTest.php @@ -289,12 +289,12 @@ class HtmlTest extends TestCase $cellStyle = $firstSheet->getStyle('A2'); self::assertTrue($cellStyle->getAlignment()->getWrapText()); $cellValue = $firstSheet->getCell('A2')->getValue(); - $this->assertContains("\n", $cellValue); + $this->assertStringContainsString("\n", $cellValue); $cellStyle = $firstSheet->getStyle('A3'); self::assertTrue($cellStyle->getAlignment()->getWrapText()); $cellValue = $firstSheet->getCell('A3')->getValue(); - $this->assertContains("\n", $cellValue); + $this->assertStringContainsString("\n", $cellValue); unlink($filename); } @@ -321,12 +321,12 @@ class HtmlTest extends TestCase $cellStyle = $firstSheet->getStyle('A2'); self::assertTrue($cellStyle->getAlignment()->getWrapText()); $cellValue = $firstSheet->getCell('A2')->getValue(); - $this->assertContains("\n", $cellValue); + $this->assertStringContainsString("\n", $cellValue); $cellStyle = $firstSheet->getStyle('A3'); self::assertTrue($cellStyle->getAlignment()->getWrapText()); $cellValue = $firstSheet->getCell('A3')->getValue(); - $this->assertContains("\n", $cellValue); + $this->assertStringContainsString("\n", $cellValue); } public function testCanLoadFromStringIntoExistingSpreadsheet() @@ -352,12 +352,12 @@ class HtmlTest extends TestCase $cellStyle = $firstSheet->getStyle('A2'); self::assertTrue($cellStyle->getAlignment()->getWrapText()); $cellValue = $firstSheet->getCell('A2')->getValue(); - $this->assertContains("\n", $cellValue); + $this->assertStringContainsString("\n", $cellValue); $cellStyle = $firstSheet->getStyle('A3'); self::assertTrue($cellStyle->getAlignment()->getWrapText()); $cellValue = $firstSheet->getCell('A3')->getValue(); - $this->assertContains("\n", $cellValue); + $this->assertStringContainsString("\n", $cellValue); $reader->setSheetIndex(1); $html = ' diff --git a/tests/PhpSpreadsheetTests/Reader/Security/XmlScannerTest.php b/tests/PhpSpreadsheetTests/Reader/Security/XmlScannerTest.php index 0d9fc13f..6bb1f021 100644 --- a/tests/PhpSpreadsheetTests/Reader/Security/XmlScannerTest.php +++ b/tests/PhpSpreadsheetTests/Reader/Security/XmlScannerTest.php @@ -9,7 +9,7 @@ use PHPUnit\Framework\TestCase; class XmlScannerTest extends TestCase { - protected function setUp() + protected function setUp(): void { libxml_disable_entity_loader(false); } diff --git a/tests/PhpSpreadsheetTests/Reader/Xlsx2Test.php b/tests/PhpSpreadsheetTests/Reader/Xlsx2Test.php index 0544d74a..54908bc2 100644 --- a/tests/PhpSpreadsheetTests/Reader/Xlsx2Test.php +++ b/tests/PhpSpreadsheetTests/Reader/Xlsx2Test.php @@ -11,7 +11,7 @@ use PHPUnit\Framework\TestCase; class Xlsx2Test extends TestCase { - public function tearDown() + protected function tearDown(): void { $outfile = tempnam(File::sysGetTempDir(), 'phpspreadsheet-test'); if (file_exists($outfile)) { diff --git a/tests/PhpSpreadsheetTests/Reader/XlsxTest.php b/tests/PhpSpreadsheetTests/Reader/XlsxTest.php index 246b5a47..7c5b08d9 100644 --- a/tests/PhpSpreadsheetTests/Reader/XlsxTest.php +++ b/tests/PhpSpreadsheetTests/Reader/XlsxTest.php @@ -204,9 +204,6 @@ class XlsxTest extends TestCase */ public function testLoadXlsxWithDoubleAttrDrawing() { - if (version_compare(PHP_VERSION, '7.0.0', '<')) { - $this->markTestSkipped('Only handled in PHP version >= 7.0.0'); - } $filename = './data/Reader/XLSX/double_attr_drawing.xlsx'; $reader = new Xlsx(); $reader->load($filename); diff --git a/tests/PhpSpreadsheetTests/ReferenceHelperTest.php b/tests/PhpSpreadsheetTests/ReferenceHelperTest.php index c1f13a73..6de3d792 100644 --- a/tests/PhpSpreadsheetTests/ReferenceHelperTest.php +++ b/tests/PhpSpreadsheetTests/ReferenceHelperTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase; class ReferenceHelperTest extends TestCase { - public function setUp() + protected function setUp(): void { } diff --git a/tests/PhpSpreadsheetTests/SettingsTest.php b/tests/PhpSpreadsheetTests/SettingsTest.php index 6878986a..1a1d24e7 100644 --- a/tests/PhpSpreadsheetTests/SettingsTest.php +++ b/tests/PhpSpreadsheetTests/SettingsTest.php @@ -12,13 +12,13 @@ class SettingsTest extends TestCase */ protected $prevValue; - public function setUp() + protected function setUp(): void { $this->prevValue = libxml_disable_entity_loader(); libxml_disable_entity_loader(false); // Enable entity loader } - protected function tearDown() + protected function tearDown(): void { libxml_disable_entity_loader($this->prevValue); } diff --git a/tests/PhpSpreadsheetTests/Shared/DateTest.php b/tests/PhpSpreadsheetTests/Shared/DateTest.php index 5de34702..8d844cba 100644 --- a/tests/PhpSpreadsheetTests/Shared/DateTest.php +++ b/tests/PhpSpreadsheetTests/Shared/DateTest.php @@ -55,7 +55,7 @@ class DateTest extends TestCase Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900); $result = Date::timestampToExcel(...$args); - self::assertEquals($expectedResult, $result, '', 1E-5); + self::assertEqualsWithDelta($expectedResult, $result, 1E-5); } public function providerDateTimeTimestampToExcel1900() @@ -73,7 +73,7 @@ class DateTest extends TestCase Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900); $result = Date::dateTimeToExcel(...$args); - self::assertEquals($expectedResult, $result, '', 1E-5); + self::assertEqualsWithDelta($expectedResult, $result, 1E-5); } public function providerDateTimeDateTimeToExcel() @@ -91,7 +91,7 @@ class DateTest extends TestCase Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900); $result = Date::formattedPHPToExcel(...$args); - self::assertEquals($expectedResult, $result, '', 1E-5); + self::assertEqualsWithDelta($expectedResult, $result, 1E-5); } public function providerDateTimeFormattedPHPToExcel1900() @@ -127,7 +127,7 @@ class DateTest extends TestCase Date::setExcelCalendar(Date::CALENDAR_MAC_1904); $result = Date::timestampToExcel(...$args); - self::assertEquals($expectedResult, $result, '', 1E-5); + self::assertEqualsWithDelta($expectedResult, $result, 1E-5); } public function providerDateTimeTimestampToExcel1904() diff --git a/tests/PhpSpreadsheetTests/Shared/StringHelperTest.php b/tests/PhpSpreadsheetTests/Shared/StringHelperTest.php index 61021030..fd1ec153 100644 --- a/tests/PhpSpreadsheetTests/Shared/StringHelperTest.php +++ b/tests/PhpSpreadsheetTests/Shared/StringHelperTest.php @@ -7,7 +7,7 @@ use PHPUnit\Framework\TestCase; class StringHelperTest extends TestCase { - public function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/PhpSpreadsheetTests/SpreadsheetTest.php b/tests/PhpSpreadsheetTests/SpreadsheetTest.php index 5173bf22..498ce27b 100644 --- a/tests/PhpSpreadsheetTests/SpreadsheetTest.php +++ b/tests/PhpSpreadsheetTests/SpreadsheetTest.php @@ -11,7 +11,7 @@ class SpreadsheetTest extends TestCase /** @var Spreadsheet */ private $object; - public function setUp() + protected function setUp(): void { parent::setUp(); $this->object = new Spreadsheet(); diff --git a/tests/PhpSpreadsheetTests/Style/NumberFormatTest.php b/tests/PhpSpreadsheetTests/Style/NumberFormatTest.php index fe40361b..e0ab660e 100644 --- a/tests/PhpSpreadsheetTests/Style/NumberFormatTest.php +++ b/tests/PhpSpreadsheetTests/Style/NumberFormatTest.php @@ -8,7 +8,7 @@ use PHPUnit\Framework\TestCase; class NumberFormatTest extends TestCase { - public function setUp() + protected function setUp(): void { StringHelper::setDecimalSeparator('.'); StringHelper::setThousandsSeparator(','); diff --git a/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/Column/RuleTest.php b/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/Column/RuleTest.php index b1da9b3a..4a0e5c2c 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/Column/RuleTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/Column/RuleTest.php @@ -11,7 +11,7 @@ class RuleTest extends TestCase private $mockAutoFilterColumnObject; - public function setUp() + protected function setUp(): void { $this->mockAutoFilterColumnObject = $this->getMockBuilder(Column::class) ->disableOriginalConstructor() diff --git a/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/ColumnTest.php b/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/ColumnTest.php index 855de2bc..fd462b43 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/ColumnTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/AutoFilter/ColumnTest.php @@ -13,7 +13,7 @@ class ColumnTest extends TestCase private $mockAutoFilterObject; - public function setUp() + protected function setUp(): void { $this->mockAutoFilterObject = $this->getMockBuilder(AutoFilter::class) ->disableOriginalConstructor() diff --git a/tests/PhpSpreadsheetTests/Worksheet/AutoFilterTest.php b/tests/PhpSpreadsheetTests/Worksheet/AutoFilterTest.php index aa66eb8e..c2c7f6fc 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/AutoFilterTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/AutoFilterTest.php @@ -21,7 +21,7 @@ class AutoFilterTest extends TestCase private $cellCollection; - public function setUp() + protected function setUp(): void { $this->mockWorksheetObject = $this->getMockBuilder(Worksheet::class) ->disableOriginalConstructor() diff --git a/tests/PhpSpreadsheetTests/Worksheet/ColumnCellIteratorTest.php b/tests/PhpSpreadsheetTests/Worksheet/ColumnCellIteratorTest.php index 39756740..5d4706dc 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/ColumnCellIteratorTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/ColumnCellIteratorTest.php @@ -13,7 +13,7 @@ class ColumnCellIteratorTest extends TestCase public $mockCell; - public function setUp() + protected function setUp(): void { $this->mockCell = $this->getMockBuilder(Cell::class) ->disableOriginalConstructor() diff --git a/tests/PhpSpreadsheetTests/Worksheet/ColumnIteratorTest.php b/tests/PhpSpreadsheetTests/Worksheet/ColumnIteratorTest.php index 04c626d1..eb0b1e0f 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/ColumnIteratorTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/ColumnIteratorTest.php @@ -13,7 +13,7 @@ class ColumnIteratorTest extends TestCase public $mockColumn; - public function setUp() + protected function setUp(): void { $this->mockColumn = $this->getMockBuilder(Column::class) ->disableOriginalConstructor() diff --git a/tests/PhpSpreadsheetTests/Worksheet/ColumnTest.php b/tests/PhpSpreadsheetTests/Worksheet/ColumnTest.php index b1e7b474..d8c5c997 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/ColumnTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/ColumnTest.php @@ -13,7 +13,7 @@ class ColumnTest extends TestCase public $mockColumn; - public function setUp() + protected function setUp(): void { $this->mockWorksheet = $this->getMockBuilder(Worksheet::class) ->disableOriginalConstructor() diff --git a/tests/PhpSpreadsheetTests/Worksheet/RowCellIteratorTest.php b/tests/PhpSpreadsheetTests/Worksheet/RowCellIteratorTest.php index a10c7aa5..786a0d1a 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/RowCellIteratorTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/RowCellIteratorTest.php @@ -13,7 +13,7 @@ class RowCellIteratorTest extends TestCase public $mockCell; - public function setUp() + protected function setUp(): void { $this->mockCell = $this->getMockBuilder(Cell::class) ->disableOriginalConstructor() diff --git a/tests/PhpSpreadsheetTests/Worksheet/RowIteratorTest.php b/tests/PhpSpreadsheetTests/Worksheet/RowIteratorTest.php index cb0b12d1..ea2fe351 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/RowIteratorTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/RowIteratorTest.php @@ -13,7 +13,7 @@ class RowIteratorTest extends TestCase public $mockRow; - public function setUp() + protected function setUp(): void { $this->mockRow = $this->getMockBuilder(Row::class) ->disableOriginalConstructor() diff --git a/tests/PhpSpreadsheetTests/Worksheet/RowTest.php b/tests/PhpSpreadsheetTests/Worksheet/RowTest.php index 0b2822c3..ee2dcffb 100644 --- a/tests/PhpSpreadsheetTests/Worksheet/RowTest.php +++ b/tests/PhpSpreadsheetTests/Worksheet/RowTest.php @@ -13,7 +13,7 @@ class RowTest extends TestCase public $mockRow; - public function setUp() + protected function setUp(): void { $this->mockWorksheet = $this->getMockBuilder(Worksheet::class) ->disableOriginalConstructor() diff --git a/tests/PhpSpreadsheetTests/Writer/Ods/ContentTest.php b/tests/PhpSpreadsheetTests/Writer/Ods/ContentTest.php index 0c9995af..3caaba7c 100644 --- a/tests/PhpSpreadsheetTests/Writer/Ods/ContentTest.php +++ b/tests/PhpSpreadsheetTests/Writer/Ods/ContentTest.php @@ -1,6 +1,6 @@ compatibilityMode); diff --git a/tests/PhpSpreadsheetTests/Writer/Xls/FormulaErrTest.php b/tests/PhpSpreadsheetTests/Writer/Xls/FormulaErrTest.php index 2c615b72..affb917f 100644 --- a/tests/PhpSpreadsheetTests/Writer/Xls/FormulaErrTest.php +++ b/tests/PhpSpreadsheetTests/Writer/Xls/FormulaErrTest.php @@ -1,6 +1,6 @@ currentLocale = setlocale(LC_ALL, '0'); @@ -23,7 +23,7 @@ class LocaleFloatsTest extends TestCase $this->localeAdjusted = true; } - public function tearDown() + protected function tearDown(): void { if ($this->localeAdjusted) { setlocale(LC_ALL, $this->currentLocale); diff --git a/tests/PhpSpreadsheetTests/Writer/Xlsx/UnparsedDataTest.php b/tests/PhpSpreadsheetTests/Writer/Xlsx/UnparsedDataTest.php index 0717fa82..8e0d654f 100644 --- a/tests/PhpSpreadsheetTests/Writer/Xlsx/UnparsedDataTest.php +++ b/tests/PhpSpreadsheetTests/Writer/Xlsx/UnparsedDataTest.php @@ -45,15 +45,15 @@ class UnparsedDataTest extends TestCase unlink($resultFilename); // [Content_Types].xml - $this->assertContains('application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings', $resultContentTypesRaw, 'Content type for printerSettings not found!'); - $this->assertContains('application/vnd.ms-office.vbaProject', $resultContentTypesRaw, 'Content type for VbaProject not found!'); - $this->assertContains('application/vnd.ms-excel.controlproperties+xml', $resultContentTypesRaw, 'Content type for ctrlProp not found!'); + $this->assertStringContainsString('application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings', $resultContentTypesRaw, 'Content type for printerSettings not found!'); + $this->assertStringContainsString('application/vnd.ms-office.vbaProject', $resultContentTypesRaw, 'Content type for VbaProject not found!'); + $this->assertStringContainsString('application/vnd.ms-excel.controlproperties+xml', $resultContentTypesRaw, 'Content type for ctrlProp not found!'); // xl/ctrlProps/ctrlProp1.xml $this->assertNotEmpty($resultControlPropRaw, 'ctrlProp not found!'); // xl/drawings/drawing1.xml - $this->assertContains('assertStringContainsString('assertNotEmpty($resultVmlDrawingRaw, 'vmlDrawing not found!'); @@ -78,12 +78,12 @@ class UnparsedDataTest extends TestCase unset($xmlWorkbook); // xl/worksheets/_rels/sheet1.xml.rels - $this->assertContains('http://schemas.openxmlformats.org/officeDocument/2006/relationships/printerSettings', $resultSheet1RelsRaw, 'Sheet relation with printerSettings not found!'); - $this->assertContains('http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing', $resultSheet1RelsRaw, 'Sheet relation with vmlDrawing not found!'); - $this->assertContains('http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp', $resultSheet1RelsRaw, 'Sheet relation with ctrlProp not found!'); + $this->assertStringContainsString('http://schemas.openxmlformats.org/officeDocument/2006/relationships/printerSettings', $resultSheet1RelsRaw, 'Sheet relation with printerSettings not found!'); + $this->assertStringContainsString('http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing', $resultSheet1RelsRaw, 'Sheet relation with vmlDrawing not found!'); + $this->assertStringContainsString('http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp', $resultSheet1RelsRaw, 'Sheet relation with ctrlProp not found!'); // xl/worksheets/sheet1.xml - $this->assertContains('assertStringContainsString('pageSetup->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'); $this->assertTrue(isset($pageSetupAttributes->id), 'sheet1.xml/pageSetup[r:id] not found!'); From b07cd2028dd2454cbcfeff9a70d41761bc77f054 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Mon, 27 Apr 2020 20:21:07 +0900 Subject: [PATCH 37/38] Don't patch PHPUnit for phpcov --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f4abffd1..2e51c7a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,8 +32,6 @@ jobs: php: 7.4 script: - pecl install pcov - - composer require pcov/clobber --dev - - ./vendor/bin/pcov clobber - ./vendor/bin/phpunit --coverage-clover coverage-clover.xml after_script: - wget https://scrutinizer-ci.com/ocular.phar From 385b83362f845f5758ce2933adf8edb6a59b8887 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Mon, 27 Apr 2020 21:16:53 +0900 Subject: [PATCH 38/38] Keep PHPUnit result out of project --- phpunit.xml.dist | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index be3643d8..90b66acd 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -4,7 +4,9 @@ xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.5/phpunit.xsd" bootstrap="./tests/bootstrap.php" backupGlobals="true" - colors="true"> + colors="true" + cacheResultFile="/tmp/.phpspreadsheet.phpunit.result.cache" +>