-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/1.12.x' into 2.1.x
- Loading branch information
Showing
6 changed files
with
57 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace Bug12107; | ||
|
||
use LogicException; | ||
use Throwable; | ||
|
||
use function PHPStan\Testing\assertType; | ||
|
||
class HelloWorld | ||
{ | ||
public function sayHello(Throwable $e1, LogicException $e2): void | ||
{ | ||
if ($e1 instanceof $e2) { | ||
return; | ||
} | ||
|
||
assertType('Throwable', $e1); | ||
assertType('bool', $e1 instanceof $e2); // could be false | ||
} | ||
|
||
/** @param class-string<LogicException> $e2 */ | ||
public function sayHello2(Throwable $e1, string $e2): void | ||
{ | ||
if ($e1 instanceof $e2) { | ||
return; | ||
} | ||
|
||
|
||
assertType('Throwable', $e1); | ||
assertType('bool', $e1 instanceof $e2); // could be false | ||
} | ||
|
||
public function sayHello3(Throwable $e1): void | ||
{ | ||
if ($e1 instanceof LogicException) { | ||
return; | ||
} | ||
|
||
assertType('Throwable~LogicException', $e1); | ||
assertType('false', $e1 instanceof LogicException); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters