diff --git a/composer.lock b/composer.lock index 090fe7a..76221c4 100644 --- a/composer.lock +++ b/composer.lock @@ -1944,16 +1944,16 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.2", + "version": "2.1.3", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "7d08f569e582ade182a375c366cbd896eccadd3a" + "reference": "64ae44e48214f3deebdaeebf2694297a10a2bea9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/7d08f569e582ade182a375c366cbd896eccadd3a", - "reference": "7d08f569e582ade182a375c366cbd896eccadd3a", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/64ae44e48214f3deebdaeebf2694297a10a2bea9", + "reference": "64ae44e48214f3deebdaeebf2694297a10a2bea9", "shasum": "" }, "require": { @@ -1998,7 +1998,7 @@ "type": "github" } ], - "time": "2025-01-21T14:54:06+00:00" + "time": "2025-02-07T15:05:24+00:00" }, { "name": "phpstan/phpstan-phpunit", @@ -3256,21 +3256,21 @@ }, { "name": "rector/rector", - "version": "2.0.7", + "version": "2.0.8", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "e70d681f6a0c361a63e6825897cd97746436f015" + "reference": "3c70238bc677eb98866000a05b19a34f12955954" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/e70d681f6a0c361a63e6825897cd97746436f015", - "reference": "e70d681f6a0c361a63e6825897cd97746436f015", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/3c70238bc677eb98866000a05b19a34f12955954", + "reference": "3c70238bc677eb98866000a05b19a34f12955954", "shasum": "" }, "require": { "php": "^7.4|^8.0", - "phpstan/phpstan": "^2.1.1" + "phpstan/phpstan": "^2.1.2" }, "conflict": { "rector/rector-doctrine": "*", @@ -3303,7 +3303,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/2.0.7" + "source": "https://github.com/rectorphp/rector/tree/2.0.8" }, "funding": [ { @@ -3311,7 +3311,7 @@ "type": "github" } ], - "time": "2025-01-19T09:41:28+00:00" + "time": "2025-02-06T14:02:49+00:00" }, { "name": "sebastian/cli-parser", diff --git a/tests/IsoFileTest.php b/tests/IsoFileTest.php index 4b0dd48..b5df3cb 100644 --- a/tests/IsoFileTest.php +++ b/tests/IsoFileTest.php @@ -86,19 +86,19 @@ public function testDescriptorsTestDirIso(): void $this->assertSame('CDROM', $primaryVolumeDescriptor->volumeId); $this->assertSame(198, $primaryVolumeDescriptor->volumeSpaceSize); $this->assertSame('GENISOIMAGE ISO 9660/HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE (C) 1997-2006 J.PEARSON/J.SCHILLING (C) 2006-2007 CDRKIT TEAM', $primaryVolumeDescriptor->appId); - $this->assertNotNull($primaryVolumeDescriptor->creationDate); + $this->assertInstanceOf(Carbon::class, $primaryVolumeDescriptor->creationDate); $this->assertSame(Carbon::create(2025, 1, 15, 9, 41, 36, 'Europe/Paris')?->toDateTimeString(), $primaryVolumeDescriptor->creationDate->toDateTimeString()); - $this->assertNotNull($primaryVolumeDescriptor->modificationDate); + $this->assertInstanceOf(Carbon::class, $primaryVolumeDescriptor->modificationDate); $this->assertSame(Carbon::create(2025, 1, 15, 9, 41, 36, 'Europe/Paris')?->toDateTimeString(), $primaryVolumeDescriptor->modificationDate->toDateTimeString()); - $this->assertNull($primaryVolumeDescriptor->expirationDate); - $this->assertNotNull($primaryVolumeDescriptor->effectiveDate); + $this->assertNotInstanceOf(Carbon::class, $primaryVolumeDescriptor->expirationDate); + $this->assertInstanceOf(Carbon::class, $primaryVolumeDescriptor->effectiveDate); $this->assertSame(Carbon::create(2025, 1, 15, 9, 41, 36, 'Europe/Paris')?->toDateTimeString(), $primaryVolumeDescriptor->effectiveDate->toDateTimeString()); // check root directory $rootDirectory = $primaryVolumeDescriptor->rootDirectory; $this->assertSame('.', $rootDirectory->fileId); $this->assertTrue($rootDirectory->isDirectory()); - $this->assertNotNull($rootDirectory->recordingDate); + $this->assertInstanceOf(Carbon::class, $rootDirectory->recordingDate); $this->assertSame(Carbon::create(2025, 1, 15, 9, 41, 9, 'Europe/Paris')?->toDateTimeString(), $rootDirectory->recordingDate->toDateTimeString()); // check path table @@ -182,19 +182,19 @@ public function testDescriptorsSubdirIso(): void $this->assertSame('CDROM', $primaryVolumeDescriptor->volumeId); $this->assertSame(181, $primaryVolumeDescriptor->volumeSpaceSize); $this->assertSame('GENISOIMAGE ISO 9660/HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE (C) 1997-2006 J.PEARSON/J.SCHILLING (C) 2006-2007 CDRKIT TEAM', $primaryVolumeDescriptor->appId); - $this->assertNotNull($primaryVolumeDescriptor->creationDate); + $this->assertInstanceOf(Carbon::class, $primaryVolumeDescriptor->creationDate); $this->assertSame(Carbon::create(2025, 1, 15, 16, 7, 41, 'Europe/Paris')?->toDateTimeString(), $primaryVolumeDescriptor->creationDate->toDateTimeString()); - $this->assertNotNull($primaryVolumeDescriptor->modificationDate); + $this->assertInstanceOf(Carbon::class, $primaryVolumeDescriptor->modificationDate); $this->assertSame(Carbon::create(2025, 1, 15, 16, 7, 41, 'Europe/Paris')?->toDateTimeString(), $primaryVolumeDescriptor->modificationDate->toDateTimeString()); - $this->assertNull($primaryVolumeDescriptor->expirationDate); - $this->assertNotNull($primaryVolumeDescriptor->effectiveDate); + $this->assertNotInstanceOf(Carbon::class, $primaryVolumeDescriptor->expirationDate); + $this->assertInstanceOf(Carbon::class, $primaryVolumeDescriptor->effectiveDate); $this->assertSame(Carbon::create(2025, 1, 15, 16, 7, 41, 'Europe/Paris')?->toDateTimeString(), $primaryVolumeDescriptor->effectiveDate->toDateTimeString()); // check root directory $rootDirectory = $primaryVolumeDescriptor->rootDirectory; $this->assertSame('.', $rootDirectory->fileId); $this->assertTrue($rootDirectory->isDirectory()); - $this->assertNotNull($rootDirectory->recordingDate); + $this->assertInstanceOf(Carbon::class, $rootDirectory->recordingDate); $this->assertSame(Carbon::create(2025, 1, 15, 16, 7, 30, 'Europe/Paris')?->toDateTimeString(), $rootDirectory->recordingDate->toDateTimeString()); // check path table @@ -284,10 +284,10 @@ public function testDescriptorsDosIso(): void $this->assertSame('DOS4.01', $primaryVolumeDescriptor->volumeId); $this->assertSame(848, $primaryVolumeDescriptor->volumeSpaceSize); $this->assertSame('', $primaryVolumeDescriptor->appId); - $this->assertNull($primaryVolumeDescriptor->creationDate); - $this->assertNull($primaryVolumeDescriptor->modificationDate); - $this->assertNull($primaryVolumeDescriptor->expirationDate); - $this->assertNull($primaryVolumeDescriptor->effectiveDate); + $this->assertNotInstanceOf(Carbon::class, $primaryVolumeDescriptor->creationDate); + $this->assertNotInstanceOf(Carbon::class, $primaryVolumeDescriptor->modificationDate); + $this->assertNotInstanceOf(Carbon::class, $primaryVolumeDescriptor->expirationDate); + $this->assertNotInstanceOf(Carbon::class, $primaryVolumeDescriptor->effectiveDate); /** @var Boot $bootDescriptor */ $bootDescriptor = $isoFile->descriptors[Type::BOOT_RECORD_DESC]; @@ -312,10 +312,10 @@ public function testDescriptorsDosIso(): void $this->assertSame(848, $supplementaryVolumeDescriptor->volumeSpaceSize); $this->assertSame('', $supplementaryVolumeDescriptor->appId); $this->assertSame(3, $supplementaryVolumeDescriptor->jolietLevel); - $this->assertNull($supplementaryVolumeDescriptor->creationDate); - $this->assertNull($supplementaryVolumeDescriptor->modificationDate); - $this->assertNull($supplementaryVolumeDescriptor->expirationDate); - $this->assertNull($supplementaryVolumeDescriptor->effectiveDate); + $this->assertNotInstanceOf(Carbon::class, $supplementaryVolumeDescriptor->creationDate); + $this->assertNotInstanceOf(Carbon::class, $supplementaryVolumeDescriptor->modificationDate); + $this->assertNotInstanceOf(Carbon::class, $supplementaryVolumeDescriptor->expirationDate); + $this->assertNotInstanceOf(Carbon::class, $supplementaryVolumeDescriptor->effectiveDate); } public function testDescriptorsIso9660HfsPartIso(): void diff --git a/tests/IsoFileTestUdf.php b/tests/IsoFileTestUdf.php index 8a49c5b..4e9edbc 100644 --- a/tests/IsoFileTestUdf.php +++ b/tests/IsoFileTestUdf.php @@ -60,12 +60,12 @@ public function testDescriptorsTestIso(): void $this->assertSame('PHP_ISO_FILE', $primaryVolumeDescriptor->volumeId); $this->assertSame(599, $primaryVolumeDescriptor->volumeSpaceSize); $this->assertSame('IMGBURN V2.5.8.0 - THE ULTIMATE IMAGE BURNER!', $primaryVolumeDescriptor->appId); - $this->assertNotNull($primaryVolumeDescriptor->creationDate); + $this->assertInstanceOf(Carbon::class, $primaryVolumeDescriptor->creationDate); $this->assertSame(Carbon::create(2025, 1, 12, 15, 0, 53, 'Europe/Paris')?->toDateTimeString(), $primaryVolumeDescriptor->creationDate->toDateTimeString()); - $this->assertNotNull($primaryVolumeDescriptor->modificationDate); + $this->assertInstanceOf(Carbon::class, $primaryVolumeDescriptor->modificationDate); $this->assertSame(Carbon::create(2025, 1, 12, 15, 0, 53, 'Europe/Paris')?->toDateTimeString(), $primaryVolumeDescriptor->modificationDate->toDateTimeString()); - $this->assertNull($primaryVolumeDescriptor->expirationDate); - $this->assertNull($primaryVolumeDescriptor->effectiveDate); + $this->assertNotInstanceOf(Carbon::class, $primaryVolumeDescriptor->expirationDate); + $this->assertNotInstanceOf(Carbon::class, $primaryVolumeDescriptor->effectiveDate); // check root directory $rootDirectory = $primaryVolumeDescriptor->rootDirectory; @@ -78,7 +78,7 @@ public function testDescriptorsTestIso(): void $this->assertFalse($rootDirectory->isMultiExtent()); $this->assertTrue($rootDirectory->isThis()); $this->assertFalse($rootDirectory->isParent()); - $this->assertNotNull($rootDirectory->recordingDate); + $this->assertInstanceOf(Carbon::class, $rootDirectory->recordingDate); $this->assertSame(Carbon::create(2025, 1, 12, 15, 0, 53, 'Europe/Paris')?->toDateTimeString(), $rootDirectory->recordingDate->toDateTimeString()); // check path table @@ -191,12 +191,12 @@ public function testDescriptorsIso9660UdfIso(): void $this->assertSame('UDF Bridge', $primaryVolumeDescriptor->volumeId); $this->assertSame(460, $primaryVolumeDescriptor->volumeSpaceSize); $this->assertSame('GENISOIMAGE ISO 9660/HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE (C) 1997-2006 J.PEARSON/J.SCHILLING (C) 2006-2007 CDRKIT TEAM', $primaryVolumeDescriptor->appId); - $this->assertNotNull($primaryVolumeDescriptor->creationDate); + $this->assertInstanceOf(Carbon::class, $primaryVolumeDescriptor->creationDate); $this->assertSame(Carbon::create(2022, 4, 7, 20, 31, 13, 'Europe/Paris')?->toDateTimeString(), $primaryVolumeDescriptor->creationDate->toDateTimeString()); - $this->assertNotNull($primaryVolumeDescriptor->modificationDate); + $this->assertInstanceOf(Carbon::class, $primaryVolumeDescriptor->modificationDate); $this->assertSame(Carbon::create(2022, 4, 7, 20, 31, 13, 'Europe/Paris')?->toDateTimeString(), $primaryVolumeDescriptor->modificationDate->toDateTimeString()); - $this->assertNull($primaryVolumeDescriptor->expirationDate); - $this->assertNotNull($primaryVolumeDescriptor->effectiveDate); + $this->assertNotInstanceOf(Carbon::class, $primaryVolumeDescriptor->expirationDate); + $this->assertInstanceOf(Carbon::class, $primaryVolumeDescriptor->effectiveDate); $this->assertSame(Carbon::create(2022, 4, 7, 20, 31, 13, 'Europe/Paris')?->toDateTimeString(), $primaryVolumeDescriptor->effectiveDate->toDateTimeString()); /** @var SupplementaryVolume $supplementaryVolumeDescriptor */ @@ -214,12 +214,12 @@ public function testDescriptorsIso9660UdfIso(): void $this->assertSame(460, $supplementaryVolumeDescriptor->volumeSpaceSize); // TODO - fix encoding // $this->assertSame('GENISOIMAGE ISO 9660_HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE', $supplementaryVolumeDescriptor->appId); - $this->assertNotNull($supplementaryVolumeDescriptor->creationDate); + $this->assertInstanceOf(Carbon::class, $supplementaryVolumeDescriptor->creationDate); $this->assertSame(Carbon::create(2022, 4, 7, 20, 31, 13, 'Europe/Paris')?->toDateTimeString(), $supplementaryVolumeDescriptor->creationDate->toDateTimeString()); - $this->assertNotNull($supplementaryVolumeDescriptor->modificationDate); + $this->assertInstanceOf(Carbon::class, $supplementaryVolumeDescriptor->modificationDate); $this->assertSame(Carbon::create(2022, 4, 7, 20, 31, 13, 'Europe/Paris')?->toDateTimeString(), $supplementaryVolumeDescriptor->modificationDate->toDateTimeString()); - $this->assertNull($supplementaryVolumeDescriptor->expirationDate); - $this->assertNotNull($supplementaryVolumeDescriptor->effectiveDate); + $this->assertNotInstanceOf(Carbon::class, $supplementaryVolumeDescriptor->expirationDate); + $this->assertInstanceOf(Carbon::class, $supplementaryVolumeDescriptor->effectiveDate); $this->assertSame(Carbon::create(2022, 4, 7, 20, 31, 13, 'Europe/Paris')?->toDateTimeString(), $supplementaryVolumeDescriptor->effectiveDate->toDateTimeString()); // TODO - add assert for UDF volumes diff --git a/tests/Util/IsoDateTest.php b/tests/Util/IsoDateTest.php index 543332d..f7f40a5 100644 --- a/tests/Util/IsoDateTest.php +++ b/tests/Util/IsoDateTest.php @@ -30,7 +30,7 @@ public function testInit7InvalidDate(): void $date = IsoDate::init7($buffer, $offset); - $this->assertNull($date); + $this->assertNotInstanceOf(Carbon::class, $date); $this->assertSame(7, $offset); } @@ -39,7 +39,7 @@ public function testInit17ValidDate(): void $buffer = array_map('ord', str_split('2023051510304516')); // Represents 2023-05-15 10:30:45.16 UTC $offset = 0; $expectedDate = Carbon::create(2023, 5, 15, 10, 30, 45, 0); - $this->assertNotNull($expectedDate); + $this->assertInstanceOf(Carbon::class, $expectedDate); $expectedDate->addMilliseconds(16); $date = IsoDate::init17($buffer, $offset); @@ -56,7 +56,7 @@ public function testInit17InvalidDate(): void $date = IsoDate::init17($buffer, $offset); - $this->assertNull($date); + $this->assertNotInstanceOf(Carbon::class, $date); $this->assertSame(17, $offset); } }