public function processNode(Node $node, Scope $scope) : array
{
if ($node instanceof Object_) {
return [];
}
$expressionType = $scope->getType($node->expr);
if ($expressionType->isNullable()) {
return [];
}
$castType = $scope->getType($node);
if (get_class($expressionType) === get_class($castType)) {
return [sprintf('Casting to %s something that\'s already %s.', $castType->describe(), $expressionType->describe())];
}
return [];
}