public function processNode(Node $node, Scope $scope) : array
{
if (!$node->var instanceof Node\Expr\PropertyFetch && !$node->var instanceof Node\Expr\StaticPropertyFetch) {
return [];
}
$propertyType = $scope->getType($node->var);
$assignedValueType = $scope->getType($node->expr);
if (!$propertyType->accepts($assignedValueType)) {
$propertyDescription = $this->describeProperty($node->var, $scope);
if ($propertyDescription === null) {
return [];
}
return [sprintf('%s (%s) does not accept %s.', $propertyDescription, $propertyType->describe(), $assignedValueType->describe())];
}
return [];
}