2
2
3
3
namespace PHPStan \Parser ;
4
4
5
+ use Generator ;
6
+ use PhpParser \Node ;
5
7
use PhpParser \Node \Stmt \Namespace_ ;
6
8
use PHPStan \File \FileHelper ;
7
9
use PHPStan \File \FileReader ;
@@ -13,22 +15,20 @@ class CachedParserTest extends PHPStanTestCase
13
15
14
16
/**
15
17
* @dataProvider dataParseFileClearCache
16
- * @param int $cachedNodesByStringCountMax
17
- * @param int $cachedNodesByStringCountExpected
18
18
*/
19
19
public function testParseFileClearCache (
20
20
int $ cachedNodesByStringCountMax ,
21
- int $ cachedNodesByStringCountExpected
21
+ int $ cachedNodesByStringCountExpected,
22
22
): void
23
23
{
24
24
$ parser = new CachedParser (
25
25
$ this ->getParserMock (),
26
- $ cachedNodesByStringCountMax
26
+ $ cachedNodesByStringCountMax,
27
27
);
28
28
29
29
$ this ->assertEquals (
30
30
$ cachedNodesByStringCountMax ,
31
- $ parser ->getCachedNodesByStringCountMax ()
31
+ $ parser ->getCachedNodesByStringCountMax (),
32
32
);
33
33
34
34
// Add strings to cache
@@ -38,16 +38,16 @@ public function testParseFileClearCache(
38
38
39
39
$ this ->assertEquals (
40
40
$ cachedNodesByStringCountExpected ,
41
- $ parser ->getCachedNodesByStringCount ()
41
+ $ parser ->getCachedNodesByStringCount (),
42
42
);
43
43
44
44
$ this ->assertCount (
45
45
$ cachedNodesByStringCountExpected ,
46
- $ parser ->getCachedNodesByString ()
46
+ $ parser ->getCachedNodesByString (),
47
47
);
48
48
}
49
49
50
- public function dataParseFileClearCache (): \ Generator
50
+ public function dataParseFileClearCache (): Generator
51
51
{
52
52
yield 'even ' => [
53
53
'cachedNodesByStringCountMax ' => 50 ,
@@ -70,9 +70,9 @@ private function getParserMock(): Parser&MockObject
70
70
return $ mock ;
71
71
}
72
72
73
- private function getPhpParserNodeMock (): \ PhpParser \ Node &MockObject
73
+ private function getPhpParserNodeMock (): Node &MockObject
74
74
{
75
- return $ this ->createMock (\ PhpParser \ Node::class);
75
+ return $ this ->createMock (Node::class);
76
76
}
77
77
78
78
public function testParseTheSameFileWithDifferentMethod (): void
0 commit comments