File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed
tests/PHPStan/Analyser/nsrt Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 88class Foo
99{
1010
11- public function other (): bool
11+ public function something (): bool
1212 {
1313 return true ;
1414 }
@@ -29,11 +29,14 @@ function testSimple(): void
2929 $ test = createOrNotObject ();
3030
3131 $ error = '' ;
32+
3233 if (!$ test ) {
33- $ error = 'yes ' ;
34+ $ error = 'missing test ' ;
35+ } else if ($ test ->something ()) {
36+ $ error = 'another ' ;
3437 }
3538 if ($ error ) {
36- return ;
39+ die ( ' Done ' ) ;
3740 }
3841 assertType (Foo::class, $ test );
3942}
Original file line number Diff line number Diff line change @@ -9,13 +9,15 @@ class HelloWorld
99
1010 public function test (): void
1111 {
12+ $ level = 'foo ' ;
1213 for ($ i = 1 ; $ i <= 3 ; $ i ++) {
13- if ($ i === 1 ) {
14- $ test = 'value ' ;
14+ if ($ i === 0 ) {
15+ $ test [$ level ] = 'this is a ' ;
16+ } else {
17+ assertType ("array{test: literal-string&lowercase-string&non-falsy-string} " , $ test );
18+ $ test [$ level ] .= ' test ' ;
1519 }
1620 }
17-
18- assertType ("'value' " , $ test );
1921 }
2022
2123}
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ class HelloWorld
1010
1111 public function test (string $ action , ?int $ hotelId ): void
1212 {
13- if ($ action === 'get_rooms ' && $ hotelId === null ) {
13+ if (( $ action === 'get_rooms ' || $ action === ' get_rooms_2 ' ) && $ hotelId === null ) {
1414 throw new InvalidArgumentException ('Hotel ID is required ' );
1515 }
1616
You can’t perform that action at this time.
0 commit comments