-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
phpstan/phpstan-src
#4294Labels
Description
<?php
namespace Test;
class MyClass
{
/**
* @var int[]
*/
private $prop = [];
/**
* @return void
*/
public function foo()
{
array_push($this->prop, 'string');
array_unshift($this->prop, 'string');
}
/**
* @return void
*/
public function bar()
{
$this->prop[] = 'string';
}
}https://phpstan.org/r/7935ce10-c26f-4deb-bf05-5a40751a2a79
Expected:
+---------------------------------------------------------+
| Line | test.php |
+---------------------------------------------------------+
| 17 | Array (array<int>) does not accept string. |
| 18 | Array (array<int>) does not accept string. |
| 26 | Array (array<int>) does not accept string. |
+---------------------------------------------------------+
Actual:
+---------------------------------------------------------+
| Line | test.php |
+---------------------------------------------------------+
| 26 | Array (array<int>) does not accept string. |
+---------------------------------------------------------+
Reactions are currently unavailable