Improving Drupal code quality: Using Data Transfer Objects instead of arrays
From my experience over the years, Drupal developers tend to use arrays everywhere. In some situations, that's perfectly fine, but in others, it's not ideal at all. A better solution than using arrays is to use Data Transfer Objects (DTOs).