diff --git a/Command/InspectUlidCommand.php b/Command/InspectUlidCommand.php index f0943e5..5451c50 100644 --- a/Command/InspectUlidCommand.php +++ b/Command/InspectUlidCommand.php @@ -66,7 +66,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ['toBase58', $ulid->toBase58()], ['toRfc4122', $ulid->toRfc4122()], new TableSeparator(), - ['Time', ($ulid->getDateTime())->format('Y-m-d H:i:s.v \U\T\C')], + ['Time', $ulid->getDateTime()->format('Y-m-d H:i:s.v \U\T\C')], ]); return 0; diff --git a/Tests/Command/InspectUuidCommandTest.php b/Tests/Command/InspectUuidCommandTest.php index 5aa083c..0896b0d 100644 --- a/Tests/Command/InspectUuidCommandTest.php +++ b/Tests/Command/InspectUuidCommandTest.php @@ -42,7 +42,7 @@ public function testNil() EOF - , $commandTester->getDisplay(true)); + , $commandTester->getDisplay(true)); } public function testUnknown() diff --git a/Tests/Factory/UlidFactoryTest.php b/Tests/Factory/UlidFactoryTest.php index 195c246..7fc25c5 100644 --- a/Tests/Factory/UlidFactoryTest.php +++ b/Tests/Factory/UlidFactoryTest.php @@ -28,7 +28,7 @@ public function testCreate() $this->assertSame('999999.123000', $ulid2->getDateTime()->format('U.u')); $this->assertFalse($ulid1->equals($ulid2)); - $this->assertSame(-1, ($ulid1->compare($ulid2))); + $this->assertSame(-1, $ulid1->compare($ulid2)); $ulid3 = $ulidFactory->create(new \DateTime('@1234.162524')); $this->assertSame('1234.162000', $ulid3->getDateTime()->format('U.u')); diff --git a/Tests/UuidTest.php b/Tests/UuidTest.php index ba9df67..dad559f 100644 --- a/Tests/UuidTest.php +++ b/Tests/UuidTest.php @@ -320,13 +320,13 @@ public function testFromStringOnExtendedClassReturnsStatic() public function testGetDateTime() { - $this->assertEquals(\DateTimeImmutable::createFromFormat('U.u', '103072857660.684697'), ((new UuidV1('ffffffff-ffff-1fff-a456-426655440000'))->getDateTime())); - $this->assertEquals(\DateTimeImmutable::createFromFormat('U.u', '0.000001'), ((new UuidV1('1381400a-1dd2-11b2-a456-426655440000'))->getDateTime())); + $this->assertEquals(\DateTimeImmutable::createFromFormat('U.u', '103072857660.684697'), (new UuidV1('ffffffff-ffff-1fff-a456-426655440000'))->getDateTime()); + $this->assertEquals(\DateTimeImmutable::createFromFormat('U.u', '0.000001'), (new UuidV1('1381400a-1dd2-11b2-a456-426655440000'))->getDateTime()); $this->assertEquals(new \DateTimeImmutable('@0'), (new UuidV1('13814001-1dd2-11b2-a456-426655440000'))->getDateTime()); $this->assertEquals(new \DateTimeImmutable('@0'), (new UuidV1('13814000-1dd2-11b2-a456-426655440000'))->getDateTime()); $this->assertEquals(new \DateTimeImmutable('@0'), (new UuidV1('13813fff-1dd2-11b2-a456-426655440000'))->getDateTime()); - $this->assertEquals(\DateTimeImmutable::createFromFormat('U.u', '-0.000001'), ((new UuidV1('13813ff6-1dd2-11b2-a456-426655440000'))->getDateTime())); - $this->assertEquals(new \DateTimeImmutable('@-12219292800'), ((new UuidV1('00000000-0000-1000-a456-426655440000'))->getDateTime())); + $this->assertEquals(\DateTimeImmutable::createFromFormat('U.u', '-0.000001'), (new UuidV1('13813ff6-1dd2-11b2-a456-426655440000'))->getDateTime()); + $this->assertEquals(new \DateTimeImmutable('@-12219292800'), (new UuidV1('00000000-0000-1000-a456-426655440000'))->getDateTime()); } public function testFromStringBase58Padding()