Issue #3121925 by swatichouhan012: \Drupal calls should be avoided in classes, use dependency injection instead