File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed
tests/PHPStan/Rules/Debug Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php declare (strict_types = 1 );
2+
3+ namespace PHPStan \Rules \Debug ;
4+
5+ use PHPStan \Rules \Rule ;
6+ use PHPStan \Testing \RuleTestCase ;
7+
8+ /**
9+ * @extends RuleTestCase<DumpNativeTypeRule>
10+ */
11+ class DumpNativeTypeRuleTest extends RuleTestCase
12+ {
13+
14+ protected function getRule (): Rule
15+ {
16+ return new DumpNativeTypeRule (self ::createReflectionProvider ());
17+ }
18+
19+ public function testRule (): void
20+ {
21+ $ this ->analyse ([__DIR__ . '/data/dump-native-type.php ' ], [
22+ [
23+ 'Dumped type: non-empty-array ' ,
24+ 11 ,
25+ ],
26+ [
27+ 'Dumped type: array ' ,
28+ 12 ,
29+ ],
30+ ]);
31+ }
32+
33+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace PHPStan ;
4+
5+ /** @param non-empty-array $b */
6+ function (array $ a , array $ b ) {
7+ if ($ a === []) {
8+ return ;
9+ }
10+
11+ dumpNativeType ($ a );
12+ dumpNativeType ($ b );
13+ };
You can’t perform that action at this time.
0 commit comments