Failed Conditions
Pull Request — master (#3876)
by Abdul Malik
17:26 queued 02:15
created
tests/PhpSpreadsheetTests/Shared/DateTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     /**
53 53
      * @dataProvider providerDateTimeExcelToTimestamp1900
54 54
      */
55
-    public function testDateTimeExcelToTimestamp1900(float|int $expectedResult, float|int $excelDateTimeValue): void
55
+    public function testDateTimeExcelToTimestamp1900(float | int $expectedResult, float | int $excelDateTimeValue): void
56 56
     {
57 57
         if ($expectedResult > PHP_INT_MAX || $expectedResult < PHP_INT_MIN) {
58 58
             self::markTestSkipped('Test invalid on 32-bit system.');
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     /**
72 72
      * @dataProvider providerDateTimeTimestampToExcel1900
73 73
      */
74
-    public function testDateTimeTimestampToExcel1900(float|int $expectedResult, float|int|string $unixTimestamp): void
74
+    public function testDateTimeTimestampToExcel1900(float | int $expectedResult, float | int | string $unixTimestamp): void
75 75
     {
76 76
         Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900);
77 77
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     /**
88 88
      * @dataProvider providerDateTimeDateTimeToExcel
89 89
      */
90
-    public function testDateTimeDateTimeToExcel(float|int $expectedResult, DateTimeInterface $dateTimeObject): void
90
+    public function testDateTimeDateTimeToExcel(float | int $expectedResult, DateTimeInterface $dateTimeObject): void
91 91
     {
92 92
         Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900);
93 93
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     /**
122 122
      * @dataProvider providerDateTimeExcelToTimestamp1904
123 123
      */
124
-    public function testDateTimeExcelToTimestamp1904(float|int $expectedResult, float|int $excelDateTimeValue): void
124
+    public function testDateTimeExcelToTimestamp1904(float | int $expectedResult, float | int $excelDateTimeValue): void
125 125
     {
126 126
         if ($expectedResult > PHP_INT_MAX || $expectedResult < PHP_INT_MIN) {
127 127
             self::markTestSkipped('Test invalid on 32-bit system.');
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     /**
141 141
      * @dataProvider providerDateTimeTimestampToExcel1904
142 142
      */
143
-    public function testDateTimeTimestampToExcel1904(mixed $expectedResult, float|int|string $unixTimestamp): void
143
+    public function testDateTimeTimestampToExcel1904(mixed $expectedResult, float | int | string $unixTimestamp): void
144 144
     {
145 145
         Date::setExcelCalendar(Date::CALENDAR_MAC_1904);
146 146
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
     /**
171 171
      * @dataProvider providerDateTimeExcelToTimestamp1900Timezone
172 172
      */
173
-    public function testDateTimeExcelToTimestamp1900Timezone(float|int $expectedResult, float|int $excelDateTimeValue, string $timezone): void
173
+    public function testDateTimeExcelToTimestamp1900Timezone(float | int $expectedResult, float | int $excelDateTimeValue, string $timezone): void
174 174
     {
175 175
         if (is_numeric($expectedResult) && ($expectedResult > PHP_INT_MAX || $expectedResult < PHP_INT_MIN)) {
176 176
             self::markTestSkipped('Test invalid on 32-bit system.');
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/Engineering/BitWise.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
      *
18 18
      * @return int[]
19 19
      */
20
-    private static function splitNumber(float|int $number): array
20
+    private static function splitNumber(float | int $number): array
21 21
     {
22 22
         return [(int) floor($number / self::SPLIT_DIVISOR), (int) fmod($number, self::SPLIT_DIVISOR)];
23 23
     }
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      * @return array|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
37 37
      *            with the same dimensions
38 38
      */
39
-    public static function BITAND(null|array|bool|float|int|string $number1, null|array|bool|float|int|string $number2): array|string|int|float
39
+    public static function BITAND(null | array | bool | float | int | string $number1, null | array | bool | float | int | string $number2): array | string | int | float
40 40
     {
41 41
         if (is_array($number1) || is_array($number2)) {
42 42
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $number1, $number2);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      * @return array|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
69 69
      *            with the same dimensions
70 70
      */
71
-    public static function BITOR(null|array|bool|float|int|string $number1, null|array|bool|float|int|string $number2): array|string|int|float
71
+    public static function BITOR(null | array | bool | float | int | string $number1, null | array | bool | float | int | string $number2): array | string | int | float
72 72
     {
73 73
         if (is_array($number1) || is_array($number2)) {
74 74
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $number1, $number2);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      * @return array|int|string If an array of numbers is passed as an argument, then the returned result will also be an array
102 102
      *            with the same dimensions
103 103
      */
104
-    public static function BITXOR(null|array|bool|float|int|string $number1, null|array|bool|float|int|string $number2): array|string|int|float
104
+    public static function BITXOR(null | array | bool | float | int | string $number1, null | array | bool | float | int | string $number2): array | string | int | float
105 105
     {
106 106
         if (is_array($number1) || is_array($number2)) {
107 107
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $number1, $number2);
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
135 135
      *            with the same dimensions
136 136
      */
137
-    public static function BITLSHIFT(null|array|bool|float|int|string $number, null|array|bool|float|int|string $shiftAmount): array|string|float
137
+    public static function BITLSHIFT(null | array | bool | float | int | string $number, null | array | bool | float | int | string $shiftAmount): array | string | float
138 138
     {
139 139
         if (is_array($number) || is_array($shiftAmount)) {
140 140
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $shiftAmount);
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
      * @return array|float|string If an array of numbers is passed as an argument, then the returned result will also be an array
170 170
      *            with the same dimensions
171 171
      */
172
-    public static function BITRSHIFT(null|array|bool|float|int|string $number, null|array|bool|float|int|string $shiftAmount): array|string|float
172
+    public static function BITRSHIFT(null | array | bool | float | int | string $number, null | array | bool | float | int | string $shiftAmount): array | string | float
173 173
     {
174 174
         if (is_array($number) || is_array($shiftAmount)) {
175 175
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $number, $shiftAmount);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/DateTimeExcel/Helpers.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
      *
18 18
      * @return bool TRUE if the year is a leap year, otherwise FALSE
19 19
      */
20
-    public static function isLeapYear(int|string $year): bool
20
+    public static function isLeapYear(int | string $year): bool
21 21
     {
22 22
         return (($year % 4) === 0) && (($year % 100) !== 0) || (($year % 400) === 0);
23 23
     }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      *
61 61
      * @return float|string Excel date/time serial value, or string if error
62 62
      */
63
-    public static function getTimeValue(string $timeValue): string|float
63
+    public static function getTimeValue(string $timeValue): string | float
64 64
     {
65 65
         $saveReturnDateType = Functions::getReturnDateType();
66 66
         Functions::setReturnDateType(Functions::RETURNDATE_EXCEL);
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
     /**
127 127
      * Return result in one of three formats.
128 128
      */
129
-    public static function returnIn3FormatsArray(array $dateArray, bool $noFrac = false): DateTime|float|int
129
+    public static function returnIn3FormatsArray(array $dateArray, bool $noFrac = false): DateTime | float | int
130 130
     {
131 131
         $retType = Functions::getReturnDateType();
132 132
         if ($retType === Functions::RETURNDATE_PHP_DATETIME_OBJECT) {
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     /**
160 160
      * Return result in one of three formats.
161 161
      */
162
-    public static function returnIn3FormatsFloat(float $excelDateValue): float|int|DateTime
162
+    public static function returnIn3FormatsFloat(float $excelDateValue): float | int | DateTime
163 163
     {
164 164
         $retType = Functions::getReturnDateType();
165 165
         if ($retType === Functions::RETURNDATE_EXCEL) {
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     /**
177 177
      * Return result in one of three formats.
178 178
      */
179
-    public static function returnIn3FormatsObject(DateTime $PHPDateObject): DateTime|float|int
179
+    public static function returnIn3FormatsObject(DateTime $PHPDateObject): DateTime | float | int
180 180
     {
181 181
         $retType = Functions::getReturnDateType();
182 182
         if ($retType === Functions::RETURNDATE_PHP_DATETIME_OBJECT) {
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
     /**
222 222
      * Many functions accept null argument treated as 0.
223 223
      */
224
-    public static function validateNumericNull(mixed $number): int|float
224
+    public static function validateNumericNull(mixed $number): int | float
225 225
     {
226 226
         $number = Functions::flattenSingleValue($number);
227 227
         if ($number === null) {
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
      *
279 279
      * @param array|false $dateArray
280 280
      */
281
-    private static function forceArray(array|bool $dateArray): array
281
+    private static function forceArray(array | bool $dateArray): array
282 282
     {
283 283
         return is_array($dateArray) ? $dateArray : ['error_count' => 1];
284 284
     }
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/DateTimeExcel/Current.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      * @return DateTime|float|int|string Excel date/time serial value, PHP date/time serial value or PHP date/time object,
26 26
      *                        depending on the value of the ReturnDateType flag
27 27
      */
28
-    public static function today(): DateTime|float|int|string
28
+    public static function today(): DateTime | float | int | string
29 29
     {
30 30
         $dti = new DateTimeImmutable();
31 31
         $dateArray = Helpers::dateParse($dti->format('c'));
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      * @return DateTime|float|int|string Excel date/time serial value, PHP date/time serial value or PHP date/time object,
51 51
      *                        depending on the value of the ReturnDateType flag
52 52
      */
53
-    public static function now(): DateTime|float|int|string
53
+    public static function now(): DateTime | float | int | string
54 54
     {
55 55
         $dti = new DateTimeImmutable();
56 56
         $dateArray = Helpers::dateParse($dti->format('c'));
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/DateTimeExcel/Month.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      *         If an array of values is passed as the argument, then the returned result will also be an array
35 35
      *            with the same dimensions
36 36
      */
37
-    public static function adjust(mixed $dateValue, array|string|bool|float|int $adjustmentMonths): DateTime|float|int|string|array
37
+    public static function adjust(mixed $dateValue, array | string | bool | float | int $adjustmentMonths): DateTime | float | int | string | array
38 38
     {
39 39
         if (is_array($dateValue) || is_array($adjustmentMonths)) {
40 40
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $dateValue, $adjustmentMonths);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      *         If an array of values is passed as the argument, then the returned result will also be an array
79 79
      *            with the same dimensions
80 80
      */
81
-    public static function lastDay(mixed $dateValue, array|float|int|bool|string $adjustmentMonths): array|string|DateTime|float|int
81
+    public static function lastDay(mixed $dateValue, array | float | int | bool | string $adjustmentMonths): array | string | DateTime | float | int
82 82
     {
83 83
         if (is_array($dateValue) || is_array($adjustmentMonths)) {
84 84
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $dateValue, $adjustmentMonths);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/DateTimeExcel/DateValue.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      *         If an array of numbers is passed as the argument, then the returned result will also be an array
41 41
      *            with the same dimensions
42 42
      */
43
-    public static function fromString(null|array|string|int|bool|float $dateValue): array|string|float|int|DateTime
43
+    public static function fromString(null | array | string | int | bool | float $dateValue): array | string | float | int | DateTime
44 44
     {
45 45
         if (is_array($dateValue)) {
46 46
             return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $dateValue);
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
      * @return DateTime|float|int|string Excel date/time serial value, PHP date/time serial value or PHP date/time object,
136 136
      *                        depending on the value of the ReturnDateType flag
137 137
      */
138
-    private static function finalResults(array $PHPDateArray, DateTimeImmutable $dti, int $baseYear): string|float|int|DateTime
138
+    private static function finalResults(array $PHPDateArray, DateTimeImmutable $dti, int $baseYear): string | float | int | DateTime
139 139
     {
140 140
         $retValue = ExcelError::Value();
141 141
         if (Helpers::dateParseSucceeded($PHPDateArray)) {
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/DateTimeExcel/WorkDay.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      *         If an array of values is passed for the $startDate or $endDays,arguments, then the returned result
37 37
      *            will also be an array with matching dimensions
38 38
      */
39
-    public static function date(mixed $startDate, array|int|string $endDays, mixed ...$dateArgs): array|float|int|DateTime|string
39
+    public static function date(mixed $startDate, array | int | string $endDays, mixed ...$dateArgs): array | float | int | DateTime | string
40 40
     {
41 41
         if (is_array($startDate) || is_array($endDays)) {
42 42
             return self::evaluateArrayArgumentsSubset(
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     /**
74 74
      * Use incrementing logic to determine Workday.
75 75
      */
76
-    private static function incrementing(float $startDate, int $endDays, array $holidayArray): float|int|DateTime
76
+    private static function incrementing(float $startDate, int $endDays, array $holidayArray): float | int | DateTime
77 77
     {
78 78
         //    Adjust the start date if it falls over a weekend
79 79
         $startDoW = self::getWeekDay($startDate, 3);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     /**
133 133
      * Use decrementing logic to determine Workday.
134 134
      */
135
-    private static function decrementing(float $startDate, int $endDays, array $holidayArray): float|int|DateTime
135
+    private static function decrementing(float $startDate, int $endDays, array $holidayArray): float | int | DateTime
136 136
     {
137 137
         //    Adjust the start date if it falls over a weekend
138 138
         $startDoW = self::getWeekDay($startDate, 3);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/DateTimeExcel/Date.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
      *         If an array of numbers is passed as the argument, then the returned result will also be an array
65 65
      *            with the same dimensions
66 66
      */
67
-    public static function fromYMD(array|float|int|string $year, array|float|int|string $month, array|float|int|string $day): float|int|DateTime|string|array
67
+    public static function fromYMD(array | float | int | string $year, array | float | int | string $month, array | float | int | string $day): float | int | DateTime | string | array
68 68
     {
69 69
         if (is_array($year) || is_array($month) || is_array($day)) {
70 70
             return self::evaluateArrayArguments([self::class, __FUNCTION__], $year, $month, $day);
Please login to merge, or discard this patch.
src/PhpSpreadsheet/Calculation/Statistical/MaxMinBase.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 
5 5
 abstract class MaxMinBase
6 6
 {
7
-    protected static function datatypeAdjustmentAllowStrings(int|float|string|bool $value): int|float
7
+    protected static function datatypeAdjustmentAllowStrings(int | float | string | bool $value): int | float
8 8
     {
9 9
         if (is_bool($value)) {
10 10
             return (int) $value;
Please login to merge, or discard this patch.