Fix the Drupal coding standard issues reported by phpcs
Part of #3596034 (closed).
Problem/motivation
The phpcs job reports 552 errors and 50 warnings in 19 files on 1.x, with the template Drupal standard. It is the last red job in the pipeline.
Proposed resolution
Two commits, so the review stays readable: one with what phpcbf fixes on its own, one with the rest by hand. No public name changes. Where a sniff asks for a rename that would break the API, a targeted phpcs:ignore with the reason.
AI Compliance
🤖 Generated with the help of an LLM, reviewed and approved by me before posting.