Skip to content

Commit e16571e

Browse files
authored
Merge pull request #4469 from oleibman/stan1007
Still More Prep for Phpstan 10
2 parents 0e570a5 + 770eddf commit e16571e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+443
-386
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,2 @@
11
parameters:
22
ignoreErrors:
3-
-
4-
message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig\\Sum\:\:sumErroringStrings\(\) should return array\|float\|int\|string but returns mixed\.$#'
5-
identifier: return.type
6-
count: 1
7-
path: src/PhpSpreadsheet/Calculation/MathTrig/Sum.php
8-
9-
-
10-
message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\MathTrig\\Sum\:\:sumIgnoringStrings\(\) should return float\|int\|string but returns mixed\.$#'
11-
identifier: return.type
12-
count: 1
13-
path: src/PhpSpreadsheet/Calculation/MathTrig/Sum.php
14-
15-
-
16-
message: '#^Binary operation "\*" between mixed and mixed results in an error\.$#'
17-
identifier: binaryOp.invalid
18-
count: 4
19-
path: src/PhpSpreadsheet/Calculation/MathTrig/SumSquares.php
20-
21-
-
22-
message: '#^Binary operation "\-" between mixed and mixed results in an error\.$#'
23-
identifier: binaryOp.invalid
24-
count: 2
25-
path: src/PhpSpreadsheet/Calculation/MathTrig/SumSquares.php
26-
27-
-
28-
message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical\\Maximum\:\:max\(\) should return float\|int\|string but returns mixed\.$#'
29-
identifier: return.type
30-
count: 1
31-
path: src/PhpSpreadsheet/Calculation/Statistical/Maximum.php
32-
33-
-
34-
message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical\\Maximum\:\:maxA\(\) should return float\|int\|string but returns mixed\.$#'
35-
identifier: return.type
36-
count: 1
37-
path: src/PhpSpreadsheet/Calculation/Statistical/Maximum.php
38-
39-
-
40-
message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical\\Minimum\:\:min\(\) should return float\|int\|string but returns mixed\.$#'
41-
identifier: return.type
42-
count: 1
43-
path: src/PhpSpreadsheet/Calculation/Statistical/Minimum.php
44-
45-
-
46-
message: '#^Method PhpOffice\\PhpSpreadsheet\\Calculation\\Statistical\\Minimum\:\:minA\(\) should return float\|int\|string but returns mixed\.$#'
47-
identifier: return.type
48-
count: 1
49-
path: src/PhpSpreadsheet/Calculation/Statistical/Minimum.php
50-
51-
-
52-
message: '#^Parameter \#1 \$str of function preg_quote expects string, mixed given\.$#'
53-
identifier: argument.type
54-
count: 1
55-
path: src/PhpSpreadsheet/Calculation/TextData/Extract.php
56-
57-
-
58-
message: '#^Parameter \#1 \$str of function preg_quote expects string, mixed given\.$#'
59-
identifier: argument.type
60-
count: 1
61-
path: src/PhpSpreadsheet/Calculation/TextData/Text.php

phpstan.neon.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ parameters:
2929
- '~^Parameter \#2 .* of static method PHPUnit\\Framework\\Assert\:\:assert\w+\(\) expects .*, .* given\.$~'
3030
#- '~Method .*rovider.* return type has no value type specified in iterable type array\.$~'
3131
#- '~Method .*rovider.* should return array but returns mixed\.$~'
32+
#- '~.* has parameter \$expectedResult with no value type specified in iterable type array\.$~'
3233
- identifier: missingType.iterableValue

src/PhpSpreadsheet/Calculation/Engineering/BesselI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class BesselI
3131
* If $ord < 0, BESSELI returns the #NUM! error value.
3232
* Or can be an array of values
3333
*
34-
* @return array|float|string Result, or a string containing an error
34+
* @return array<mixed>|float|string Result, or a string containing an error
3535
* If an array of numbers is passed as an argument, then the returned result will also be an array
3636
* with the same dimensions
3737
*/

