From 770eddf69de9cf623d0f990d066bcff33d899639 Mon Sep 17 00:00:00 2001 From: oleibman <10341515+oleibman@users.noreply.github.com> Date: Thu, 15 May 2025 08:19:39 -0700 Subject: [PATCH] Still More Prep for Phpstan 10 Remaining: - Calculation/LookupRef - Calculation/Statistical - Shared/OLE - Odds and ends --- phpstan-baseline.neon | 59 -------------- phpstan.neon.dist | 1 + .../Calculation/Engineering/BesselI.php | 2 +- .../Calculation/Engineering/BesselJ.php | 2 +- .../Calculation/Engineering/BesselK.php | 2 +- .../Calculation/Engineering/BesselY.php | 2 +- .../Calculation/Engineering/BitWise.php | 30 +++---- .../Calculation/Engineering/Compare.php | 12 +-- .../Calculation/Engineering/Complex.php | 10 +-- .../Engineering/ComplexFunctions.php | 78 +++++++++---------- .../Engineering/ComplexOperations.php | 12 +-- .../Calculation/Engineering/ConvertBinary.php | 16 ++-- .../Engineering/ConvertDecimal.php | 18 ++--- .../Calculation/Engineering/ConvertHex.php | 16 ++-- .../Calculation/Engineering/ConvertOctal.php | 16 ++-- .../Calculation/Engineering/Erf.php | 4 +- .../Calculation/Engineering/ErfC.php | 2 +- .../Calculation/MathTrig/Absolute.php | 2 +- .../Calculation/MathTrig/Angle.php | 4 +- .../Calculation/MathTrig/Arabic.php | 4 +- .../Calculation/MathTrig/Base.php | 2 +- .../Calculation/MathTrig/Combinations.php | 4 +- .../Calculation/MathTrig/Exp.php | 2 +- .../Calculation/MathTrig/Factorial.php | 12 +-- .../Calculation/MathTrig/IntClass.php | 4 +- .../Calculation/MathTrig/Lcm.php | 14 +++- .../Calculation/MathTrig/Logarithms.php | 6 +- .../Calculation/MathTrig/MatrixFunctions.php | 8 +- .../Calculation/MathTrig/Operations.php | 10 +-- .../Calculation/MathTrig/Random.php | 4 +- .../Calculation/MathTrig/Roman.php | 2 +- .../Calculation/MathTrig/Round.php | 24 +++--- .../Calculation/MathTrig/SeriesSum.php | 2 +- .../Calculation/MathTrig/Sign.php | 4 +- .../Calculation/MathTrig/Sqrt.php | 6 +- .../Calculation/MathTrig/Subtotal.php | 10 +++ .../Calculation/MathTrig/Sum.php | 5 ++ .../Calculation/MathTrig/SumSquares.php | 10 +++ .../Calculation/MathTrig/Trig/Cosecant.php | 8 +- .../Calculation/MathTrig/Trig/Cosine.php | 12 +-- .../Calculation/MathTrig/Trig/Cotangent.php | 16 ++-- .../Calculation/MathTrig/Trig/Secant.php | 8 +- .../Calculation/MathTrig/Trig/Sine.php | 12 +-- .../Calculation/MathTrig/Trig/Tangent.php | 14 ++-- .../Calculation/MathTrig/Trunc.php | 6 +- .../Calculation/Statistical/Maximum.php | 2 + .../Calculation/Statistical/Minimum.php | 2 + .../Calculation/TextData/Extract.php | 4 +- .../Calculation/TextData/Text.php | 3 +- .../Functions/Engineering/BesselITest.php | 12 +-- .../Functions/Engineering/BesselJTest.php | 12 +-- .../Functions/Engineering/BesselKTest.php | 12 +-- .../Functions/Engineering/BesselYTest.php | 12 +-- .../Functions/Engineering/Bin2DecTest.php | 1 + .../Functions/Engineering/Bin2HexTest.php | 14 ++-- .../Functions/Engineering/Bin2OctTest.php | 14 ++-- .../Functions/Engineering/BitAndTest.php | 12 +-- .../Functions/Engineering/BitLShiftTest.php | 12 +-- .../Functions/Engineering/BitOrTest.php | 12 +-- .../Functions/Engineering/BitRShiftTest.php | 12 +-- .../Functions/Engineering/BitXorTest.php | 12 +-- .../Functions/Engineering/ComplexTest.php | 10 ++- .../Functions/Engineering/Dec2BinTest.php | 14 ++-- .../Functions/Engineering/Dec2HexTest.php | 14 ++-- .../Functions/Engineering/Dec2OctTest.php | 14 ++-- .../Functions/Engineering/ImCscTest.php | 12 +-- .../Functions/Engineering/ImSqrtTest.php | 12 +-- .../Functions/Engineering/ImSubTest.php | 12 +-- .../Functions/Engineering/ImSumTest.php | 9 ++- .../Functions/Engineering/ImTanTest.php | 12 +-- .../Functions/Engineering/ImaginaryTest.php | 12 +-- .../Functions/Engineering/Oct2BinTest.php | 14 ++-- .../Functions/Engineering/Oct2DecTest.php | 1 + .../Functions/Engineering/Oct2HexTest.php | 14 ++-- .../Functions/MathTrig/MInverseTest.php | 4 +- .../Functions/MathTrig/MdeTermTest.php | 5 +- .../Functions/MathTrig/SumIfTest.php | 4 + .../Functions/MathTrig/SumX2MY2Test.php | 7 +- .../Functions/MathTrig/SumX2PY2Test.php | 7 +- .../Functions/MathTrig/SumXMY2Test.php | 7 +- 80 files changed, 443 insertions(+), 386 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 42ed0dbcf..364905f71 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,61 +1,2 @@ parameters: ignoreErrors: - - - message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig\\Sum\:\:sumErroringStrings\(\) should return array\|float\|int\|string but returns mixed\.$#' - identifier: return.type - count: 1 - path: src/PhpSpreadsheet/Calculation/MathTrig/Sum.php - - - - message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig\\Sum\:\:sumIgnoringStrings\(\) should return float\|int\|string but returns mixed\.$#' - identifier: return.type - count: 1 - path: src/PhpSpreadsheet/Calculation/MathTrig/Sum.php - - - - message: '#^Binary operation "\*" between mixed and mixed results in an error\.$#' - identifier: binaryOp.invalid - count: 4 - path: src/PhpSpreadsheet/Calculation/MathTrig/SumSquares.php - - - - message: '#^Binary operation "\-" between mixed and mixed results in an error\.$#' - identifier: binaryOp.invalid - count: 2 - path: src/PhpSpreadsheet/Calculation/MathTrig/SumSquares.php - - - - message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical\\Maximum\:\:max\(\) should return float\|int\|string but returns mixed\.$#' - identifier: return.type - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical/Maximum.php - - - - message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical\\Maximum\:\:maxA\(\) should return float\|int\|string but returns mixed\.$#' - identifier: return.type - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical/Maximum.php - - - - message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical\\Minimum\:\:min\(\) should return float\|int\|string but returns mixed\.$#' - identifier: return.type - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical/Minimum.php - - - - message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical\\Minimum\:\:minA\(\) should return float\|int\|string but returns mixed\.$#' - identifier: return.type - count: 1 - path: src/PhpSpreadsheet/Calculation/Statistical/Minimum.php - - - - message: '#^Parameter \#1 \$str of function preg_quote expects string, mixed given\.$#' - identifier: argument.type - count: 1 - path: src/PhpSpreadsheet/Calculation/TextData/Extract.php - - - - message: '#^Parameter \#1 \$str of function preg_quote expects string, mixed given\.$#' - identifier: argument.type - count: 1 - path: src/PhpSpreadsheet/Calculation/TextData/Text.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 2ac767d2f..08a0c6ab8 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -29,4 +29,5 @@ parameters: - '~^Parameter \#2 .* of static method PHPUnit\\Framework\\Assert\:\:assert\w+\(\) expects .*, .* given\.$~' #- '~Method .*rovider.* return type has no value type specified in iterable type array\.$~' #- '~Method .*rovider.* should return array but returns mixed\.$~' + #- '~.* has parameter \$expectedResult with no value type specified in iterable type array\.$~' - identifier: missingType.iterableValue diff --git a/src/PhpSpreadsheet/Calculation/Engineering/BesselI.php b/src/PhpSpreadsheet/Calculation/Engineering/BesselI.php index 5d564a05a..7f67806c3 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/BesselI.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/BesselI.php @@ -31,7 +31,7 @@ class BesselI * If $ord < 0, BESSELI returns the #NUM! error value. * Or can be an array of values * - * @return array|float|string Result, or a string containing an error + * @return array|float|string 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 */ diff --git a/src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php b/src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php index 4a9d9ffdc..58ae25844 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php @@ -30,7 +30,7 @@ class BesselJ * If $ord < 0, BESSELJ returns the #NUM! error value. * Or can be an array of values * - * @return array|float|string Result, or a string containing an error + * @return array|float|string 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 */ diff --git a/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php b/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php index 5a9bd54c1..13e85cbe7 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/BesselK.php @@ -28,7 +28,7 @@ class BesselK * If $ord < 0, BESSELKI returns the #NUM! error value. * Or can be an array of values * - * @return array|float|string Result, or a string containing an error + * @return array|float|string 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 */ diff --git a/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php b/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php index 5d99638a5..c65a01bce 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/BesselY.php @@ -27,7 +27,7 @@ class BesselY * If $ord < 0, BESSELY returns the #NUM! error value. * Or can be an array of values * - * @return array|float|string Result, or a string containing an error + * @return array|float|string 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 */ diff --git a/src/PhpSpreadsheet/Calculation/Engineering/BitWise.php b/src/PhpSpreadsheet/Calculation/Engineering/BitWise.php index 47d94eccf..65192bf9a 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/BitWise.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/BitWise.php @@ -30,10 +30,10 @@ class BitWise * Excel Function: * BITAND(number1, number2) * - * @param null|array|bool|float|int|string $number1 Or can be an array of values - * @param null|array|bool|float|int|string $number2 Or can be an array of values + * @param null|array|bool|float|int|string $number1 Or can be an array of values + * @param null|array|bool|float|int|string $number2 Or can be an array of values * - * @return array|int|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|int|string 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 BITAND(null|array|bool|float|int|string $number1, null|array|bool|float|int|string $number2): array|string|int|float @@ -62,10 +62,10 @@ class BitWise * Excel Function: * BITOR(number1, number2) * - * @param null|array|bool|float|int|string $number1 Or can be an array of values - * @param null|array|bool|float|int|string $number2 Or can be an array of values + * @param null|array|bool|float|int|string $number1 Or can be an array of values + * @param null|array|bool|float|int|string $number2 Or can be an array of values * - * @return array|int|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|int|string 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 BITOR(null|array|bool|float|int|string $number1, null|array|bool|float|int|string $number2): array|string|int|float @@ -95,10 +95,10 @@ class BitWise * Excel Function: * BITXOR(number1, number2) * - * @param null|array|bool|float|int|string $number1 Or can be an array of values - * @param null|array|bool|float|int|string $number2 Or can be an array of values + * @param null|array|bool|float|int|string $number1 Or can be an array of values + * @param null|array|bool|float|int|string $number2 Or can be an array of values * - * @return array|int|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|int|string 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 BITXOR(null|array|bool|float|int|string $number1, null|array|bool|float|int|string $number2): array|string|int|float @@ -128,10 +128,10 @@ class BitWise * Excel Function: * BITLSHIFT(number, shift_amount) * - * @param null|array|bool|float|int|string $number Or can be an array of values - * @param null|array|bool|float|int|string $shiftAmount Or can be an array of values + * @param null|array|bool|float|int|string $number Or can be an array of values + * @param null|array|bool|float|int|string $shiftAmount Or can be an array of values * - * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|float|string 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 BITLSHIFT(null|array|bool|float|int|string $number, null|array|bool|float|int|string $shiftAmount): array|string|float @@ -163,10 +163,10 @@ class BitWise * Excel Function: * BITRSHIFT(number, shift_amount) * - * @param null|array|bool|float|int|string $number Or can be an array of values - * @param null|array|bool|float|int|string $shiftAmount Or can be an array of values + * @param null|array|bool|float|int|string $number Or can be an array of values + * @param null|array|bool|float|int|string $shiftAmount Or can be an array of values * - * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|float|string 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 BITRSHIFT(null|array|bool|float|int|string $number, null|array|bool|float|int|string $shiftAmount): array|string|float diff --git a/src/PhpSpreadsheet/Calculation/Engineering/Compare.php b/src/PhpSpreadsheet/Calculation/Engineering/Compare.php index 9e3275fc2..ac7ef5140 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/Compare.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/Compare.php @@ -20,12 +20,12 @@ class Compare * functions you calculate the count of equal pairs. This function is also known as the * Kronecker Delta function. * - * @param array|bool|float|int|string $a the first number + * @param array|bool|float|int|string $a the first number * Or can be an array of values - * @param array|bool|float|int|string $b The second number. If omitted, b is assumed to be zero. + * @param array|bool|float|int|string $b The second number. If omitted, b is assumed to be zero. * Or can be an array of values * - * @return array|int|string (string in the event of an error) + * @return array|int|string (string in the event of 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 */ @@ -55,12 +55,12 @@ class Compare * Use this function to filter a set of values. For example, by summing several GESTEP * functions you calculate the count of values that exceed a threshold. * - * @param array|bool|float|int|string $number the value to test against step + * @param array|bool|float|int|string $number the value to test against step * Or can be an array of values - * @param null|array|bool|float|int|string $step The threshold value. If you omit a value for step, GESTEP uses zero. + * @param null|array|bool|float|int|string $step The threshold value. If you omit a value for step, GESTEP uses zero. * Or can be an array of values * - * @return array|int|string (string in the event of an error) + * @return array|int|string (string in the event of 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 */ diff --git a/src/PhpSpreadsheet/Calculation/Engineering/Complex.php b/src/PhpSpreadsheet/Calculation/Engineering/Complex.php index 3e41371be..83d110c21 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/Complex.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/Complex.php @@ -28,7 +28,7 @@ class Complex * If omitted, the suffix is assumed to be "i". * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 COMPLEX(mixed $realNumber = 0.0, mixed $imaginary = 0.0, mixed $suffix = 'i'): array|string @@ -65,11 +65,11 @@ class Complex * Excel Function: * IMAGINARY(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the imaginary + * @param array|string $complexNumber the complex number for which you want the imaginary * coefficient * Or can be an array of values * - * @return array|float|string (string if an error) + * @return array|float|string (string if 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 */ @@ -96,10 +96,10 @@ class Complex * Excel Function: * IMREAL(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the real coefficient + * @param array|string $complexNumber the complex number for which you want the real coefficient * Or can be an array of values * - * @return array|float|string (string if an error) + * @return array|float|string (string if 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 */ diff --git a/src/PhpSpreadsheet/Calculation/Engineering/ComplexFunctions.php b/src/PhpSpreadsheet/Calculation/Engineering/ComplexFunctions.php index d1b7764af..5dd51be9f 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/ComplexFunctions.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/ComplexFunctions.php @@ -19,10 +19,10 @@ class ComplexFunctions * Excel Function: * IMABS(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the absolute value + * @param array|string $complexNumber the complex number for which you want the absolute value * Or can be an array of values * - * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|float|string 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 IMABS(array|string $complexNumber): array|float|string @@ -49,10 +49,10 @@ class ComplexFunctions * Excel Function: * IMARGUMENT(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the argument theta + * @param array|string $complexNumber the complex number for which you want the argument theta * Or can be an array of values * - * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|float|string 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 IMARGUMENT(array|string $complexNumber): array|float|string @@ -82,10 +82,10 @@ class ComplexFunctions * Excel Function: * IMCONJUGATE(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the conjugate + * @param array|string $complexNumber the complex number for which you want the conjugate * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMCONJUGATE(array|string $complexNumber): array|string @@ -111,10 +111,10 @@ class ComplexFunctions * Excel Function: * IMCOS(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the cosine + * @param array|string $complexNumber the complex number for which you want the cosine * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMCOS(array|string $complexNumber): array|string @@ -140,10 +140,10 @@ class ComplexFunctions * Excel Function: * IMCOSH(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the hyperbolic cosine + * @param array|string $complexNumber the complex number for which you want the hyperbolic cosine * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMCOSH(array|string $complexNumber): array|string @@ -169,10 +169,10 @@ class ComplexFunctions * Excel Function: * IMCOT(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the cotangent + * @param array|string $complexNumber the complex number for which you want the cotangent * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMCOT(array|string $complexNumber): array|string @@ -198,10 +198,10 @@ class ComplexFunctions * Excel Function: * IMCSC(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the cosecant + * @param array|string $complexNumber the complex number for which you want the cosecant * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMCSC(array|string $complexNumber): array|string @@ -227,10 +227,10 @@ class ComplexFunctions * Excel Function: * IMCSCH(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the hyperbolic cosecant + * @param array|string $complexNumber the complex number for which you want the hyperbolic cosecant * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMCSCH(array|string $complexNumber): array|string @@ -256,10 +256,10 @@ class ComplexFunctions * Excel Function: * IMSIN(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the sine + * @param array|string $complexNumber the complex number for which you want the sine * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMSIN(array|string $complexNumber): array|string @@ -285,10 +285,10 @@ class ComplexFunctions * Excel Function: * IMSINH(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the hyperbolic sine + * @param array|string $complexNumber the complex number for which you want the hyperbolic sine * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMSINH(array|string $complexNumber): array|string @@ -314,10 +314,10 @@ class ComplexFunctions * Excel Function: * IMSEC(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the secant + * @param array|string $complexNumber the complex number for which you want the secant * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMSEC(array|string $complexNumber): array|string @@ -343,10 +343,10 @@ class ComplexFunctions * Excel Function: * IMSECH(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the hyperbolic secant + * @param array|string $complexNumber the complex number for which you want the hyperbolic secant * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMSECH(array|string $complexNumber): array|string @@ -372,10 +372,10 @@ class ComplexFunctions * Excel Function: * IMTAN(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the tangent + * @param array|string $complexNumber the complex number for which you want the tangent * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMTAN(array|string $complexNumber): array|string @@ -401,10 +401,10 @@ class ComplexFunctions * Excel Function: * IMSQRT(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the square root + * @param array|string $complexNumber the complex number for which you want the square root * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMSQRT(array|string $complexNumber): array|string @@ -435,10 +435,10 @@ class ComplexFunctions * Excel Function: * IMLN(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the natural logarithm + * @param array|string $complexNumber the complex number for which you want the natural logarithm * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMLN(array|string $complexNumber): array|string @@ -468,10 +468,10 @@ class ComplexFunctions * Excel Function: * IMLOG10(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the common logarithm + * @param array|string $complexNumber the complex number for which you want the common logarithm * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMLOG10(array|string $complexNumber): array|string @@ -501,10 +501,10 @@ class ComplexFunctions * Excel Function: * IMLOG2(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the base-2 logarithm + * @param array|string $complexNumber the complex number for which you want the base-2 logarithm * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMLOG2(array|string $complexNumber): array|string @@ -534,10 +534,10 @@ class ComplexFunctions * Excel Function: * IMEXP(complexNumber) * - * @param array|string $complexNumber the complex number for which you want the exponential + * @param array|string $complexNumber the complex number for which you want the exponential * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMEXP(array|string $complexNumber): array|string @@ -563,12 +563,12 @@ class ComplexFunctions * Excel Function: * IMPOWER(complexNumber,realNumber) * - * @param array|string $complexNumber the complex number you want to raise to a power + * @param array|string $complexNumber the complex number you want to raise to a power * Or can be an array of values - * @param array|float|int|string $realNumber the power to which you want to raise the complex number + * @param array|float|int|string $realNumber the power to which you want to raise the complex number * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMPOWER(array|string $complexNumber, array|float|int|string $realNumber): array|string diff --git a/src/PhpSpreadsheet/Calculation/Engineering/ComplexOperations.php b/src/PhpSpreadsheet/Calculation/Engineering/ComplexOperations.php index 61efa8476..ed66bea1e 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/ComplexOperations.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/ComplexOperations.php @@ -20,12 +20,12 @@ class ComplexOperations * Excel Function: * IMDIV(complexDividend,complexDivisor) * - * @param array|string $complexDividend the complex numerator or dividend + * @param array|string $complexDividend the complex numerator or dividend * Or can be an array of values - * @param array|string $complexDivisor the complex denominator or divisor + * @param array|string $complexDivisor the complex denominator or divisor * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMDIV(array|string $complexDividend, array|string $complexDivisor): array|string @@ -49,12 +49,12 @@ class ComplexOperations * Excel Function: * IMSUB(complexNumber1,complexNumber2) * - * @param array|string $complexNumber1 the complex number from which to subtract complexNumber2 + * @param array|string $complexNumber1 the complex number from which to subtract complexNumber2 * Or can be an array of values - * @param array|string $complexNumber2 the complex number to subtract from complexNumber1 + * @param array|string $complexNumber2 the complex number to subtract from complexNumber1 * Or can be an array of values * - * @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|string 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 IMSUB(array|string $complexNumber1, array|string $complexNumber2): array|string diff --git a/src/PhpSpreadsheet/Calculation/Engineering/ConvertBinary.php b/src/PhpSpreadsheet/Calculation/Engineering/ConvertBinary.php index 7236228da..3b84ce3a7 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/ConvertBinary.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/ConvertBinary.php @@ -15,7 +15,7 @@ class ConvertBinary extends ConvertBase * Excel Function: * BIN2DEC(x) * - * @param array|bool|float|int|string $value The binary number (as a string) that you want to convert. The number + * @param array|bool|float|int|string $value The binary number (as a string) that you want to convert. The number * cannot contain more than 10 characters (10 bits). The most significant * bit of number is the sign bit. The remaining 9 bits are magnitude bits. * Negative numbers are represented using two's-complement notation. @@ -23,7 +23,7 @@ class ConvertBinary extends ConvertBase * 10 characters (10 bits), BIN2DEC returns the #NUM! error value. * Or can be an array of values * - * @return array|float|int|string Result, or an error + * @return array|float|int|string Result, or 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 */ @@ -58,14 +58,14 @@ class ConvertBinary extends ConvertBase * Excel Function: * BIN2HEX(x[,places]) * - * @param array|bool|float|int|string $value The binary number (as a string) that you want to convert. The number + * @param array|bool|float|int|string $value The binary number (as a string) that you want to convert. The number * cannot contain more than 10 characters (10 bits). The most significant * bit of number is the sign bit. The remaining 9 bits are magnitude bits. * Negative numbers are represented using two's-complement notation. * If number is not a valid binary number, or if number contains more than * 10 characters (10 bits), BIN2HEX returns the #NUM! error value. * Or can be an array of values - * @param null|array|float|int|string $places The number of characters to use. If places is omitted, BIN2HEX uses the + * @param null|array|float|int|string $places The number of characters to use. If places is omitted, BIN2HEX uses the * minimum number of characters necessary. Places is useful for padding the * return value with leading 0s (zeros). * If places is not an integer, it is truncated. @@ -73,7 +73,7 @@ class ConvertBinary extends ConvertBase * If places is negative, BIN2HEX returns the #NUM! error value. * Or can be an array of values * - * @return array|string Result, or an error + * @return array|string Result, or 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 */ @@ -111,14 +111,14 @@ class ConvertBinary extends ConvertBase * Excel Function: * BIN2OCT(x[,places]) * - * @param array|bool|float|int|string $value The binary number (as a string) that you want to convert. The number + * @param array|bool|float|int|string $value The binary number (as a string) that you want to convert. The number * cannot contain more than 10 characters (10 bits). The most significant * bit of number is the sign bit. The remaining 9 bits are magnitude bits. * Negative numbers are represented using two's-complement notation. * If number is not a valid binary number, or if number contains more than * 10 characters (10 bits), BIN2OCT returns the #NUM! error value. * Or can be an array of values - * @param null|array|float|int|string $places The number of characters to use. If places is omitted, BIN2OCT uses the + * @param null|array|float|int|string $places The number of characters to use. If places is omitted, BIN2OCT uses the * minimum number of characters necessary. Places is useful for padding the * return value with leading 0s (zeros). * If places is not an integer, it is truncated. @@ -126,7 +126,7 @@ class ConvertBinary extends ConvertBase * If places is negative, BIN2OCT returns the #NUM! error value. * Or can be an array of values * - * @return array|string Result, or an error + * @return array|string Result, or 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 */ diff --git a/src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php b/src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php index 923caa96d..9834bccbb 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php @@ -22,7 +22,7 @@ class ConvertDecimal extends ConvertBase * Excel Function: * DEC2BIN(x[,places]) * - * @param array|bool|float|int|string $value The decimal integer you want to convert. If number is negative, + * @param array|bool|float|int|string $value The decimal integer you want to convert. If number is negative, * valid place values are ignored and DEC2BIN returns a 10-character * (10-bit) binary number in which the most significant bit is the sign * bit. The remaining 9 bits are magnitude bits. Negative numbers are @@ -33,7 +33,7 @@ class ConvertDecimal extends ConvertBase * If DEC2BIN requires more than places characters, it returns the #NUM! * error value. * Or can be an array of values - * @param null|array|float|int|string $places The number of characters to use. If places is omitted, DEC2BIN uses + * @param null|array|float|int|string $places The number of characters to use. If places is omitted, DEC2BIN uses * the minimum number of characters necessary. Places is useful for * padding the return value with leading 0s (zeros). * If places is not an integer, it is truncated. @@ -41,7 +41,7 @@ class ConvertDecimal extends ConvertBase * If places is zero or negative, DEC2BIN returns the #NUM! error value. * Or can be an array of values * - * @return array|string Result, or an error + * @return array|string Result, or 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 */ @@ -79,7 +79,7 @@ class ConvertDecimal extends ConvertBase * Excel Function: * DEC2HEX(x[,places]) * - * @param array|bool|float|int|string $value The decimal integer you want to convert. If number is negative, + * @param array|bool|float|int|string $value The decimal integer you want to convert. If number is negative, * places is ignored and DEC2HEX returns a 10-character (40-bit) * hexadecimal number in which the most significant bit is the sign * bit. The remaining 39 bits are magnitude bits. Negative numbers @@ -90,7 +90,7 @@ class ConvertDecimal extends ConvertBase * If DEC2HEX requires more than places characters, it returns the * #NUM! error value. * Or can be an array of values - * @param null|array|float|int|string $places The number of characters to use. If places is omitted, DEC2HEX uses + * @param null|array|float|int|string $places The number of characters to use. If places is omitted, DEC2HEX uses * the minimum number of characters necessary. Places is useful for * padding the return value with leading 0s (zeros). * If places is not an integer, it is truncated. @@ -98,7 +98,7 @@ class ConvertDecimal extends ConvertBase * If places is zero or negative, DEC2HEX returns the #NUM! error value. * Or can be an array of values * - * @return array|string Result, or an error + * @return array|string Result, or 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 */ @@ -155,7 +155,7 @@ class ConvertDecimal extends ConvertBase * Excel Function: * DEC2OCT(x[,places]) * - * @param array|bool|float|int|string $value The decimal integer you want to convert. If number is negative, + * @param array|bool|float|int|string $value The decimal integer you want to convert. If number is negative, * places is ignored and DEC2OCT returns a 10-character (30-bit) * octal number in which the most significant bit is the sign bit. * The remaining 29 bits are magnitude bits. Negative numbers are @@ -166,7 +166,7 @@ class ConvertDecimal extends ConvertBase * If DEC2OCT requires more than places characters, it returns the * #NUM! error value. * Or can be an array of values - * @param array|int $places The number of characters to use. If places is omitted, DEC2OCT uses + * @param array|int $places The number of characters to use. If places is omitted, DEC2OCT uses * the minimum number of characters necessary. Places is useful for * padding the return value with leading 0s (zeros). * If places is not an integer, it is truncated. @@ -174,7 +174,7 @@ class ConvertDecimal extends ConvertBase * If places is zero or negative, DEC2OCT returns the #NUM! error value. * Or can be an array of values * - * @return array|string Result, or an error + * @return array|string Result, or 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 */ diff --git a/src/PhpSpreadsheet/Calculation/Engineering/ConvertHex.php b/src/PhpSpreadsheet/Calculation/Engineering/ConvertHex.php index fa3937410..be8ed39f9 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/ConvertHex.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/ConvertHex.php @@ -15,7 +15,7 @@ class ConvertHex extends ConvertBase * Excel Function: * HEX2BIN(x[,places]) * - * @param array|bool|float|string $value The hexadecimal number you want to convert. + * @param array|bool|float|string $value The hexadecimal number you want to convert. * Number cannot contain more than 10 characters. * The most significant bit of number is the sign bit (40th bit from the right). * The remaining 9 bits are magnitude bits. @@ -26,7 +26,7 @@ class ConvertHex extends ConvertBase * If number is not a valid hexadecimal number, HEX2BIN returns the #NUM! error value. * If HEX2BIN requires more than places characters, it returns the #NUM! error value. * Or can be an array of values - * @param array|int $places The number of characters to use. If places is omitted, + * @param array|int $places The number of characters to use. If places is omitted, * HEX2BIN uses the minimum number of characters necessary. Places * is useful for padding the return value with leading 0s (zeros). * If places is not an integer, it is truncated. @@ -34,7 +34,7 @@ class ConvertHex extends ConvertBase * If places is negative, HEX2BIN returns the #NUM! error value. * Or can be an array of values * - * @return array|string Result, or an error + * @return array|string Result, or 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 */ @@ -65,7 +65,7 @@ class ConvertHex extends ConvertBase * Excel Function: * HEX2DEC(x) * - * @param array|bool|float|int|string $value The hexadecimal number you want to convert. This number cannot + * @param array|bool|float|int|string $value The hexadecimal number you want to convert. This number cannot * contain more than 10 characters (40 bits). The most significant * bit of number is the sign bit. The remaining 39 bits are magnitude * bits. Negative numbers are represented using two's-complement @@ -74,7 +74,7 @@ class ConvertHex extends ConvertBase * #NUM! error value. * Or can be an array of values * - * @return array|float|int|string Result, or an error + * @return array|float|int|string Result, or 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 */ @@ -118,7 +118,7 @@ class ConvertHex extends ConvertBase * Excel Function: * HEX2OCT(x[,places]) * - * @param array|bool|float|int|string $value The hexadecimal number you want to convert. Number cannot + * @param array|bool|float|int|string $value The hexadecimal number you want to convert. Number cannot * contain more than 10 characters. The most significant bit of * number is the sign bit. The remaining 39 bits are magnitude * bits. Negative numbers are represented using two's-complement @@ -132,7 +132,7 @@ class ConvertHex extends ConvertBase * If HEX2OCT requires more than places characters, it returns * the #NUM! error value. * Or can be an array of values - * @param array|int $places The number of characters to use. If places is omitted, HEX2OCT + * @param array|int $places The number of characters to use. If places is omitted, HEX2OCT * uses the minimum number of characters necessary. Places is * useful for padding the return value with leading 0s (zeros). * If places is not an integer, it is truncated. @@ -141,7 +141,7 @@ class ConvertHex extends ConvertBase * If places is negative, HEX2OCT returns the #NUM! error value. * Or can be an array of values * - * @return array|string Result, or an error + * @return array|string Result, or 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 */ diff --git a/src/PhpSpreadsheet/Calculation/Engineering/ConvertOctal.php b/src/PhpSpreadsheet/Calculation/Engineering/ConvertOctal.php index 5ff55aef0..03a906d06 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/ConvertOctal.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/ConvertOctal.php @@ -15,7 +15,7 @@ class ConvertOctal extends ConvertBase * Excel Function: * OCT2BIN(x[,places]) * - * @param array|bool|float|int|string $value The octal number you want to convert. Number may not + * @param array|bool|float|int|string $value The octal number you want to convert. Number may not * contain more than 10 characters. The most significant * bit of number is the sign bit. The remaining 29 bits * are magnitude bits. Negative numbers are represented @@ -29,7 +29,7 @@ class ConvertOctal extends ConvertBase * If OCT2BIN requires more than places characters, it * returns the #NUM! error value. * Or can be an array of values - * @param array|int $places The number of characters to use. If places is omitted, + * @param array|int $places The number of characters to use. If places is omitted, * OCT2BIN uses the minimum number of characters necessary. * Places is useful for padding the return value with * leading 0s (zeros). @@ -40,7 +40,7 @@ class ConvertOctal extends ConvertBase * value. * Or can be an array of values * - * @return array|string Result, or an error + * @return array|string Result, or 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 */ @@ -69,7 +69,7 @@ class ConvertOctal extends ConvertBase * Excel Function: * OCT2DEC(x) * - * @param array|bool|float|int|string $value The octal number you want to convert. Number may not contain + * @param array|bool|float|int|string $value The octal number you want to convert. Number may not contain * more than 10 octal characters (30 bits). The most significant * bit of number is the sign bit. The remaining 29 bits are * magnitude bits. Negative numbers are represented using @@ -78,7 +78,7 @@ class ConvertOctal extends ConvertBase * #NUM! error value. * Or can be an array of values * - * @return array|float|int|string Result, or an error + * @return array|float|int|string Result, or 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 */ @@ -118,7 +118,7 @@ class ConvertOctal extends ConvertBase * Excel Function: * OCT2HEX(x[,places]) * - * @param array|bool|float|int|string $value The octal number you want to convert. Number may not contain + * @param array|bool|float|int|string $value The octal number you want to convert. Number may not contain * more than 10 octal characters (30 bits). The most significant * bit of number is the sign bit. The remaining 29 bits are * magnitude bits. Negative numbers are represented using @@ -130,7 +130,7 @@ class ConvertOctal extends ConvertBase * If OCT2HEX requires more than places characters, it returns * the #NUM! error value. * Or can be an array of values - * @param array|int $places The number of characters to use. If places is omitted, OCT2HEX + * @param array|int $places The number of characters to use. If places is omitted, OCT2HEX * uses the minimum number of characters necessary. Places is useful * for padding the return value with leading 0s (zeros). * If places is not an integer, it is truncated. @@ -138,7 +138,7 @@ class ConvertOctal extends ConvertBase * If places is negative, OCT2HEX returns the #NUM! error value. * Or can be an array of values * - * @return array|string Result, or an error + * @return array|string Result, or 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 */ diff --git a/src/PhpSpreadsheet/Calculation/Engineering/Erf.php b/src/PhpSpreadsheet/Calculation/Engineering/Erf.php index aee7e3175..7f599dd42 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/Erf.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/Erf.php @@ -31,7 +31,7 @@ class Erf * If omitted, ERF integrates between zero and lower_limit * Or can be an array of values * - * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|float|string 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 ERF(mixed $lower, mixed $upper = null): array|float|string @@ -63,7 +63,7 @@ class Erf * @param mixed $limit Float bound for integrating ERF, other bound is zero * Or can be an array of values * - * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|float|string 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 ERFPRECISE(mixed $limit) diff --git a/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php b/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php index 4365feccd..4cca2d6b9 100644 --- a/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php +++ b/src/PhpSpreadsheet/Calculation/Engineering/ErfC.php @@ -26,7 +26,7 @@ class ErfC * @param mixed $value The float lower bound for integrating ERFC * Or can be an array of values * - * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|float|string 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 ERFC(mixed $value) diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Absolute.php b/src/PhpSpreadsheet/Calculation/MathTrig/Absolute.php index 03e613991..3b7e5324b 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Absolute.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Absolute.php @@ -16,7 +16,7 @@ class Absolute * * @param mixed $number Should be numeric, or can be an array of numbers * - * @return array|float|int|string rounded number + * @return array|float|int|string rounded number * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Angle.php b/src/PhpSpreadsheet/Calculation/MathTrig/Angle.php index e7de7aacb..7c3597d3a 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Angle.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Angle.php @@ -16,7 +16,7 @@ class Angle * * @param mixed $number Should be numeric, or can be an array of numbers * - * @return array|float|string Rounded number + * @return array|float|string Rounded number * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -42,7 +42,7 @@ class Angle * * @param mixed $number Should be numeric, or can be an array of numbers * - * @return array|float|string Rounded number + * @return array|float|string Rounded number * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php b/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php index 8901d3f4b..ab58add3a 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Arabic.php @@ -22,6 +22,8 @@ class Arabic /** * Recursively calculate the arabic value of a roman numeral. + * + * @param mixed[] $roman */ private static function calculateArabic(array $roman, int &$sum = 0, int $subtract = 0): int { @@ -55,7 +57,7 @@ class Arabic * * @param string|string[] $roman Should be a string, or can be an array of strings * - * @return array|int|string the arabic numberal contrived from the roman numeral + * @return array|int|string the arabic numberal contrived from the roman numeral * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Base.php b/src/PhpSpreadsheet/Calculation/MathTrig/Base.php index 7eda72c39..e9ef19122 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Base.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Base.php @@ -25,7 +25,7 @@ class Base * @param mixed $minLength expect int or null * Or can be an array of values * - * @return array|string the text representation with the given radix (base) + * @return array|string the text representation with the given radix (base) * If an array of numbers is passed as an argument, then the returned result will also be an array * with the same dimensions */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Combinations.php b/src/PhpSpreadsheet/Calculation/MathTrig/Combinations.php index 99eb05a5a..e38a4555b 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Combinations.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Combinations.php @@ -21,7 +21,7 @@ class Combinations * @param mixed $numObjs Number of different objects, or can be an array of numbers * @param mixed $numInSet Number of objects in each combination, or can be an array of numbers * - * @return array|float|string Number of combinations, or a string containing an error + * @return array|float|string Number of combinations, or a string containing an error * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -62,7 +62,7 @@ class Combinations * @param mixed $numObjs Number of different objects, or can be an array of numbers * @param mixed $numInSet Number of objects in each combination, or can be an array of numbers * - * @return array|float|int|string Number of combinations, or a string containing an error + * @return array|float|int|string Number of combinations, or a string containing an error * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Exp.php b/src/PhpSpreadsheet/Calculation/MathTrig/Exp.php index ea67d5fd6..f029b6640 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Exp.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Exp.php @@ -16,7 +16,7 @@ class Exp * * @param mixed $number Should be numeric, or can be an array of numbers * - * @return array|float|string Rounded number + * @return array|float|string Rounded number * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Factorial.php b/src/PhpSpreadsheet/Calculation/MathTrig/Factorial.php index 7bbd4d8be..2e2a9210d 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Factorial.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Factorial.php @@ -21,9 +21,9 @@ class Factorial * Excel Function: * FACT(factVal) * - * @param array|float $factVal Factorial Value, or can be an array of numbers + * @param array|float $factVal Factorial Value, or can be an array of numbers * - * @return array|float|int|string Factorial, or a string containing an error + * @return array|float|int|string Factorial, or a string containing an error * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -63,9 +63,9 @@ class Factorial * Excel Function: * FACTDOUBLE(factVal) * - * @param array|float $factVal Factorial Value, or can be an array of numbers + * @param array|float $factVal Factorial Value, or can be an array of numbers * - * @return array|float|int|string Double Factorial, or a string containing an error + * @return array|float|int|string Double Factorial, or a string containing an error * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -113,7 +113,9 @@ class Factorial Helpers::validateNotNegative($arg); $arg = (int) $arg; $summer += $arg; - $divisor *= self::fact($arg); + /** @var float|int */ + $temp = self::fact($arg); + $divisor *= $temp; } } catch (Exception $e) { return $e->getMessage(); diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/IntClass.php b/src/PhpSpreadsheet/Calculation/MathTrig/IntClass.php index 76bbced8d..f7d6da45e 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/IntClass.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/IntClass.php @@ -17,9 +17,9 @@ class IntClass * Excel Function: * INT(number) * - * @param array|float $number Number to cast to an integer, or can be an array of numbers + * @param array|float $number Number to cast to an integer, or can be an array of numbers * - * @return array|int|string Integer value, or a string containing an error + * @return array|int|string Integer value, or a string containing an error * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Lcm.php b/src/PhpSpreadsheet/Calculation/MathTrig/Lcm.php index 979b6df2d..88a52220b 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Lcm.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Lcm.php @@ -8,9 +8,11 @@ use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError; class Lcm { - // - // Private method to return an array of the factors of the input value - // + /** + * Private method to return an array of the factors of the input value. + * + * @return int[] + */ private static function factors(float $value): array { $startVal = floor(sqrt($value)); @@ -27,6 +29,7 @@ class Lcm } if (!empty($factorArray)) { rsort($factorArray); + /** @var int[] $factorArray */ return $factorArray; } @@ -83,12 +86,17 @@ class Lcm self::processPoweredFactors($allPoweredFactors, $myPoweredFactors); } foreach ($allPoweredFactors as $allPoweredFactor) { + /** @var scalar $allPoweredFactor */ $returnValue *= (int) $allPoweredFactor; } return $returnValue; } + /** + * @param mixed[] $allPoweredFactors + * @param mixed[] $myPoweredFactors + */ private static function processPoweredFactors(array &$allPoweredFactors, array &$myPoweredFactors): void { foreach ($myPoweredFactors as $myPoweredValue => $myPoweredFactor) { diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Logarithms.php b/src/PhpSpreadsheet/Calculation/MathTrig/Logarithms.php index 3de0a2bb6..f2ccdf676 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Logarithms.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Logarithms.php @@ -22,7 +22,7 @@ class Logarithms * @param mixed $base The base of the logarithm. If base is omitted, it is assumed to be 10. * Or can be an array of values * - * @return array|float|string The result, or a string containing an error + * @return array|float|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 */ @@ -52,7 +52,7 @@ class Logarithms * @param mixed $number Should be numeric * Or can be an array of values * - * @return array|float|string Rounded number + * @return array|float|string Rounded number * If an array of numbers is passed as an argument, then the returned result will also be an array * with the same dimensions */ @@ -80,7 +80,7 @@ class Logarithms * @param mixed $number Should be numeric * Or can be an array of values * - * @return array|float|string Rounded number + * @return array|float|string Rounded number * If an array of numbers is passed as an argument, then the returned result will also be an array * with the same dimensions */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/MatrixFunctions.php b/src/PhpSpreadsheet/Calculation/MathTrig/MatrixFunctions.php index fad01086a..df61e08e0 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/MatrixFunctions.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/MatrixFunctions.php @@ -55,7 +55,7 @@ class MatrixFunctions * @param mixed $start the first number in the sequence, defaults to 1 * @param mixed $step the amount to increment each subsequent value in the array, defaults to 1 * - * @return array|string The resulting array, or a string containing an error + * @return array|string The resulting array, or a string containing an error */ public static function sequence(mixed $rows = 1, mixed $columns = 1, mixed $start = 1, mixed $step = 1): string|array { @@ -118,7 +118,7 @@ class MatrixFunctions * * @param mixed $matrixValues A matrix of values * - * @return array|string The result, or a string containing an error + * @return array|string The result, or a string containing an error */ public static function inverse(mixed $matrixValues): array|string { @@ -141,7 +141,7 @@ class MatrixFunctions * @param mixed $matrixData1 A matrix of values * @param mixed $matrixData2 A matrix of values * - * @return array|string The result, or a string containing an error + * @return array|string The result, or a string containing an error */ public static function multiply(mixed $matrixData1, mixed $matrixData2): array|string { @@ -162,7 +162,7 @@ class MatrixFunctions * * @param mixed $dimension Number of rows and columns * - * @return array|string The result, or a string containing an error + * @return array|string The result, or a string containing an error */ public static function identity(mixed $dimension) { diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Operations.php b/src/PhpSpreadsheet/Calculation/MathTrig/Operations.php index 0eca549b9..40b6dcd77 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Operations.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Operations.php @@ -19,7 +19,7 @@ class Operations * @param mixed $divisor Divisor * Or can be an array of values * - * @return array|float|string Remainder, or a string containing an error + * @return array|float|string Remainder, 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 */ @@ -52,10 +52,10 @@ class Operations * * Computes x raised to the power y. * - * @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 + * @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 + * @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 */ @@ -133,7 +133,7 @@ class Operations * @param mixed $denominator Expect float|int * Or can be an array of values * - * @return array|int|string If an array of numbers is passed as an argument, then the returned result will also be an array + * @return array|int|string 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 quotient(mixed $numerator, mixed $denominator): array|string|int diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Random.php b/src/PhpSpreadsheet/Calculation/MathTrig/Random.php index 80d4caa7f..4db946ab1 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Random.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Random.php @@ -28,7 +28,7 @@ class Random * @param mixed $max Maximal value * Or can be an array of values * - * @return array|int|string Random number + * @return array|int|string Random number * If an array of numbers is passed as an argument, then the returned result will also be an array * with the same dimensions */ @@ -65,7 +65,7 @@ class Random * False - Decimal numbers to 15 decimal places. (default) * True - Whole (integer) numbers * - * @return array|string The resulting array, or a string containing an error + * @return array|string The resulting array, or a string containing an error */ public static function randArray(mixed $rows = 1, mixed $columns = 1, mixed $min = 0, mixed $max = 1, bool $wholeNumber = false): string|array { diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Roman.php b/src/PhpSpreadsheet/Calculation/MathTrig/Roman.php index 7c6f8e780..efb9dc054 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Roman.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Roman.php @@ -821,7 +821,7 @@ class Roman * @param mixed $style Number indicating one of five possible forms * Or can be an array of styles * - * @return array|string Roman numeral, or a string containing an error + * @return array|string Roman numeral, 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 */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Round.php b/src/PhpSpreadsheet/Calculation/MathTrig/Round.php index e0e03ae96..f4c6a2b03 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Round.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Round.php @@ -20,7 +20,7 @@ class Round * @param mixed $number Should be numeric, or can be an array of numbers * @param mixed $precision Should be int, or can be an array of numbers * - * @return array|float|string Rounded number + * @return array|float|string Rounded number * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -45,10 +45,10 @@ class Round * * Rounds a number up to a specified number of decimal places * - * @param array|float $number Number to round, or can be an array of numbers - * @param array|int $digits Number of digits to which you want to round $number, or can be an array of numbers + * @param array|float $number Number to round, or can be an array of numbers + * @param array|int $digits Number of digits to which you want to round $number, or can be an array of numbers * - * @return array|float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -89,10 +89,10 @@ class Round * * Rounds a number down to a specified number of decimal places * - * @param null|array|float|string $number Number to round, or can be an array of numbers - * @param array|float|int|string $digits Number of digits to which you want to round $number, or can be an array of numbers + * @param null|array|float|string $number Number to round, or can be an array of numbers + * @param array|float|int|string $digits Number of digits to which you want to round $number, or can be an array of numbers * - * @return array|float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -136,7 +136,7 @@ class Round * @param mixed $number Expect float. Number to round, or can be an array of numbers * @param mixed $multiple Expect int. Multiple to which you want to round, or can be an array of numbers. * - * @return array|float|int|string Rounded Number, or a string containing an error + * @return array|float|int|string Rounded Number, or a string containing an error * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -177,9 +177,9 @@ class Round * Excel Function: * EVEN(number) * - * @param array|float $number Number to round, or can be an array of numbers + * @param array|float $number Number to round, or can be an array of numbers * - * @return array|float|string Rounded Number, or a string containing an error + * @return array|float|string Rounded Number, or a string containing an error * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -203,9 +203,9 @@ class Round * * Returns number rounded up to the nearest odd integer. * - * @param array|float $number Number to round, or can be an array of numbers + * @param array|float $number Number to round, or can be an array of numbers * - * @return array|float|int|string Rounded Number, or a string containing an error + * @return array|float|int|string Rounded Number, or a string containing an error * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/SeriesSum.php b/src/PhpSpreadsheet/Calculation/MathTrig/SeriesSum.php index bb1009012..fee7bc456 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/SeriesSum.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/SeriesSum.php @@ -20,7 +20,7 @@ class SeriesSum * @param mixed $m Step * @param mixed[] $args An array of coefficients for the Data Series * - * @return array|float|int|string The result, or a string containing an error + * @return array|float|int|string The result, or a string containing an error */ public static function evaluate(mixed $x, mixed $n, mixed $m, ...$args): array|string|float|int { diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Sign.php b/src/PhpSpreadsheet/Calculation/MathTrig/Sign.php index 86a55092c..5d2fb9783 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Sign.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Sign.php @@ -15,9 +15,9 @@ class Sign * Determines the sign of a number. Returns 1 if the number is positive, zero (0) * if the number is 0, and -1 if the number is negative. * - * @param array|float $number Number to round, or can be an array of numbers + * @param array|float $number Number to round, or can be an array of numbers * - * @return array|int|string sign value, or a string containing an error + * @return array|int|string sign value, or a string containing an error * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Sqrt.php b/src/PhpSpreadsheet/Calculation/MathTrig/Sqrt.php index 18289f7bd..60c152e0f 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Sqrt.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Sqrt.php @@ -16,7 +16,7 @@ class Sqrt * * @param mixed $number Should be numeric, or can be an array of numbers * - * @return array|float|string square root + * @return array|float|string square root * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -40,9 +40,9 @@ class Sqrt * * Returns the square root of (number * pi). * - * @param array|float $number Number, or can be an array of numbers + * @param array|float $number Number, or can be an array of numbers * - * @return array|float|string Square Root of Number * Pi, or a string containing an error + * @return array|float|string Square Root of Number * Pi, or a string containing an error * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php b/src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php index 1a6a72fe0..09f9cfa5a 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Subtotal.php @@ -10,6 +10,11 @@ use PhpOffice\PhpSpreadsheet\Cell\Cell; class Subtotal { + /** + * @param mixed[] $args + * + * @return mixed[] + */ protected static function filterHiddenArgs(Cell $cellReference, array $args): array { return array_filter( @@ -27,6 +32,11 @@ class Subtotal ); } + /** + * @param mixed[] $args + * + * @return mixed[] + */ protected static function filterFormulaArgs(Cell $cellReference, array $args): array { return array_filter( diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Sum.php b/src/PhpSpreadsheet/Calculation/MathTrig/Sum.php index f939d9e74..b5d0339b6 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Sum.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Sum.php @@ -28,6 +28,7 @@ class Sum if (is_numeric($arg)) { $returnValue += $arg; } elseif (ErrorValue::isError($arg)) { + /** @var string $arg */ return $arg; } } @@ -44,6 +45,8 @@ class Sum * SUM(value1[,value2[, ...]]) * * @param mixed ...$args Data values + * + * @return array|float|int|string */ public static function sumErroringStrings(mixed ...$args): float|int|string|array { @@ -57,6 +60,7 @@ class Sum } elseif (is_bool($arg)) { $returnValue += (int) $arg; } elseif (ErrorValue::isError($arg)) { + /** @var string $arg */ return $arg; } elseif ($arg !== null && !Functions::isCellValue($k)) { // ignore non-numerics from cell, but fail as literals (except null) @@ -101,6 +105,7 @@ class Sum if ((!is_numeric($val)) || (is_string($val))) { $val = 0; } + /** @var array $wrkArray */ $wrkArray[$i] *= $val; } } diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/SumSquares.php b/src/PhpSpreadsheet/Calculation/MathTrig/SumSquares.php index b2e9cea2b..f37be22fa 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/SumSquares.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/SumSquares.php @@ -35,6 +35,10 @@ class SumSquares return $returnValue; } + /** + * @param mixed[] $array1 + * @param mixed[] $array2 + */ private static function getCount(array $array1, array $array2): int { $count = count($array1); @@ -62,7 +66,9 @@ class SumSquares public static function sumXSquaredMinusYSquared(array $matrixData1, array $matrixData2): string|int|float { try { + /** @var array */ $array1 = Functions::flattenArray($matrixData1); + /** @var array */ $array2 = Functions::flattenArray($matrixData2); $count = self::getCount($array1, $array2); @@ -88,7 +94,9 @@ class SumSquares public static function sumXSquaredPlusYSquared(array $matrixData1, array $matrixData2): string|int|float { try { + /** @var array */ $array1 = Functions::flattenArray($matrixData1); + /** @var array */ $array2 = Functions::flattenArray($matrixData2); $count = self::getCount($array1, $array2); @@ -114,7 +122,9 @@ class SumSquares public static function sumXMinusYSquared(array $matrixData1, array $matrixData2): string|int|float { try { + /** @var array */ $array1 = Functions::flattenArray($matrixData1); + /** @var array */ $array2 = Functions::flattenArray($matrixData2); $count = self::getCount($array1, $array2); diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosecant.php b/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosecant.php index 845b6c146..b131b048e 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosecant.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosecant.php @@ -15,9 +15,9 @@ class Cosecant * * Returns the cosecant of an angle. * - * @param array|float $angle Number, or can be an array of numbers + * @param array|float $angle Number, or can be an array of numbers * - * @return array|float|string The cosecant of the angle + * @return array|float|string The cosecant of the angle * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -41,9 +41,9 @@ class Cosecant * * Returns the hyperbolic cosecant of an angle. * - * @param array|float $angle Number, or can be an array of numbers + * @param array|float $angle Number, or can be an array of numbers * - * @return array|float|string The hyperbolic cosecant of the angle + * @return array|float|string The hyperbolic cosecant of the angle * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosine.php b/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosine.php index 733e3d61f..010a1c29f 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosine.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cosine.php @@ -17,7 +17,7 @@ class Cosine * * @param mixed $number Should be numeric, or can be an array of numbers * - * @return array|float|string cosine + * @return array|float|string cosine * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -43,7 +43,7 @@ class Cosine * * @param mixed $number Should be numeric, or can be an array of numbers * - * @return array|float|string hyperbolic cosine + * @return array|float|string hyperbolic cosine * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -67,9 +67,9 @@ class Cosine * * Returns the arccosine of a number. * - * @param array|float $number Number, or can be an array of numbers + * @param array|float $number Number, or can be an array of numbers * - * @return array|float|string The arccosine of the number + * @return array|float|string The arccosine of the number * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -93,9 +93,9 @@ class Cosine * * Returns the arc inverse hyperbolic cosine of a number. * - * @param array|float $number Number, or can be an array of numbers + * @param array|float $number Number, or can be an array of numbers * - * @return array|float|string The inverse hyperbolic cosine of the number, or an error string + * @return array|float|string The inverse hyperbolic cosine of the number, or an error string * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cotangent.php b/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cotangent.php index 861159a3b..34b4c0084 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cotangent.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Cotangent.php @@ -15,9 +15,9 @@ class Cotangent * * Returns the cotangent of an angle. * - * @param array|float $angle Number, or can be an array of numbers + * @param array|float $angle Number, or can be an array of numbers * - * @return array|float|string The cotangent of the angle + * @return array|float|string The cotangent of the angle * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -41,9 +41,9 @@ class Cotangent * * Returns the hyperbolic cotangent of an angle. * - * @param array|float $angle Number, or can be an array of numbers + * @param array|float $angle Number, or can be an array of numbers * - * @return array|float|string The hyperbolic cotangent of the angle + * @return array|float|string The hyperbolic cotangent of the angle * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -67,9 +67,9 @@ class Cotangent * * Returns the arccotangent of a number. * - * @param array|float $number Number, or can be an array of numbers + * @param array|float $number Number, or can be an array of numbers * - * @return array|float|string The arccotangent of the number + * @return array|float|string The arccotangent of the number * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -93,9 +93,9 @@ class Cotangent * * Returns the hyperbolic arccotangent of a number. * - * @param array|float $number Number, or can be an array of numbers + * @param array|float $number Number, or can be an array of numbers * - * @return array|float|string The hyperbolic arccotangent of the number + * @return array|float|string The hyperbolic arccotangent of the number * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Secant.php b/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Secant.php index 2d26e5ddf..6c9d317d5 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Secant.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Secant.php @@ -15,9 +15,9 @@ class Secant * * Returns the secant of an angle. * - * @param array|float $angle Number, or can be an array of numbers + * @param array|float $angle Number, or can be an array of numbers * - * @return array|float|string The secant of the angle + * @return array|float|string The secant of the angle * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -41,9 +41,9 @@ class Secant * * Returns the hyperbolic secant of an angle. * - * @param array|float $angle Number, or can be an array of numbers + * @param array|float $angle Number, or can be an array of numbers * - * @return array|float|string The hyperbolic secant of the angle + * @return array|float|string The hyperbolic secant of the angle * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Sine.php b/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Sine.php index 924466e92..5aad80931 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Sine.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Sine.php @@ -17,7 +17,7 @@ class Sine * * @param mixed $angle Should be numeric, or can be an array of numbers * - * @return array|float|string sine + * @return array|float|string sine * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -43,7 +43,7 @@ class Sine * * @param mixed $angle Should be numeric, or can be an array of numbers * - * @return array|float|string hyperbolic sine + * @return array|float|string hyperbolic sine * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -67,9 +67,9 @@ class Sine * * Returns the arcsine of a number. * - * @param array|float $number Number, or can be an array of numbers + * @param array|float $number Number, or can be an array of numbers * - * @return array|float|string The arcsine of the number + * @return array|float|string The arcsine of the number * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -93,9 +93,9 @@ class Sine * * Returns the inverse hyperbolic sine of a number. * - * @param array|float $number Number, or can be an array of numbers + * @param array|float $number Number, or can be an array of numbers * - * @return array|float|string The inverse hyperbolic sine of the number + * @return array|float|string The inverse hyperbolic sine of the number * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Tangent.php b/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Tangent.php index 9d6775f4f..a243bb71c 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Tangent.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Trig/Tangent.php @@ -18,7 +18,7 @@ class Tangent * * @param mixed $angle Should be numeric, or can be an array of numbers * - * @return array|float|string tangent + * @return array|float|string tangent * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -44,7 +44,7 @@ class Tangent * * @param mixed $angle Should be numeric, or can be an array of numbers * - * @return array|float|string hyperbolic tangent + * @return array|float|string hyperbolic tangent * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -68,9 +68,9 @@ class Tangent * * Returns the arctangent of a number. * - * @param array|float $number Number, or can be an array of numbers + * @param array|float $number Number, or can be an array of numbers * - * @return array|float|string The arctangent of the number + * @return array|float|string The arctangent of the number * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -94,9 +94,9 @@ class Tangent * * Returns the inverse hyperbolic tangent of a number. * - * @param array|float $number Number, or can be an array of numbers + * @param array|float $number Number, or can be an array of numbers * - * @return array|float|string The inverse hyperbolic tangent of the number + * @return array|float|string The inverse hyperbolic tangent of the number * If an array of numbers is passed as the argument, then the returned result will also be an array * with the same dimensions */ @@ -134,7 +134,7 @@ class Tangent * @param mixed $xCoordinate should be float, the x-coordinate of the point, or can be an array of numbers * @param mixed $yCoordinate should be float, the y-coordinate of the point, or can be an array of numbers * - * @return array|float|string The inverse tangent of the specified x- and y-coordinates, or a string containing an error + * @return array|float|string The inverse tangent of the specified x- and y-coordinates, or a string containing an error * If an array of numbers is passed as one of the arguments, then the returned result will also be an array * with the same dimensions */ diff --git a/src/PhpSpreadsheet/Calculation/MathTrig/Trunc.php b/src/PhpSpreadsheet/Calculation/MathTrig/Trunc.php index 096b27a58..e032c2007 100644 --- a/src/PhpSpreadsheet/Calculation/MathTrig/Trunc.php +++ b/src/PhpSpreadsheet/Calculation/MathTrig/Trunc.php @@ -18,10 +18,10 @@ class Trunc * (or possibly that value minus 1). * Excel is unlikely to do any better. * - * @param null|array|float|string $value Or can be an array of values - * @param array|float|int|string $digits Or can be an array of values + * @param null|array|float|string $value Or can be an array of values + * @param array|float|int|string $digits Or can be an array of values * - * @return array|float|string Truncated value, or a string containing an error + * @return array|float|string Truncated value, 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 */ diff --git a/src/PhpSpreadsheet/Calculation/Statistical/Maximum.php b/src/PhpSpreadsheet/Calculation/Statistical/Maximum.php index 47a98e6c6..88531a531 100644 --- a/src/PhpSpreadsheet/Calculation/Statistical/Maximum.php +++ b/src/PhpSpreadsheet/Calculation/Statistical/Maximum.php @@ -41,6 +41,7 @@ class Maximum extends MaxMinBase if ($returnValue === null) { return 0; } + /** @var float|int|string $returnValue */ return $returnValue; } @@ -79,6 +80,7 @@ class Maximum extends MaxMinBase if ($returnValue === null) { return 0; } + /** @var float|int|string $returnValue */ return $returnValue; } diff --git a/src/PhpSpreadsheet/Calculation/Statistical/Minimum.php b/src/PhpSpreadsheet/Calculation/Statistical/Minimum.php index fcb77c633..874edc30a 100644 --- a/src/PhpSpreadsheet/Calculation/Statistical/Minimum.php +++ b/src/PhpSpreadsheet/Calculation/Statistical/Minimum.php @@ -41,6 +41,7 @@ class Minimum extends MaxMinBase if ($returnValue === null) { return 0; } + /** @var float|int|string $returnValue */ return $returnValue; } @@ -79,6 +80,7 @@ class Minimum extends MaxMinBase if ($returnValue === null) { return 0; } + /** @var float|int|string $returnValue */ return $returnValue; } diff --git a/src/PhpSpreadsheet/Calculation/TextData/Extract.php b/src/PhpSpreadsheet/Calculation/TextData/Extract.php index 98f65b0ce..6a05fa01f 100644 --- a/src/PhpSpreadsheet/Calculation/TextData/Extract.php +++ b/src/PhpSpreadsheet/Calculation/TextData/Extract.php @@ -268,15 +268,17 @@ class Extract private static function buildDelimiter($delimiter): string { if (is_array($delimiter)) { + /** @var array */ $delimiter = Functions::flattenArray($delimiter); $quotedDelimiters = array_map( - fn ($delimiter): string => preg_quote($delimiter ?? '', '/'), + fn (?string $delimiter): string => preg_quote($delimiter ?? '', '/'), $delimiter ); $delimiters = implode('|', $quotedDelimiters); return '(' . $delimiters . ')'; } + /** @var ?string $delimiter */ return '(' . preg_quote($delimiter ?? '', '/') . ')'; } diff --git a/src/PhpSpreadsheet/Calculation/TextData/Text.php b/src/PhpSpreadsheet/Calculation/TextData/Text.php index f42227334..a4cc14f1e 100644 --- a/src/PhpSpreadsheet/Calculation/TextData/Text.php +++ b/src/PhpSpreadsheet/Calculation/TextData/Text.php @@ -192,8 +192,9 @@ class Text $valueSet = Functions::flattenArray($delimiter); if (is_array($delimiter) && count($valueSet) > 1) { + /** @var array $valueSet */ $quotedDelimiters = array_map( - fn ($delimiter): string => preg_quote($delimiter ?? '', '/'), + fn (?string $delimiter): string => preg_quote($delimiter ?? '', '/'), $valueSet ); $delimiters = implode('|', $quotedDelimiters); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselITest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselITest.php index 603f23533..8875ab796 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselITest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselITest.php @@ -9,20 +9,21 @@ use PhpOffice\PhpSpreadsheet\Calculation\Engineering\BesselI; use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalculationException; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class BesselITest extends TestCase { const BESSEL_PRECISION = 1E-9; - #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELI')] + #[DataProvider('providerBESSELI')] public function testDirectCallToBESSELI(mixed $expectedResult, mixed ...$args): void { $result = BesselI::besselI(...$args); self::assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELI')] + #[DataProvider('providerBESSELI')] public function testBESSELIAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -34,7 +35,7 @@ class BesselITest extends TestCase self::assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELI')] + #[DataProvider('providerBESSELI')] public function testBESSELIInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -57,7 +58,7 @@ class BesselITest extends TestCase return require 'tests/data/Calculation/Engineering/BESSELI.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBESSELI')] + #[DataProvider('providerUnhappyBESSELI')] public function testBESSELIUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -84,7 +85,8 @@ class BesselITest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBesselIArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerBesselIArray')] public function testBesselIArray(array $expectedResult, string $value, string $ord): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselJTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselJTest.php index a4b3b1dd0..29c3e4053 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselJTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselJTest.php @@ -9,20 +9,21 @@ use PhpOffice\PhpSpreadsheet\Calculation\Engineering\BesselJ; use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalculationException; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class BesselJTest extends TestCase { const BESSEL_PRECISION = 1E-8; - #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELJ')] + #[DataProvider('providerBESSELJ')] public function testDirectCallToBESSELJ(mixed $expectedResult, mixed ...$args): void { $result = BesselJ::besselJ(...$args); self::assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELJ')] + #[DataProvider('providerBESSELJ')] public function testBESSELJAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -34,7 +35,7 @@ class BesselJTest extends TestCase self::assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELJ')] + #[DataProvider('providerBESSELJ')] public function testBESSELJInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -57,7 +58,7 @@ class BesselJTest extends TestCase return require 'tests/data/Calculation/Engineering/BESSELJ.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBESSELJ')] + #[DataProvider('providerUnhappyBESSELJ')] public function testBESSELJUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -84,7 +85,8 @@ class BesselJTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBesselJArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerBesselJArray')] public function testBesselJArray(array $expectedResult, string $value, string $ord): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselKTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselKTest.php index a810c3133..7a270ae46 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselKTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselKTest.php @@ -9,20 +9,21 @@ use PhpOffice\PhpSpreadsheet\Calculation\Engineering\BesselK; use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalculationException; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class BesselKTest extends TestCase { const BESSEL_PRECISION = 1E-12; - #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELK')] + #[DataProvider('providerBESSELK')] public function testDirectCallToBESSELK(mixed $expectedResult, mixed ...$args): void { $result = BesselK::besselK(...$args); self::assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELK')] + #[DataProvider('providerBESSELK')] public function testBESSELKAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -34,7 +35,7 @@ class BesselKTest extends TestCase self::assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELK')] + #[DataProvider('providerBESSELK')] public function testBESSELKInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -57,7 +58,7 @@ class BesselKTest extends TestCase return require 'tests/data/Calculation/Engineering/BESSELK.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBESSELK')] + #[DataProvider('providerUnhappyBESSELK')] public function testBESSELKUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -84,7 +85,8 @@ class BesselKTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBesselKArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerBesselKArray')] public function testBesselKArray(array $expectedResult, string $value, string $ord): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselYTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselYTest.php index bbd9e58d2..654462e1a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselYTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselYTest.php @@ -9,20 +9,21 @@ use PhpOffice\PhpSpreadsheet\Calculation\Engineering\BesselY; use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalculationException; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class BesselYTest extends TestCase { const BESSEL_PRECISION = 1E-12; - #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELY')] + #[DataProvider('providerBESSELY')] public function testDirectCallToBESSELY(mixed $expectedResult, mixed ...$args): void { $result = BesselY::besselY(...$args); self::assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELY')] + #[DataProvider('providerBESSELY')] public function testBESSELYAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -34,7 +35,7 @@ class BesselYTest extends TestCase self::assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELY')] + #[DataProvider('providerBESSELY')] public function testBESSELYInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -57,7 +58,7 @@ class BesselYTest extends TestCase return require 'tests/data/Calculation/Engineering/BESSELY.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBESSELY')] + #[DataProvider('providerUnhappyBESSELY')] public function testBESSELYUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -84,7 +85,8 @@ class BesselYTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBesselYArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerBesselYArray')] public function testBesselYArray(array $expectedResult, string $value, string $ord): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2DecTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2DecTest.php index 376b38f61..01bfad4c5 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2DecTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2DecTest.php @@ -140,6 +140,7 @@ class Bin2DecTest extends TestCase self::assertSame(ExcelError::NAN(), $result, 'Excel'); } + /** @param mixed[] $expectedResult */ #[DataProvider('providerBin2DecArray')] public function testBin2DecArray(array $expectedResult, string $value): void { diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2HexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2HexTest.php index 8afcdf661..d349258ec 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2HexTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2HexTest.php @@ -11,6 +11,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class Bin2HexTest extends TestCase @@ -27,7 +28,7 @@ class Bin2HexTest extends TestCase Functions::setCompatibilityMode($this->compatibilityMode); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2HEX')] + #[DataProvider('providerBIN2HEX')] public function testDirectCallToBIN2HEX(mixed $expectedResult, bool|float|int|string $value, null|float|int|string $digits = null): void { $result = ($digits === null) ? ConvertBinary::toHex($value) : ConvertBinary::toHex($value, $digits); @@ -39,7 +40,7 @@ class Bin2HexTest extends TestCase return trim($value, '"'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2HEX')] + #[DataProvider('providerBIN2HEX')] public function testBIN2HEXAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -52,7 +53,7 @@ class Bin2HexTest extends TestCase self::assertSame($expectedResult, $this->trimIfQuoted((string) $result)); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2HEX')] + #[DataProvider('providerBIN2HEX')] public function testBIN2HEXInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -75,7 +76,7 @@ class Bin2HexTest extends TestCase return require 'tests/data/Calculation/Engineering/BIN2HEX.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBIN2HEX')] + #[DataProvider('providerUnhappyBIN2HEX')] public function testBIN2HEXUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -101,7 +102,7 @@ class Bin2HexTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2HEXOds')] + #[DataProvider('providerBIN2HEXOds')] public function testBIN2HEXOds(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); @@ -136,7 +137,8 @@ class Bin2HexTest extends TestCase self::assertSame(ExcelError::NAN(), $this->trimIfQuoted((string) $result), 'Excel'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBin2HexArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerBin2HexArray')] public function testBin2HexArray(array $expectedResult, string $value): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2OctTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2OctTest.php index 2c320f488..f333b252e 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2OctTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2OctTest.php @@ -11,6 +11,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class Bin2OctTest extends TestCase @@ -27,7 +28,7 @@ class Bin2OctTest extends TestCase Functions::setCompatibilityMode($this->compatibilityMode); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2OCT')] + #[DataProvider('providerBIN2OCT')] public function testDirectCallToBIN2OCT(mixed $expectedResult, bool|float|int|string $value, null|float|int|string $digits = null): void { $result = ($digits === null) ? ConvertBinary::toOctal($value) : ConvertBinary::toOctal($value, $digits); @@ -39,7 +40,7 @@ class Bin2OctTest extends TestCase return trim($value, '"'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2OCT')] + #[DataProvider('providerBIN2OCT')] public function testBIN2OCTAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -52,7 +53,7 @@ class Bin2OctTest extends TestCase self::assertSame($expectedResult, $this->trimIfQuoted((string) $result)); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2OCT')] + #[DataProvider('providerBIN2OCT')] public function testBIN2OCTInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -75,7 +76,7 @@ class Bin2OctTest extends TestCase return require 'tests/data/Calculation/Engineering/BIN2OCT.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBIN2OCT')] + #[DataProvider('providerUnhappyBIN2OCT')] public function testBIN2OCTUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -101,7 +102,7 @@ class Bin2OctTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2OCTOds')] + #[DataProvider('providerBIN2OCTOds')] public function testBIN2OCTOds(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); @@ -136,7 +137,8 @@ class Bin2OctTest extends TestCase self::assertSame(ExcelError::NAN(), $this->trimIfQuoted((string) $result), 'Excel'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBin2OctArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerBin2OctArray')] public function testBin2OctArray(array $expectedResult, string $value): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitAndTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitAndTest.php index 4ad529b26..bbffb81a2 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitAndTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitAndTest.php @@ -9,18 +9,19 @@ use PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise; use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalculationException; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class BitAndTest extends TestCase { - #[\PHPUnit\Framework\Attributes\DataProvider('providerBITAND')] + #[DataProvider('providerBITAND')] public function testDirectCallToBITAND(float|int|string $expectedResult, null|bool|int|float|string $arg1, null|bool|int|float|string $arg2): void { $result = BitWise::BITAND($arg1, $arg2); self::assertSame($expectedResult, $result); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBITAND')] + #[DataProvider('providerBITAND')] public function testBITANDAsFormula(float|int|string $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -32,7 +33,7 @@ class BitAndTest extends TestCase self::assertSame($expectedResult, $result); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBITAND')] + #[DataProvider('providerBITAND')] public function testBITANDInWorksheet(float|int|string $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -55,7 +56,7 @@ class BitAndTest extends TestCase return require 'tests/data/Calculation/Engineering/BITAND.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBITAND')] + #[DataProvider('providerUnhappyBITAND')] public function testBITANDUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -82,7 +83,8 @@ class BitAndTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBitAndArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerBitAndArray')] public function testBitAndArray(array $expectedResult, string $number1, string $number2): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitLShiftTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitLShiftTest.php index 82d1f749d..119f8e1e9 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitLShiftTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitLShiftTest.php @@ -9,18 +9,19 @@ use PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise; use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalculationException; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class BitLShiftTest extends TestCase { - #[\PHPUnit\Framework\Attributes\DataProvider('providerBITLSHIFT')] + #[DataProvider('providerBITLSHIFT')] public function testDirectCallToBITLSHIFT(float|int|string $expectedResult, null|bool|int|float|string $arg1, null|bool|int|float|string $arg2): void { $result = BitWise::BITLSHIFT($arg1, $arg2); self::assertSame($expectedResult, $result); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBITLSHIFT')] + #[DataProvider('providerBITLSHIFT')] public function testBITLSHIFTAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -32,7 +33,7 @@ class BitLShiftTest extends TestCase self::assertSame($expectedResult, $result); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBITLSHIFT')] + #[DataProvider('providerBITLSHIFT')] public function testBITLSHIFTInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -55,7 +56,7 @@ class BitLShiftTest extends TestCase return require 'tests/data/Calculation/Engineering/BITLSHIFT.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBITLSHIFT')] + #[DataProvider('providerUnhappyBITLSHIFT')] public function testBITLSHIFTUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -82,7 +83,8 @@ class BitLShiftTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBitLShiftArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerBitLShiftArray')] public function testBitLShiftArray(array $expectedResult, string $number, string $bits): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitOrTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitOrTest.php index 6cc139019..c17afa7ac 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitOrTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitOrTest.php @@ -9,18 +9,19 @@ use PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise; use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalculationException; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class BitOrTest extends TestCase { - #[\PHPUnit\Framework\Attributes\DataProvider('providerBITOR')] + #[DataProvider('providerBITOR')] public function testDirectCallToBITOR(float|int|string $expectedResult, null|bool|int|float|string $arg1, null|bool|int|float|string $arg2): void { $result = BitWise::BITOR($arg1, $arg2); self::assertSame($expectedResult, $result); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBITOR')] + #[DataProvider('providerBITOR')] public function testBITORAsFormula(float|int|string $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -32,7 +33,7 @@ class BitOrTest extends TestCase self::assertSame($expectedResult, $result); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBITOR')] + #[DataProvider('providerBITOR')] public function testBITORInWorksheet(float|int|string $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -55,7 +56,7 @@ class BitOrTest extends TestCase return require 'tests/data/Calculation/Engineering/BITOR.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBITOR')] + #[DataProvider('providerUnhappyBITOR')] public function testBITORUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -82,7 +83,8 @@ class BitOrTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBitOrArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerBitOrArray')] public function testBitOrArray(array $expectedResult, string $number1, string $number2): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitRShiftTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitRShiftTest.php index 084932a6b..73f695025 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitRShiftTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitRShiftTest.php @@ -9,18 +9,19 @@ use PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise; use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalculationException; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class BitRShiftTest extends TestCase { - #[\PHPUnit\Framework\Attributes\DataProvider('providerBITRSHIFT')] + #[DataProvider('providerBITRSHIFT')] public function testDirectCallToBITRSHIFT(float|int|string $expectedResult, null|bool|int|float|string $arg1, null|bool|int|float|string $arg2): void { $result = BitWise::BITRSHIFT($arg1, $arg2); self::assertSame($expectedResult, $result); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBITRSHIFT')] + #[DataProvider('providerBITRSHIFT')] public function testBITRSHIFTAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -32,7 +33,7 @@ class BitRShiftTest extends TestCase self::assertSame($expectedResult, $result); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBITRSHIFT')] + #[DataProvider('providerBITRSHIFT')] public function testBITRSHIFTInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -55,7 +56,7 @@ class BitRShiftTest extends TestCase return require 'tests/data/Calculation/Engineering/BITRSHIFT.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBITRSHIFT')] + #[DataProvider('providerUnhappyBITRSHIFT')] public function testBITRSHIFTUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -82,7 +83,8 @@ class BitRShiftTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBitRShiftArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerBitRShiftArray')] public function testBitRShiftArray(array $expectedResult, string $number, string $bits): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitXorTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitXorTest.php index 38b59b59d..5bb1427e8 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitXorTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitXorTest.php @@ -9,18 +9,19 @@ use PhpOffice\PhpSpreadsheet\Calculation\Engineering\BitWise; use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalculationException; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class BitXorTest extends TestCase { - #[\PHPUnit\Framework\Attributes\DataProvider('providerBITXOR')] + #[DataProvider('providerBITXOR')] public function testDirectCallToBITXOR(float|int|string $expectedResult, null|bool|int|float|string $arg1, null|bool|int|float|string $arg2): void { $result = BitWise::BITXOR($arg1, $arg2); self::assertSame($expectedResult, $result); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBITXOR')] + #[DataProvider('providerBITXOR')] public function testBITXORAsFormula(float|int|string $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -32,7 +33,7 @@ class BitXorTest extends TestCase self::assertSame($expectedResult, $result); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBITXOR')] + #[DataProvider('providerBITXOR')] public function testBITXORInWorksheet(float|int|string $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -55,7 +56,7 @@ class BitXorTest extends TestCase return require 'tests/data/Calculation/Engineering/BITXOR.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBITXOR')] + #[DataProvider('providerUnhappyBITXOR')] public function testBITXORUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -82,7 +83,8 @@ class BitXorTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerBitXorArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerBitXorArray')] public function testBitXorArray(array $expectedResult, string $number1, string $number2): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ComplexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ComplexTest.php index 1a5933e34..146c5682c 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ComplexTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ComplexTest.php @@ -8,11 +8,12 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation; use PhpOffice\PhpSpreadsheet\Calculation\Engineering\Complex; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class ComplexTest extends TestCase { - #[\PHPUnit\Framework\Attributes\DataProvider('providerCOMPLEX')] + #[DataProvider('providerCOMPLEX')] public function testDirectCallToCOMPLEX(mixed $expectedResult, mixed ...$args): void { $result = Complex::complex(...$args); @@ -24,7 +25,7 @@ class ComplexTest extends TestCase return trim($value, '"'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerCOMPLEX')] + #[DataProvider('providerCOMPLEX')] public function testCOMPLEXAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -37,7 +38,7 @@ class ComplexTest extends TestCase self::assertSame($expectedResult, $this->trimIfQuoted((string) $result)); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerCOMPLEX')] + #[DataProvider('providerCOMPLEX')] public function testCOMPLEXInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -60,7 +61,8 @@ class ComplexTest extends TestCase return require 'tests/data/Calculation/Engineering/COMPLEX.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerComplexArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerComplexArray')] public function testComplexArray(array $expectedResult, string $real, string $imaginary): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2BinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2BinTest.php index cdee5b47f..dfc7510fb 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2BinTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2BinTest.php @@ -10,6 +10,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalculationException; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class Dec2BinTest extends TestCase @@ -26,7 +27,7 @@ class Dec2BinTest extends TestCase Functions::setCompatibilityMode($this->compatibilityMode); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2BIN')] + #[DataProvider('providerDEC2BIN')] public function testDirectCallToDEC2BIN(mixed $expectedResult, bool|float|int|string $value, null|float|int|string $digits = null): void { $result = ($digits === null) ? ConvertDecimal::toBinary($value) : ConvertDecimal::toBinary($value, $digits); @@ -38,7 +39,7 @@ class Dec2BinTest extends TestCase return trim($value, '"'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2BIN')] + #[DataProvider('providerDEC2BIN')] public function testDEC2BINAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -51,7 +52,7 @@ class Dec2BinTest extends TestCase self::assertSame($expectedResult, $this->trimIfQuoted((string) $result)); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2BIN')] + #[DataProvider('providerDEC2BIN')] public function testDEC2BINInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -74,7 +75,7 @@ class Dec2BinTest extends TestCase return require 'tests/data/Calculation/Engineering/DEC2BIN.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyDEC2BIN')] + #[DataProvider('providerUnhappyDEC2BIN')] public function testDEC2BINUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -100,7 +101,7 @@ class Dec2BinTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2BINOds')] + #[DataProvider('providerDEC2BINOds')] public function testDEC2BINOds(mixed $expectedResult, bool|float|int|string $value, null|float|int|string $digits = null): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); @@ -135,7 +136,8 @@ class Dec2BinTest extends TestCase self::assertSame('101', $this->trimIfQuoted((string) $result), 'Excel'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerDec2BinArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerDec2BinArray')] public function testDec2BinArray(array $expectedResult, string $value): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2HexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2HexTest.php index 03a129b06..a4f520553 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2HexTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2HexTest.php @@ -10,6 +10,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalculationException; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class Dec2HexTest extends TestCase @@ -26,7 +27,7 @@ class Dec2HexTest extends TestCase Functions::setCompatibilityMode($this->compatibilityMode); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2HEX')] + #[DataProvider('providerDEC2HEX')] public function testDirectCallToDEC2HEX(mixed $expectedResult, bool|float|int|string $value, null|float|int|string $digits = null): void { $result = ($digits === null) ? ConvertDecimal::toHex($value) : ConvertDecimal::toHex($value, $digits); @@ -38,7 +39,7 @@ class Dec2HexTest extends TestCase return trim($value, '"'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2HEX')] + #[DataProvider('providerDEC2HEX')] public function testDEC2HEXAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -51,7 +52,7 @@ class Dec2HexTest extends TestCase self::assertSame($expectedResult, $this->trimIfQuoted((string) $result)); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2HEX')] + #[DataProvider('providerDEC2HEX')] public function testDEC2HEXInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -74,7 +75,7 @@ class Dec2HexTest extends TestCase return require 'tests/data/Calculation/Engineering/DEC2HEX.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyDEC2HEX')] + #[DataProvider('providerUnhappyDEC2HEX')] public function testDEC2HEXUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -100,7 +101,7 @@ class Dec2HexTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2HEXOds')] + #[DataProvider('providerDEC2HEXOds')] public function testDEC2HEXOds(mixed $expectedResult, bool|float|int|string $value, null|float|int|string $digits = null): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); @@ -142,7 +143,8 @@ class Dec2HexTest extends TestCase self::assertEquals('FFFFFFFFFF', ConvertDecimal::hex32bit(-1, 'FFFFFFFF', true)); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerDec2HexArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerDec2HexArray')] public function testDec2HexArray(array $expectedResult, string $value): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2OctTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2OctTest.php index b99fa9e27..c61861685 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2OctTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2OctTest.php @@ -10,6 +10,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalculationException; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class Dec2OctTest extends TestCase @@ -26,7 +27,7 @@ class Dec2OctTest extends TestCase Functions::setCompatibilityMode($this->compatibilityMode); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2OCT')] + #[DataProvider('providerDEC2OCT')] public function testDirectCallToDEC2OCT(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void { $result = ($digits === null) ? ConvertDecimal::toOctal($value) : ConvertDecimal::toOctal($value, $digits); @@ -38,7 +39,7 @@ class Dec2OctTest extends TestCase return trim($value, '"'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2OCT')] + #[DataProvider('providerDEC2OCT')] public function testDEC2OCTAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -51,7 +52,7 @@ class Dec2OctTest extends TestCase self::assertSame($expectedResult, $this->trimIfQuoted((string) $result)); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2OCT')] + #[DataProvider('providerDEC2OCT')] public function testDEC2OCTInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -74,7 +75,7 @@ class Dec2OctTest extends TestCase return require 'tests/data/Calculation/Engineering/DEC2OCT.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyDEC2OCT')] + #[DataProvider('providerUnhappyDEC2OCT')] public function testDEC2OCTUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -100,7 +101,7 @@ class Dec2OctTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2OCTOds')] + #[DataProvider('providerDEC2OCTOds')] public function testDEC2OCTOds(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); @@ -135,7 +136,8 @@ class Dec2OctTest extends TestCase self::assertSame('21', $this->trimIfQuoted((string) $result), 'Excel'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerDec2OctArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerDec2OctArray')] public function testDec2OctArray(array $expectedResult, string $value): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCscTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCscTest.php index 21cfaec37..041c98e80 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCscTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCscTest.php @@ -11,6 +11,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; use PhpOffice\PhpSpreadsheetTests\Custom\ComplexAssert; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class ImCscTest extends TestCase @@ -25,7 +26,7 @@ class ImCscTest extends TestCase $this->complexAssert = new ComplexAssert(); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCSC')] + #[DataProvider('providerIMCSC')] public function testDirectCallToIMCSC(float|string $expectedResult, string $arg): void { $result = ComplexFunctions::IMCSC($arg); @@ -40,7 +41,7 @@ class ImCscTest extends TestCase return trim($value, '"'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCSC')] + #[DataProvider('providerIMCSC')] public function testIMCSCAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -56,7 +57,7 @@ class ImCscTest extends TestCase ); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCSC')] + #[DataProvider('providerIMCSC')] public function testIMCSCInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -82,7 +83,7 @@ class ImCscTest extends TestCase return require 'tests/data/Calculation/Engineering/IMCSC.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMCSC')] + #[DataProvider('providerUnhappyIMCSC')] public function testIMCSCUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -108,7 +109,8 @@ class ImCscTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerImCscArray')] + /** @param string[][] $expectedResult */ + #[DataProvider('providerImCscArray')] public function testImCscArray(array $expectedResult, string $complex): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSqrtTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSqrtTest.php index 08ee4b78b..e987da004 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSqrtTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSqrtTest.php @@ -11,6 +11,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; use PhpOffice\PhpSpreadsheetTests\Custom\ComplexAssert; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class ImSqrtTest extends TestCase @@ -25,7 +26,7 @@ class ImSqrtTest extends TestCase $this->complexAssert = new ComplexAssert(); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSQRT')] + #[DataProvider('providerIMSQRT')] public function testDirectCallToIMSQRT(string $expectedResult, string $arg): void { $result = ComplexFunctions::IMSQRT($arg); @@ -40,7 +41,7 @@ class ImSqrtTest extends TestCase return trim($value, '"'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSQRT')] + #[DataProvider('providerIMSQRT')] public function testIMSQRTAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -56,7 +57,7 @@ class ImSqrtTest extends TestCase ); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSQRT')] + #[DataProvider('providerIMSQRT')] public function testIMSQRTInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -82,7 +83,7 @@ class ImSqrtTest extends TestCase return require 'tests/data/Calculation/Engineering/IMSQRT.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMSQRT')] + #[DataProvider('providerUnhappyIMSQRT')] public function testIMSQRTUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -108,7 +109,8 @@ class ImSqrtTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerImSqrtArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerImSqrtArray')] public function testImSqrtArray(array $expectedResult, string $complex): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSubTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSubTest.php index cfcd5d3bd..91b14e936 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSubTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSubTest.php @@ -11,6 +11,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; use PhpOffice\PhpSpreadsheetTests\Custom\ComplexAssert; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class ImSubTest extends TestCase @@ -25,7 +26,7 @@ class ImSubTest extends TestCase $this->complexAssert = new ComplexAssert(); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSUB')] + #[DataProvider('providerIMSUB')] public function testDirectCallToIMSUB(string $expectedResult, string $arg1, string $arg2): void { $result = ComplexOperations::IMSUB($arg1, $arg2); @@ -40,7 +41,7 @@ class ImSubTest extends TestCase return trim($value, '"'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSUB')] + #[DataProvider('providerIMSUB')] public function testIMSUBAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -56,7 +57,7 @@ class ImSubTest extends TestCase ); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSUB')] + #[DataProvider('providerIMSUB')] public function testIMSUBInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -82,7 +83,7 @@ class ImSubTest extends TestCase return require 'tests/data/Calculation/Engineering/IMSUB.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMSUB')] + #[DataProvider('providerUnhappyIMSUB')] public function testIMSUBUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -109,7 +110,8 @@ class ImSubTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerImSubArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerImSubArray')] public function testImSubArray(array $expectedResult, string $subidend, string $subisor): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSumTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSumTest.php index dbf6a7463..08fc28915 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSumTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSumTest.php @@ -11,6 +11,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; use PhpOffice\PhpSpreadsheetTests\Custom\ComplexAssert; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class ImSumTest extends TestCase @@ -28,7 +29,7 @@ class ImSumTest extends TestCase /** * @param string ...$args variadic arguments */ - #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSUM')] + #[DataProvider('providerIMSUM')] public function testDirectCallToIMSUM(mixed $expectedResult, ...$args): void { $result = ComplexOperations::IMSUM(...$args); @@ -43,7 +44,7 @@ class ImSumTest extends TestCase return trim($value, '"'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSUM')] + #[DataProvider('providerIMSUM')] public function testIMSUMAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -59,7 +60,7 @@ class ImSumTest extends TestCase ); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSUM')] + #[DataProvider('providerIMSUM')] public function testIMSUMInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -85,7 +86,7 @@ class ImSumTest extends TestCase return require 'tests/data/Calculation/Engineering/IMSUM.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMSUM')] + #[DataProvider('providerUnhappyIMSUM')] public function testIMSUMUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImTanTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImTanTest.php index b4d5af1b8..f428a3ef4 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImTanTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImTanTest.php @@ -11,6 +11,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; use PhpOffice\PhpSpreadsheetTests\Custom\ComplexAssert; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class ImTanTest extends TestCase @@ -25,7 +26,7 @@ class ImTanTest extends TestCase $this->complexAssert = new ComplexAssert(); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerIMTAN')] + #[DataProvider('providerIMTAN')] public function testDirectCallToIMTAN(string $expectedResult, string $arg): void { $result = ComplexFunctions::IMTAN($arg); @@ -40,7 +41,7 @@ class ImTanTest extends TestCase return trim($value, '"'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerIMTAN')] + #[DataProvider('providerIMTAN')] public function testIMTANAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -56,7 +57,7 @@ class ImTanTest extends TestCase ); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerIMTAN')] + #[DataProvider('providerIMTAN')] public function testIMTANInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -82,7 +83,7 @@ class ImTanTest extends TestCase return require 'tests/data/Calculation/Engineering/IMTAN.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMTAN')] + #[DataProvider('providerUnhappyIMTAN')] public function testIMTANUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -108,7 +109,8 @@ class ImTanTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerImTanArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerImTanArray')] public function testImTanArray(array $expectedResult, string $complex): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImaginaryTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImaginaryTest.php index 4f1f7b85e..e55d82ab1 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImaginaryTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImaginaryTest.php @@ -10,6 +10,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalculationException; use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class ImaginaryTest extends TestCase @@ -21,14 +22,14 @@ class ImaginaryTest extends TestCase Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerIMAGINARY')] + #[DataProvider('providerIMAGINARY')] public function testDirectCallToIMAGINARY(float|int|string $expectedResult, float|int|string $arg): void { $result = Complex::IMAGINARY((string) $arg); self::assertEqualsWithDelta($expectedResult, $result, self::COMPLEX_PRECISION); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerIMAGINARY')] + #[DataProvider('providerIMAGINARY')] public function testIMAGINARYAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -40,7 +41,7 @@ class ImaginaryTest extends TestCase self::assertEqualsWithDelta($expectedResult, $result, self::COMPLEX_PRECISION); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerIMAGINARY')] + #[DataProvider('providerIMAGINARY')] public function testIMAGINARYInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -63,7 +64,7 @@ class ImaginaryTest extends TestCase return require 'tests/data/Calculation/Engineering/IMAGINARY.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMAGINARY')] + #[DataProvider('providerUnhappyIMAGINARY')] public function testIMAGINARYUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -89,7 +90,8 @@ class ImaginaryTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerImaginaryArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerImaginaryArray')] public function testImaginaryArray(array $expectedResult, string $complex): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2BinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2BinTest.php index be2aeaeaf..e96c4a19a 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2BinTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2BinTest.php @@ -11,6 +11,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class Oct2BinTest extends TestCase @@ -27,7 +28,7 @@ class Oct2BinTest extends TestCase Functions::setCompatibilityMode($this->compatibilityMode); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2BIN')] + #[DataProvider('providerOCT2BIN')] public function testDirectCallToOCT2BIN(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void { $result = ($digits === null) ? ConvertOctal::toBinary($value) : ConvertOctal::toBinary($value, $digits); @@ -39,7 +40,7 @@ class Oct2BinTest extends TestCase return trim($value, '"'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2BIN')] + #[DataProvider('providerOCT2BIN')] public function testOCT2BINAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -52,7 +53,7 @@ class Oct2BinTest extends TestCase self::assertSame($expectedResult, $this->trimIfQuoted((string) $result)); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2BIN')] + #[DataProvider('providerOCT2BIN')] public function testOCT2BINInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -75,7 +76,7 @@ class Oct2BinTest extends TestCase return require 'tests/data/Calculation/Engineering/OCT2BIN.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyOCT2BIN')] + #[DataProvider('providerUnhappyOCT2BIN')] public function testOCT2BINUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -101,7 +102,7 @@ class Oct2BinTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2BINOds')] + #[DataProvider('providerOCT2BINOds')] public function testOCT2BINOds(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); @@ -136,7 +137,8 @@ class Oct2BinTest extends TestCase self::assertSame(ExcelError::NAN(), $this->trimIfQuoted((string) $result), 'Excel'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerOct2BinArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerOct2BinArray')] public function testOct2BinArray(array $expectedResult, string $value): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2DecTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2DecTest.php index 718f977d7..37f88fe74 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2DecTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2DecTest.php @@ -140,6 +140,7 @@ class Oct2DecTest extends TestCase self::assertSame(ExcelError::NAN(), $result, 'Excel'); } + /** @param mixed[] $expectedResult */ #[DataProvider('providerOct2DecArray')] public function testOct2DecArray(array $expectedResult, string $value): void { diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2HexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2HexTest.php index 94da193a2..9751986e3 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2HexTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2HexTest.php @@ -11,6 +11,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Functions; use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheetTests\Calculation\Functions\FormulaArguments; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; class Oct2HexTest extends TestCase @@ -27,7 +28,7 @@ class Oct2HexTest extends TestCase Functions::setCompatibilityMode($this->compatibilityMode); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2HEX')] + #[DataProvider('providerOCT2HEX')] public function testDirectCallToOCT2HEX(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void { $result = ($digits === null) ? ConvertOctal::toHex($value) : ConvertOctal::toHex($value, $digits); @@ -39,7 +40,7 @@ class Oct2HexTest extends TestCase return trim($value, '"'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2HEX')] + #[DataProvider('providerOCT2HEX')] public function testOCT2HEXAsFormula(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -52,7 +53,7 @@ class Oct2HexTest extends TestCase self::assertSame($expectedResult, $this->trimIfQuoted((string) $result)); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2HEX')] + #[DataProvider('providerOCT2HEX')] public function testOCT2HEXInWorksheet(mixed $expectedResult, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -75,7 +76,7 @@ class Oct2HexTest extends TestCase return require 'tests/data/Calculation/Engineering/OCT2HEX.php'; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyOCT2HEX')] + #[DataProvider('providerUnhappyOCT2HEX')] public function testOCT2HEXUnhappyPath(string $expectedException, mixed ...$args): void { $arguments = new FormulaArguments(...$args); @@ -101,7 +102,7 @@ class Oct2HexTest extends TestCase ]; } - #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2HEXOds')] + #[DataProvider('providerOCT2HEXOds')] public function testOCT2HEXOds(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void { Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE); @@ -136,7 +137,8 @@ class Oct2HexTest extends TestCase self::assertSame(ExcelError::NAN(), $this->trimIfQuoted((string) $result), 'Excel'); } - #[\PHPUnit\Framework\Attributes\DataProvider('providerOct2HexArray')] + /** @param mixed[] $expectedResult */ + #[DataProvider('providerOct2HexArray')] public function testOct2HexArray(array $expectedResult, string $value): void { $calculation = Calculation::getInstance(); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MInverseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MInverseTest.php index cc98cab1a..bd7682d87 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MInverseTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MInverseTest.php @@ -5,10 +5,12 @@ declare(strict_types=1); namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig; use PhpOffice\PhpSpreadsheet\Calculation\MathTrig; +use PHPUnit\Framework\Attributes\DataProvider; class MInverseTest extends AllSetupTeardown { - #[\PHPUnit\Framework\Attributes\DataProvider('providerMINVERSE')] + /** @param mixed[] $args */ + #[DataProvider('providerMINVERSE')] public function testMINVERSE(mixed $expectedResult, array $args): void { $result = MathTrig\MatrixFunctions::inverse($args); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MdeTermTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MdeTermTest.php index f171cf6f8..136e6d1f4 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MdeTermTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MdeTermTest.php @@ -4,9 +4,12 @@ declare(strict_types=1); namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig; +use PHPUnit\Framework\Attributes\DataProvider; + class MdeTermTest extends AllSetupTeardown { - #[\PHPUnit\Framework\Attributes\DataProvider('providerMDETERM')] + /** @param array|float|int|string $matrix */ + #[DataProvider('providerMDETERM')] public function testMDETERM2(float|int|string $expectedResult, array|int|float|string $matrix): void { $this->mightHaveException($expectedResult); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfTest.php index 397da91ad..5e6fd6883 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfTest.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfTest.php @@ -9,6 +9,10 @@ use PHPUnit\Framework\Attributes\DataProvider; class SumIfTest extends AllSetupTeardown { + /** + * @param mixed[] $array1 + * @param null|mixed[] $array2 + */ #[DataProvider('providerSUMIF')] public function testSUMIF2(mixed $expectedResult, array $array1, mixed $condition, ?array $array2 = null): void { diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2MY2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2MY2Test.php index 9e36ac572..46af5b523 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2MY2Test.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2MY2Test.php @@ -5,10 +5,15 @@ declare(strict_types=1); namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig; use PhpOffice\PhpSpreadsheet\Calculation\Functions; +use PHPUnit\Framework\Attributes\DataProvider; class SumX2MY2Test extends AllSetupTeardown { - #[\PHPUnit\Framework\Attributes\DataProvider('providerSUMX2MY2')] + /** + * @param mixed[] $matrixData1 + * @param mixed[] $matrixData2 + */ + #[DataProvider('providerSUMX2MY2')] public function testSUMX2MY2(mixed $expectedResult, array $matrixData1, array $matrixData2): void { $this->mightHaveException($expectedResult); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2PY2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2PY2Test.php index 46bc3e17c..6c7a24fa9 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2PY2Test.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2PY2Test.php @@ -5,10 +5,15 @@ declare(strict_types=1); namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig; use PhpOffice\PhpSpreadsheet\Calculation\Functions; +use PHPUnit\Framework\Attributes\DataProvider; class SumX2PY2Test extends AllSetupTeardown { - #[\PHPUnit\Framework\Attributes\DataProvider('providerSUMX2PY2')] + /** + * @param mixed[] $matrixData1 + * @param mixed[] $matrixData2 + */ + #[DataProvider('providerSUMX2PY2')] public function testSUMX2PY2(mixed $expectedResult, array $matrixData1, array $matrixData2): void { $this->mightHaveException($expectedResult); diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumXMY2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumXMY2Test.php index d4f91a8cd..36694a03c 100644 --- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumXMY2Test.php +++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumXMY2Test.php @@ -5,10 +5,15 @@ declare(strict_types=1); namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig; use PhpOffice\PhpSpreadsheet\Calculation\Functions; +use PHPUnit\Framework\Attributes\DataProvider; class SumXMY2Test extends AllSetupTeardown { - #[\PHPUnit\Framework\Attributes\DataProvider('providerSUMXMY2')] + /** + * @param mixed[] $matrixData1 + * @param mixed[] $matrixData2 + */ + #[DataProvider('providerSUMXMY2')] public function testSUMXMY2(mixed $expectedResult, array $matrixData1, array $matrixData2): void { $this->mightHaveException($expectedResult);