Skip to content

Commit

Permalink
minor #36075 [UID] Rename NullUuid to NilUuid (ro0NL)
Browse files Browse the repository at this point in the history
This PR was merged into the 5.1-dev branch.

Discussion
----------

[UID] Rename NullUuid to NilUuid

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch master.
-->
As per https://tools.ietf.org/html/rfc4122#section-4.1.7

Commits
-------

cbb6d23 [UID] Rename NullUuid to NilUuid
  • Loading branch information
fabpot committed Mar 15, 2020
2 parents 68dec1a + cbb6d23 commit 1d955cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Expand Up @@ -16,7 +16,7 @@
*
* @author Grégoire Pineau <lyrixx@lyrixx.info>
*/
class NullUuid extends Uuid
class NilUuid extends Uuid
{
protected const TYPE = UUID_TYPE_NULL;

Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/Uid/Tests/UuidTest.php
Expand Up @@ -12,7 +12,7 @@
namespace Symfony\Tests\Component\Uid;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Uid\NullUuid;
use Symfony\Component\Uid\NilUuid;
use Symfony\Component\Uid\Uuid;
use Symfony\Component\Uid\UuidV1;
use Symfony\Component\Uid\UuidV3;
Expand Down Expand Up @@ -146,11 +146,11 @@ public function testCompare()
$this->assertSame([$a, $b, $c, $d], $uuids);
}

public function testNullUuid()
public function testNilUuid()
{
$uuid = Uuid::fromString('00000000-0000-0000-0000-000000000000');

$this->assertInstanceOf(NullUuid::class, $uuid);
$this->assertInstanceOf(NilUuid::class, $uuid);
$this->assertSame('00000000-0000-0000-0000-000000000000', (string) $uuid);
}
}
2 changes: 1 addition & 1 deletion src/Symfony/Component/Uid/Uuid.php
Expand Up @@ -50,7 +50,7 @@ public static function fromString(string $uuid): self
case UuidV4::TYPE: return new UuidV4($uuid);
case UuidV5::TYPE: return new UuidV5($uuid);
case UuidV6::TYPE: return new UuidV6($uuid);
case NullUuid::TYPE: return new NullUuid();
case NilUuid::TYPE: return new NilUuid();
case self::TYPE: return new self($uuid);
}

Expand Down

0 comments on commit 1d955cc

Please sign in to comment.