src/PhpSpreadsheet/Calculation/Engineering/BesselJ.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class BesselJ
3030
* If $ord < 0, BESSELJ returns the #NUM! error value.
3131
* Or can be an array of values
3232
*
33-
* @return array|float|string Result, or a string containing an error
33+
* @return array<mixed>|float|string Result, or a string containing an error
3434
* If an array of numbers is passed as an argument, then the returned result will also be an array
3535
* with the same dimensions
3636
*/

src/PhpSpreadsheet/Calculation/Engineering/BesselK.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class BesselK
2828
* If $ord < 0, BESSELKI returns the #NUM! error value.
2929
* Or can be an array of values
3030
*
31-
* @return array|float|string Result, or a string containing an error
31+
* @return array<mixed>|float|string Result, or a string containing an error
3232
* If an array of numbers is passed as an argument, then the returned result will also be an array
3333
* with the same dimensions
3434
*/

src/PhpSpreadsheet/Calculation/Engineering/BesselY.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class BesselY
2727
* If $ord < 0, BESSELY returns the #NUM! error value.
2828
* Or can be an array of values
2929
*
30-
* @return array|float|string Result, or a string containing an error
30+
* @return array<mixed>|float|string Result, or a string containing an error
3131
* If an array of numbers is passed as an argument, then the returned result will also be an array
3232
* with the same dimensions
3333
*/

