From f4ebc351f3c4e6ea51bfec5b8d13d936240dfe70 Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Thu, 13 Aug 2026 11:43:53 +0200 Subject: [PATCH] Add type check in test (to satisfy phpstan) --- tests/NodaTimeSplitterTest.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/NodaTimeSplitterTest.php b/tests/NodaTimeSplitterTest.php index d9fdd51..0d1d0fa 100644 --- a/tests/NodaTimeSplitterTest.php +++ b/tests/NodaTimeSplitterTest.php @@ -1372,14 +1372,16 @@ final class NodaTimeSplitterTest extends TestCase { $output = NodaTimeSplitter::attempt_splitting("20th century"); self::assertNotEmpty($output); - self::assertEquals($output->toOldFormat(), [ - 0 => "1901", - 1 => "2000", - 2 => "00", - 3 => "00", - 4 => "+", - 5 => "", - ]); + if ($output !== false) { + self::assertEquals($output->toOldFormat(), [ + 0 => "1901", + 1 => "2000", + 2 => "00", + 3 => "00", + 4 => "+", + 5 => "", + ]); + } self::assertEquals($output->toTimeName(), "1901-2000"); self::assertEquals(NodaTimeSplitter::timePartsToCountingYear($output), 1951);