Skip to content

Commit 65e9319

Browse files
committed
Use Nowdoc - #35
1 parent f6d2fca commit 65e9319

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ValueObject/UuidFactory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,12 @@ public function methodEquals(string $propertyName, string $argumentName = 'other
181181
$propertyName = ($this->propertyNameFilter)($propertyName);
182182
$argumentName = ($this->propertyNameFilter)($argumentName);
183183

184-
$body = <<<PHP
185-
if(!\$$argumentName instanceof self) {
184+
$body = <<<'PHP'
185+
if(!$%s instanceof self) {
186186
return false;
187187
}
188188
189-
return \$this->$propertyName->toString() === \$$argumentName->$propertyName->toString();
189+
return $this->%s->toString() === $%s->%s->toString();
190190
PHP;
191191

192192
$method = new MethodGenerator(
@@ -195,7 +195,7 @@ public function methodEquals(string $propertyName, string $argumentName = 'other
195195
(new ParameterGenerator($argumentName))->setTypeDocBlockHint('mixed'),
196196
],
197197
MethodGenerator::FLAG_PUBLIC,
198-
new BodyGenerator($this->parser, $body)
198+
new BodyGenerator($this->parser, \sprintf($body, $argumentName, $propertyName, $argumentName, $propertyName))
199199
);
200200
$method->setDocBlockComment('');
201201
$method->setTyped($this->typed);

0 commit comments

Comments
 (0)