-
Notifications
You must be signed in to change notification settings - Fork 466
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix false positives about uninitialized properties
Closes phpstan/phpstan#7198
- Loading branch information
1 parent
8fe4401
commit 348debc
Showing
6 changed files
with
178 additions
and
17 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
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,51 @@ | ||
<?php | ||
|
||
namespace Bug7198; | ||
|
||
trait TestTrait { | ||
public function foo(): void | ||
{ | ||
$this->callee->foo(); | ||
} | ||
} | ||
|
||
class TestCallee { | ||
public function foo(): void | ||
{ | ||
echo "FOO\n"; | ||
} | ||
} | ||
|
||
class TestCaller { | ||
use TestTrait; | ||
|
||
public function __construct(private readonly TestCallee $callee) | ||
{ | ||
$this->foo(); | ||
} | ||
} | ||
|
||
class TestCaller2 { | ||
public function foo(): void | ||
{ | ||
$this->callee->foo(); | ||
} | ||
|
||
public function __construct(private readonly TestCallee $callee) | ||
{ | ||
$this->foo(); | ||
} | ||
} | ||
|
||
class TestCaller3 { | ||
|
||
public function __construct(private readonly TestCallee $callee) | ||
{ | ||
$this->foo(); | ||
} | ||
|
||
public function foo(): void | ||
{ | ||
$this->callee->foo(); | ||
} | ||
} |
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