diff --git a/docs/manipulating_code/fixing.md b/docs/manipulating_code/fixing.md index 8377808b0..c6658f476 100644 --- a/docs/manipulating_code/fixing.md +++ b/docs/manipulating_code/fixing.md @@ -231,6 +231,7 @@ Running `vendor/bin/psalter --issues=MissingPropertyType` on class A { public $foo; public $bar; + public $baz; public function __construct() { @@ -242,6 +243,10 @@ class A { $this->bar = "baz"; } + + public function setBaz() { + $this->baz = [1, 2, 3]; + } } ``` @@ -257,6 +262,12 @@ class A { public string $bar; + /** + * @var array|null + * @psalm-var non-empty-list|null + */ + public $baz; + public function __construct() { if (rand(0, 1)) { @@ -267,6 +278,10 @@ class A { $this->bar = "baz"; } + + public function setBaz() { + $this->baz = [1, 2, 3]; + } } ```