Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#6 | 2747589-6.patch | 9.54 KB | joshi.rohit100 |
Comments
Comment #2
borisson_I agree, this sounds like a sensible change.
Comment #3
joshi.rohit100should 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.
Comment #4
borisson_@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.
Comment #5
joshi.rohit100Comment #6
joshi.rohit100Comment #7
borisson_Thanks for the patch.