Skip to content

Commit cc81900

Browse files
committed
literal-string test
1 parent 9174e02 commit cc81900

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tests/PHPStan/Analyser/NodeScopeResolverTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,8 @@ public function dataFileAsserts(): iterable
469469
}
470470

471471
yield from $this->gatherAssertTypes(__DIR__ . '/data/modulo-operator.php');
472+
473+
yield from $this->gatherAssertTypes(__DIR__ . '/data/literal-string.php');
472474
}
473475

474476
/**
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace LiteralString;
4+
5+
use function PHPStan\Testing\assertType;
6+
7+
class Foo
8+
{
9+
10+
/** @param literal-string $s */
11+
public function doFoo($s)
12+
{
13+
assertType('string', $s);
14+
}
15+
16+
}

0 commit comments

Comments
 (0)