Skip to content

Commit 43b04f4

Browse files
committed
Add Psalm::getClosureId
1 parent e826a5c commit 43b04f4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Integration/Psalm.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@
2525
*/
2626
final class Psalm
2727
{
28+
/**
29+
* @return lowercase-string
30+
*/
31+
public function getClosureId(string $filename, Node\Expr\Closure|Node\Expr\ArrowFunction $closure): string
32+
{
33+
return strtolower($filename)
34+
. ':' . $closure->getLine()
35+
. ':' . (int) $closure->getAttribute('startFilePos')
36+
. ':-:closure';
37+
}
38+
2839
/**
2940
* @return Option<non-empty-string>
3041
*/

0 commit comments

Comments
 (0)