FacetSettingsForm has a bunch of methods like this:

  protected function getFacetStorage() {
    return $this->facetStorage ?: \Drupal::service('entity_type.manager')->getStorage('facets_facet');
  }

AFAIK, if you inject a service into the form class in the create() method, then you can rely on it being there. Instead of calling $this->getFacetStorage(), you can just do this->facetStorage.

CommentFileSizeAuthor
#6 2747589-6.patch9.54 KBjoshi.rohit100
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim created an issue. See original summary.

borisson_’s picture

I agree, this sounds like a sensible change.

joshi.rohit100’s picture

should methods be left there hanging as with DI, we can directly use the properties and seems no usage of methods but removing of methods seems like api breaking if someone using them.

borisson_’s picture

@joshi.rohit100, because we're still in alpha breaking API is not something we're currently worried about. We will only care about that as soon as we enter beta phase.

joshi.rohit100’s picture

Assigned: Unassigned » joshi.rohit100
joshi.rohit100’s picture

Assigned: joshi.rohit100 » Unassigned
Status: Active » Needs review
FileSize
9.54 KB
borisson_’s picture

Status: Needs review » Fixed

Thanks for the patch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.