-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix PHPDoc #24
Fix PHPDoc #24
Conversation
Actually, neither So you've discovered a potential bug, because rest of the |
Actually the result of |
Yeah, which is why we need to fix those two methods to convert passed |
This already happens in the constructor. |
Correct, but it doesn't happen in these setter methods. Let me demonstrate what could happen:
Therefore they need to be modified, like so for example:
|
I have to correct myself: it's in The code already prevents that any attribute may became __construct(int $major, int $minor, int $patch, PreRelease $preRelease, Build $build) This test shows that everything is as it should be: $version1 = Version::fromParts(1, 2, 3, PreRelease::fromIdentifiers('4'));
$this->assertEquals(PreRelease::fromIdentifiers('4'), $version1->getPreRelease());
$this->assertTrue($version1->isPreRelease());
$version2 = $version1->withPreRelease(null);
$this->assertEquals(new NoPreRelease(), $version2->getPreRelease());
$this->assertFalse($version2->isPreRelease()); |
Yeah, we are at the same page now, got it. 👍 |
No description provided.