File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
tests/PHPStan/Analyser/nsrt Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 44
55namespace PR5379 ;
66
7+ use ArrayAccess ;
8+
79use function PHPStan \Testing \assertType ;
810
911class AggregationParser
@@ -36,3 +38,33 @@ private static function buildFieldName(): string
3638 }
3739}
3840
41+ class AggregationParser2
42+ {
43+ private function parseAggregation (string $ aggregation , string $ type )
44+ {
45+ if (empty ($ aggregation [1 ]) && $ type !== 'filter ' ) {
46+ return null ;
47+ }
48+ assertType ('string ' , $ type );
49+
50+ if ($ type !== 'filter ' ) {
51+ assertType ('string ' , $ type );
52+ }
53+
54+ assertType ('string ' , $ type );
55+ }
56+
57+ private function parseAggregation2 (ArrayAccess $ aggregation , string $ type )
58+ {
59+ if (empty ($ aggregation ['foo ' ]) && $ type !== 'filter ' ) {
60+ return null ;
61+ }
62+ assertType ('string ' , $ type );
63+
64+ if ($ type !== 'filter ' ) {
65+ assertType ('string ' , $ type );
66+ }
67+
68+ assertType ('string ' , $ type );
69+ }
70+ }
You can’t perform that action at this time.
0 commit comments