diff --git a/CHANGELOG.md b/CHANGELOG.md index d031bc1ad2..b743aa805f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,29 @@ 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). +## TBD - 2.2.0 + +### Added + +- Nothing + +### Changed + +- Nothing + +### Deprecated + +- Nothing + +### Moved + +- Nothing + +### Fixed + +- Incorrect Reader CSV with BOM. [Issue #4028](https://github.com/PHPOffice/PhpSpreadsheet/issues/4028) [PR #4029](https://github.com/PHPOffice/PhpSpreadsheet/pull/4029) +- POWER Null/Bool Args. [PR #4031](https://github.com/PHPOffice/PhpSpreadsheet/pull/4031) + ## 2024-05-11 - 2.1.0 ### MINOR BREAKING CHANGE diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Operations.php b/src/PhpSpreadsheet/Calculation/MathTrig/Operations.php index 9c4a6f44a5..0eca549b96 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Operations.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Operations.php @@ -52,14 +52,14 @@ public static function mod(mixed $dividend, mixed $divisor): array|string|float * * Computes x raised to the power y. * - * @param array|float|int|string $x Or can be an array of values - * @param array|float|int|string $y Or can be an array of values + * @param null|array|bool|float|int|string $x Or can be an array of values + * @param null|array|bool|float|int|string $y Or can be an array of values * * @return array|float|int|string The result, or a string containing an error * If an array of numbers is passed as an argument, then the returned result will also be an array * with the same dimensions */ - public static function power(array|float|int|string $x, array|float|int|string $y): array|float|int|string + public static function power(null|array|bool|float|int|string $x, null|array|bool|float|int|string $y): array|float|int|string { if (is_array($x) || is_array($y)) { return self::evaluateArrayArguments([self::class, __FUNCTION__], $x, $y); diff --git a/tests/data/Calculation/MathTrig/POWER.php b/tests/data/Calculation/MathTrig/POWER.php index a89e202d2d..3cca923cd1 100644 --- a/tests/data/Calculation/MathTrig/POWER.php +++ b/tests/data/Calculation/MathTrig/POWER.php @@ -410,4 +410,9 @@ ], ['#VALUE!', 'x', 2], ['#VALUE!', 2, 'x'], + 'exponent is null' => [1, 2, null], + 'base is null' => [0, null, 2], + 'both null' => ['#NUM!', null, null], + 'exponent is bool' => [2, 2, true], + 'base is bool' => [0, false, 2], ];