The majority of the changes were generated by drupal-rector. I reviewed the changes and use my best judgement to fix issues that rector couldn't fix.
Closes #3383939