We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 11 | class Connection implements ConnectionInterface |
||
| 12 | { |
||
| 13 | use DeprecatedPropertyPublicAccessTrait; |
||
| 14 | |||
| 15 | /** @var EdgeInterface[] */ |
||
| 16 | protected $edges; |
||
| 17 | |||
| 18 | /** @var PageInfoInterface */ |
||
| 19 | protected $pageInfo; |
||
| 20 | |||
| 21 | /** @var int|null */ |
||
| 22 | protected $totalCount; |
||
| 23 | |||
| 24 | 89 | public function __construct($edges = [], PageInfoInterface $pageInfo = null) |
|
| 29 | |||
| 30 | /** |
||
| 31 | * {@inheritdoc} |
||
| 32 | */ |
||
| 33 | 86 | public function getEdges() |
|
| 37 | |||
| 38 | /** |
||
| 39 | * {@inheritdoc} |
||
| 40 | */ |
||
| 41 | 2 | public function setEdges(iterable $edges): void |
|
| 45 | |||
| 46 | /** |
||
| 47 | * {@inheritdoc} |
||
| 48 | */ |
||
| 49 | 71 | public function getPageInfo(): ? PageInfoInterface |
|
| 53 | |||
| 54 | /** |
||
| 55 | * {@inheritdoc} |
||
| 56 | */ |
||
| 57 | 1 | public function setPageInfo(PageInfoInterface $pageInfo): void |
|
| 61 | |||
| 62 | /** |
||
| 63 | * {@inheritdoc} |
||
| 64 | */ |
||
| 65 | 57 | public function getTotalCount(): ?int |
|
| 69 | |||
| 70 | /** |
||
| 71 | * {@inheritdoc} |
||
| 72 | */ |
||
| 73 | 4 | public function setTotalCount(int $totalCount): void |
|
| 77 | } |
||
| 78 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.
For example, imagine you have a variable
$accountIdthat can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theidproperty of an instance of theAccountclass. This class holds a proper account, so the id value must no longer be false.Either this assignment is in error or a type check should be added for that assignment.