Skip to content

Commit f6d2fca

Browse files
committed
Fix wrong UUID equals check - #35
1 parent f8f3916 commit f6d2fca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/ValueObject/UuidFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public function methodEquals(string $propertyName, string $argumentName = 'other
186186
return false;
187187
}
188188
189-
return \$this->$propertyName === \$$argumentName->$propertyName;
189+
return \$this->$propertyName->toString() === \$$argumentName->$propertyName->toString();
190190
PHP;
191191

192192
$method = new MethodGenerator(

tests/ValueObject/UuidFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function equals($other) : bool
111111
if (!$other instanceof self) {
112112
return false;
113113
}
114-
return $this->uuid === $other->uuid;
114+
return $this->uuid->toString() === $other->uuid->toString();
115115
}
116116
public function __toString() : string
117117
{

0 commit comments

Comments
 (0)