We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 53cf649 commit 4af19fbCopy full SHA for 4af19fb
lib/Doctrine/ODM/MongoDB/Id/UuidGenerator.php
@@ -54,7 +54,6 @@ public function setSalt($salt)
54
*/
55
public function getSalt()
56
{
57
- if (!isset($this->salt)) $this->setSalt(php_uname('n'));
58
return $this->salt;
59
}
60
@@ -76,12 +75,8 @@ public function isValid($guid)
76
75
77
public function generate(DocumentManager $dm, $document)
78
79
- if (!$this->salt) {
80
- throw new \Exception('Guid Generator requires a salt to be provided.');
81
- }
82
-
83
$guid = $this->generateV4();
84
- return $this->generateV5($guid, $this->salt);
+ return $this->generateV5($guid, $this->salt ?: php_uname('n'));
85
86
87
/**
0 commit comments