1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Fix comparison of strings with multiple newlines

This commit is contained in:
Matthew Brown 2019-03-16 12:40:19 -04:00
parent 01d6caf6a2
commit 9ded84fd5b
2 changed files with 16 additions and 1 deletions

View File

@ -19,7 +19,7 @@ class TLiteralString extends TString
*/
public function getKey()
{
return 'string(' . $this->value . ')';
return $this->getId();
}
/**

View File

@ -488,6 +488,21 @@ class ValueTest extends TestCase
}
}',
],
'newlineIssue' => [
'<?php
$a = "foo";
$b = "
";
$c = $a;
if (rand(0, 1)) {
$c = $b;
}
if ($c === $b) {}'
],
];
}