Skip to content

Commit 7cffb84

Browse files
committed
Rector ReturnTypeFromStrictTypedCallRector
1 parent f13a8da commit 7cffb84

Some content is hidden

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

58 files changed

+99
-145
lines changed

src/PhpSpreadsheet/Calculation/Database/DCount.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ class DCount extends DatabaseAbstract
3030
* includes at least one column label and at least one cell below
3131
* the column label in which you specify a condition for the
3232
* column.
33-
*
34-
* @return int|string
3533
*/
36-
public static function evaluate($database, $field, $criteria, bool $returnError = true)
34+
public static function evaluate($database, $field, $criteria, bool $returnError = true): string|int
3735
{
3836
$field = self::fieldExtract($database, $field);
3937
if ($returnError && $field === null) {

src/PhpSpreadsheet/Calculation/Database/DCountA.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ class DCountA extends DatabaseAbstract
2929
* includes at least one column label and at least one cell below
3030
* the column label in which you specify a condition for the
3131
* column.
32-
*
33-
* @return int|string
3432
*/
35-
public static function evaluate($database, $field, $criteria)
33+
public static function evaluate($database, $field, $criteria): string|int
3634
{
3735
$field = self::fieldExtract($database, $field);
3836
if ($field === null) {

src/PhpSpreadsheet/Calculation/DateTime.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public static function isLeapYear($year): bool
3434
*
3535
* @param mixed $dateValue
3636
*
37-
* @return mixed Excel date/time serial value, or string if error
37+
* @return float|string Excel date/time serial value, or string if error
3838
*/
39-
public static function getDateValue($dateValue)
39+
public static function getDateValue($dateValue): float|string
4040
{
4141
try {
4242
return DateTimeExcel\Helpers::getDateValue($dateValue);

src/PhpSpreadsheet/Calculation/DateTimeExcel/Days360.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Days360
4444
* If an array of values is passed for the $startDate or $endDays,arguments, then the returned result
4545
* will also be an array with matching dimensions
4646
*/
47-
public static function between($startDate = 0, $endDate = 0, $method = false)
47+
public static function between($startDate = 0, $endDate = 0, $method = false): array|string|int
4848
{
4949
if (is_array($startDate) || is_array($endDate) || is_array($method)) {
5050
return self::evaluateArrayArguments([self::class, __FUNCTION__], $startDate, $endDate, $method);

src/PhpSpreadsheet/Calculation/DateTimeExcel/NetworkDays.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class NetworkDays
3333
* If an array of values is passed for the $startDate or $endDate arguments, then the returned result
3434
* will also be an array with matching dimensions
3535
*/
36-
public static function count($startDate, $endDate, ...$dateArgs)
36+
public static function count($startDate, $endDate, ...$dateArgs): array|string|int
3737
{
3838
if (is_array($startDate) || is_array($endDate)) {
3939
return self::evaluateArrayArgumentsSubset(

src/PhpSpreadsheet/Calculation/Engineering.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,10 +1320,8 @@ public static function ERFC($x)
13201320
* @deprecated 1.16.0
13211321
* Use the getConversionCategories() method in the Engineering\ConvertUOM class instead
13221322
* @see Engineering\ConvertUOM::getConversionCategories()
1323-
*
1324-
* @return array
13251323
*/
1326-
public static function getConversionGroups()
1324+
public static function getConversionGroups(): array
13271325
{
13281326
return Engineering\ConvertUOM::getConversionCategories();
13291327
}
@@ -1337,10 +1335,8 @@ public static function getConversionGroups()
13371335
* @see Engineering\ConvertUOM::getConversionCategoryUnits()
13381336
*
13391337
* @param null|mixed $category
1340-
*
1341-
* @return array
13421338
*/
1343-
public static function getConversionGroupUnits($category = null)
1339+
public static function getConversionGroupUnits($category = null): array
13441340
{
13451341
return Engineering\ConvertUOM::getConversionCategoryUnits($category);
13461342
}
@@ -1353,10 +1349,8 @@ public static function getConversionGroupUnits($category = null)
13531349
* @see Engineering\ConvertUOM::getConversionCategoryUnitDetails()
13541350
*
13551351
* @param null|mixed $category
1356-
*
1357-
* @return array
13581352
*/
1359-
public static function getConversionGroupUnitDetails($category = null)
1353+
public static function getConversionGroupUnitDetails($category = null): array
13601354
{
13611355
return Engineering\ConvertUOM::getConversionCategoryUnitDetails($category);
13621356
}

src/PhpSpreadsheet/Calculation/Engineering/BitWise.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,8 @@ public static function BITRSHIFT($number, $shiftAmount)
211211
* Validate arguments passed to the bitwise functions.
212212
*
213213
* @param mixed $value
214-
*
215-
* @return float
216214
*/
217-
private static function validateBitwiseArgument($value)
215+
private static function validateBitwiseArgument($value): float
218216
{
219217
$value = self::nullFalseTrueToNumber($value);
220218

src/PhpSpreadsheet/Calculation/Engineering/Complex.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static function COMPLEX($realNumber = 0.0, $imaginary = 0.0, $suffix = 'i
7474
* If an array of numbers is passed as an argument, then the returned result will also be an array
7575
* with the same dimensions
7676
*/
77-
public static function IMAGINARY($complexNumber)
77+
public static function IMAGINARY($complexNumber): array|string|float
7878
{
7979
if (is_array($complexNumber)) {
8080
return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
@@ -104,7 +104,7 @@ public static function IMAGINARY($complexNumber)
104104
* If an array of numbers is passed as an argument, then the returned result will also be an array
105105
* with the same dimensions
106106
*/
107-
public static function IMREAL($complexNumber)
107+
public static function IMREAL($complexNumber): array|string|float
108108
{
109109
if (is_array($complexNumber)) {
110110
return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);

src/PhpSpreadsheet/Calculation/Engineering/ConvertDecimal.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ConvertDecimal extends ConvertBase
4545
* If an array of numbers is passed as an argument, then the returned result will also be an array
4646
* with the same dimensions
4747
*/
48-
public static function toBinary($value, $places = null)
48+
public static function toBinary($value, $places = null): array|string
4949
{
5050
if (is_array($value) || is_array($places)) {
5151
return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places);
@@ -102,7 +102,7 @@ public static function toBinary($value, $places = null)
102102
* If an array of numbers is passed as an argument, then the returned result will also be an array
103103
* with the same dimensions
104104
*/
105-
public static function toHex($value, $places = null)
105+
public static function toHex($value, $places = null): array|string
106106
{
107107
if (is_array($value) || is_array($places)) {
108108
return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places);
@@ -178,7 +178,7 @@ public static function hex32bit(float $value, string $hexstr, bool $force = fals
178178
* If an array of numbers is passed as an argument, then the returned result will also be an array
179179
* with the same dimensions
180180
*/
181-
public static function toOctal($value, $places = null)
181+
public static function toOctal($value, $places = null): array|string
182182
{
183183
if (is_array($value) || is_array($places)) {
184184
return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places);

src/PhpSpreadsheet/Calculation/Engineering/ConvertOctal.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public static function toDecimal($value)
142142
* If an array of numbers is passed as an argument, then the returned result will also be an array
143143
* with the same dimensions
144144
*/
145-
public static function toHex($value, $places = null)
145+
public static function toHex($value, $places = null): array|string
146146
{
147147
if (is_array($value) || is_array($places)) {
148148
return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $places);

0 commit comments

Comments
 (0)