src/PhpSpreadsheet/Calculation/Engineering/BitWise.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ private static function splitNumber(float|int $number): array
3030
* Excel Function:
3131
* BITAND(number1, number2)
3232
*
33-
* @param null|array|bool|float|int|string $number1 Or can be an array of values
34-
* @param null|array|bool|float|int|string $number2 Or can be an array of values
33+
* @param null|array<mixed>|bool|float|int|string $number1 Or can be an array of values
34+
* @param null|array<mixed>|bool|float|int|string $number2 Or can be an array of values
3535
*
36-
* @return array|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
36+
* @return array<mixed>|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
3737
* with the same dimensions
3838
*/
3939
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 @@ public static function BITAND(null|array|bool|float|int|string $number1, null|ar
6262
* Excel Function:
6363
* BITOR(number1, number2)
6464
*
65-
* @param null|array|bool|float|int|string $number1 Or can be an array of values
66-
* @param null|array|bool|float|int|string $number2 Or can be an array of values
65+
* @param null|array<mixed>|bool|float|int|string $number1 Or can be an array of values
66+
* @param null|array<mixed>|bool|float|int|string $number2 Or can be an array of values
6767
*
68-
* @return array|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
68+
* @return array<mixed>|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
6969
* with the same dimensions
7070
*/
7171
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 @@ public static function BITOR(null|array|bool|float|int|string $number1, null|arr
9595
* Excel Function:
9696
* BITXOR(number1, number2)
9797
*
98-
* @param null|array|bool|float|int|string $number1 Or can be an array of values
99-
* @param null|array|bool|float|int|string $number2 Or can be an array of values
98+
* @param null|array<mixed>|bool|float|int|string $number1 Or can be an array of values
99+
* @param null|array<mixed>|bool|float|int|string $number2 Or can be an array of values
100100
*
101-
* @return array|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
101+
* @return array<mixed>|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
102102
* with the same dimensions
103103
*/
104104
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 @@ public static function BITXOR(null|array|bool|float|int|string $number1, null|ar
128128
* Excel Function:
129129
* BITLSHIFT(number, shift_amount)
130130
*
131-
* @param null|array|bool|float|int|string $number Or can be an array of values
132-
* @param null|array|bool|float|int|string $shiftAmount Or can be an array of values
131+
* @param null|array<mixed>|bool|float|int|string $number Or can be an array of values
132+
* @param null|array<mixed>|bool|float|int|string $shiftAmount Or can be an array of values
133133
*
134-
* @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
134+
* @return array<mixed>|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
135135
* with the same dimensions
136136
*/
137137
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 @@ public static function BITLSHIFT(null|array|bool|float|int|string $number, null|
163163
* Excel Function:
164164
* BITRSHIFT(number, shift_amount)
165165
*
166-
* @param null|array|bool|float|int|string $number Or can be an array of values
167-
* @param null|array|bool|float|int|string $shiftAmount Or can be an array of values
166+
* @param null|array<mixed>|bool|float|int|string $number Or can be an array of values
167+
* @param null|array<mixed>|bool|float|int|string $shiftAmount Or can be an array of values
168168
*
169-
* @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
169+
* @return array<mixed>|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
170170
* with the same dimensions
171171
*/
172172
public static function BITRSHIFT(null|array|bool|float|int|string $number, null|array|bool|float|int|string $shiftAmount): array|string|float

src/PhpSpreadsheet/Calculation/Engineering/Compare.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ class Compare
2020
* functions you calculate the count of equal pairs. This function is also known as the
2121
* Kronecker Delta function.
2222
*
23-
* @param array|bool|float|int|string $a the first number
23+
* @param array<mixed>|bool|float|int|string $a the first number
2424
* Or can be an array of values
25-
* @param array|bool|float|int|string $b The second number. If omitted, b is assumed to be zero.
25+
* @param array<mixed>|bool|float|int|string $b The second number. If omitted, b is assumed to be zero.
2626
* Or can be an array of values
2727
*
28-
* @return array|int|string (string in the event of an error)
28+
* @return array<mixed>|int|string (string in the event of an error)
2929
* If an array of numbers is passed as an argument, then the returned result will also be an array
3030
* with the same dimensions
3131
*/
@@ -55,12 +55,12 @@ public static function DELTA(array|float|bool|string|int $a, array|float|bool|st
5555
* Use this function to filter a set of values. For example, by summing several GESTEP
5656
* functions you calculate the count of values that exceed a threshold.
5757
*
58-
* @param array|bool|float|int|string $number the value to test against step
58+
* @param array<mixed>|bool|float|int|string $number the value to test against step
5959
* Or can be an array of values
60-
* @param null|array|bool|float|int|string $step The threshold value. If you omit a value for step, GESTEP uses zero.
60+
* @param null|array<mixed>|bool|float|int|string $step The threshold value. If you omit a value for step, GESTEP uses zero.
6161
* Or can be an array of values
6262
*
63-
* @return array|int|string (string in the event of an error)
63+
* @return array<mixed>|int|string (string in the event of an error)
6464
* If an array of numbers is passed as an argument, then the returned result will also be an array
6565
* with the same dimensions
6666
*/

src/PhpSpreadsheet/Calculation/Engineering/Complex.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Complex
2828
* If omitted, the suffix is assumed to be "i".
2929
* Or can be an array of values
3030
*
31-
* @return array|string If an array of numbers is passed as an argument, then the returned result will also be an array
31+
* @return array<mixed>|string If an array of numbers is passed as an argument, then the returned result will also be an array
3232
* with the same dimensions
3333
*/
3434
public static function COMPLEX(mixed $realNumber = 0.0, mixed $imaginary = 0.0, mixed $suffix = 'i'): array|string
@@ -65,11 +65,11 @@ public static function COMPLEX(mixed $realNumber = 0.0, mixed $imaginary = 0.0,
6565
* Excel Function:
6666
* IMAGINARY(complexNumber)
6767
*
68-
* @param array|string $complexNumber the complex number for which you want the imaginary
68+
* @param array<mixed>|string $complexNumber the complex number for which you want the imaginary
6969
* coefficient
7070
* Or can be an array of values
7171
*
72-
* @return array|float|string (string if an error)
72+
* @return array<mixed>|float|string (string if an error)
7373
* If an array of numbers is passed as an argument, then the returned result will also be an array
7474
* with the same dimensions
7575
*/
@@ -96,10 +96,10 @@ public static function IMAGINARY($complexNumber): array|string|float
9696
* Excel Function:
9797
* IMREAL(complexNumber)
9898
*
99-
* @param array|string $complexNumber the complex number for which you want the real coefficient
99+
* @param array<mixed>|string $complexNumber the complex number for which you want the real coefficient
100100
* Or can be an array of values
101101
*
102-
* @return array|float|string (string if an error)
102+
* @return array<mixed>|float|string (string if an error)
103103
* If an array of numbers is passed as an argument, then the returned result will also be an array
104104
* with the same dimensions
105105
*/

0 commit comments

Comments
 (0)