Issue #3490713: Use the new Drupal::serviceByClass() in some places where two parameters are needed.
Closes #3490713