@@ -34,7 +34,7 @@ class SapDateTimeTest extends TestCase
3434 /**
3535 * Data provider for valid SAP week strings and the expected output.
3636 *
37- * @return array
37+ * @return array<int, array<int, string>>
3838 */
3939 public static function validSapWeeks (): array
4040 {
@@ -58,7 +58,7 @@ public static function validSapWeeks(): array
5858 * @dataProvider validSapWeeks
5959 * @throws Exception
6060 */
61- public function testParseSapWeeks (string $ sapWeek , string $ expected , string $ timestamp )
61+ public function testParseSapWeeks (string $ sapWeek , string $ expected , string $ timestamp ): void
6262 {
6363 $ dateTime = SapDateTime::createFromFormat (SapDateTime::SAP_WEEK , $ sapWeek );
6464 static ::assertInstanceOf (DateTime::class, $ dateTime );
@@ -69,7 +69,7 @@ public function testParseSapWeeks(string $sapWeek, string $expected, string $tim
6969 /**
7070 * Data provider for invalid SAP week strings.
7171 *
72- * @return array
72+ * @return array<int, array<int, string>>
7373 */
7474 public static function invalidSapWeeks (): array
7575 {
@@ -88,15 +88,15 @@ public static function invalidSapWeeks(): array
8888 * @dataProvider invalidSapWeeks
8989 * @throws Exception
9090 */
91- public function testParseInvalidSapWeeks (string $ sapWeek )
91+ public function testParseInvalidSapWeeks (string $ sapWeek ): void
9292 {
9393 $ dateTime = SapDateTime::createFromFormat (SapDateTime::SAP_WEEK , $ sapWeek );
9494 static ::assertFalse ($ dateTime );
9595 }
9696
9797 /**
9898 * Data provider of timestamps and their according SAP week strings.
99- * @return array
99+ * @return array<int, array<int, string>>
100100 */
101101 public static function timestampsAndSapWeeks (): array
102102 {
@@ -118,7 +118,7 @@ public static function timestampsAndSapWeeks(): array
118118 * @throws Exception
119119 * @dataProvider timestampsAndSapWeeks
120120 */
121- public function testCreateSapWeeks (string $ timestamp , string $ expected )
121+ public function testCreateSapWeeks (string $ timestamp , string $ expected ): void
122122 {
123123 $ dateTime = new SapDateTime ($ timestamp );
124124 $ sapWeekString = $ dateTime ->format (SapDateTime::SAP_WEEK );
@@ -127,7 +127,7 @@ public function testCreateSapWeeks(string $timestamp, string $expected)
127127
128128 /**
129129 * Data provider of SAP dates and their ISO date representations.
130- * @return array
130+ * @return array<int, array<int, string>>
131131 */
132132 public static function sapDatesAndIsoDates (): array
133133 {
@@ -149,15 +149,16 @@ public static function sapDatesAndIsoDates(): array
149149 * @throws Exception
150150 * @dataProvider sapDatesAndIsoDates
151151 */
152- public function testParseSapDates (string $ sapDate , string $ isoDate )
152+ public function testParseSapDates (string $ sapDate , string $ isoDate ): void
153153 {
154154 $ dateTime = SapDateTime::createFromFormat (SapDateTime::SAP_DATE , $ sapDate );
155+ static ::assertInstanceOf (DateTime::class, $ dateTime );
155156 static ::assertSame ($ isoDate , $ dateTime ->format ('Y-m-d H:i:s ' ));
156157 }
157158
158159 /**
159160 * Data provider of times and their according SAP time strings.
160- * @return array
161+ * @return array<int, array<int, string>>
161162 */
162163 public static function timesAndSapTimes (): array
163164 {
@@ -176,7 +177,7 @@ public static function timesAndSapTimes(): array
176177 * @throws Exception
177178 * @dataProvider timesAndSapTimes
178179 */
179- public function testCreateSapTimes (string $ isoTime , string $ sapTime )
180+ public function testCreateSapTimes (string $ isoTime , string $ sapTime ): void
180181 {
181182 $ dateTime = new SapDateTime ($ isoTime );
182183 static ::assertSame ($ sapTime , $ dateTime ->format (SapDateTime::SAP_TIME ));
@@ -189,15 +190,16 @@ public function testCreateSapTimes(string $isoTime, string $sapTime)
189190 * @throws Exception
190191 * @dataProvider timesAndSapTimes
191192 */
192- public function testParseSapTimes (string $ isoTime , string $ sapTime )
193+ public function testParseSapTimes (string $ isoTime , string $ sapTime ): void
193194 {
194195 $ dateTime = SapDateTime::createFromFormat (SapDateTime::SAP_TIME , $ sapTime );
196+ static ::assertInstanceOf (DateTime::class, $ dateTime );
195197 static ::assertSame ($ isoTime , $ dateTime ->format ('H:i:s ' ));
196198 }
197199
198200 /**
199201 * Data provider of timestamps and their according SAP dates.
200- * @return array
202+ * @return array<int, array<int, string>>
201203 */
202204 public static function timestampsAndSapDates (): array
203205 {
@@ -219,15 +221,15 @@ public static function timestampsAndSapDates(): array
219221 * @throws Exception
220222 * @dataProvider timestampsAndSapDates
221223 */
222- public function testCreateSapDates (string $ timestamp , string $ sapDate )
224+ public function testCreateSapDates (string $ timestamp , string $ sapDate ): void
223225 {
224226 $ dateTime = new SapDateTime ($ timestamp );
225227 static ::assertSame ($ sapDate , $ dateTime ->format (SapDateTime::SAP_DATE ));
226228 }
227229
228230 /**
229231 * Data provider of timestamps and their according SAP timestamps.
230- * @return array
232+ * @return array<int, array<int, string>>
231233 */
232234 public static function timestampsAndSapTimestamps (): array
233235 {
@@ -249,9 +251,10 @@ public static function timestampsAndSapTimestamps(): array
249251 * @throws Exception
250252 * @dataProvider timestampsAndSapTimestamps
251253 */
252- public function testParseSapTimestamps (string $ isotime , string $ saptime )
254+ public function testParseSapTimestamps (string $ isotime , string $ saptime ): void
253255 {
254256 $ dateTime = SapDateTime::createFromFormat (SapDateTime::SAP_TIMESTAMP , $ saptime );
257+ static ::assertInstanceOf (DateTime::class, $ dateTime );
255258 static ::assertSame ($ isotime , $ dateTime ->format ('Y-m-d H:i:s ' ));
256259 }
257260
@@ -262,15 +265,15 @@ public function testParseSapTimestamps(string $isotime, string $saptime)
262265 * @throws Exception
263266 * @dataProvider timestampsAndSapTimestamps
264267 */
265- public function testCreateSapTimestamps (string $ isotime , string $ saptime )
268+ public function testCreateSapTimestamps (string $ isotime , string $ saptime ): void
266269 {
267270 $ dateTime = new SapDateTime ($ isotime );
268271 static ::assertSame ($ saptime , $ dateTime ->format (SapDateTime::SAP_TIMESTAMP ));
269272 }
270273
271274 /**
272275 * Data provider for timezones.
273- * @return array
276+ * @return array<int, array<int, mixed>>
274277 */
275278 public static function provideTimezones (): array
276279 {
@@ -309,9 +312,10 @@ public static function provideTimezones(): array
309312 * @param string $utc
310313 * @throws Exception
311314 */
312- public function testTimezones (string $ format , string $ time , DateTimeZone $ zone , string $ expected , string $ utc )
315+ public function testTimezones (string $ format , string $ time , DateTimeZone $ zone , string $ expected , string $ utc ): void
313316 {
314317 $ dateTime = SapDateTime::createFromFormat ($ format , $ time , $ zone );
318+ static ::assertInstanceOf (DateTime::class, $ dateTime );
315319 static ::assertSame ($ expected , $ dateTime ->format ('c ' ));
316320 $ dateTime ->setTimezone (new DateTimeZone ('UTC ' ));
317321 static ::assertSame ($ utc , $ dateTime ->format ('c ' ));
0 commit comments