Problem/Motivation

There is a class with a bag of public static methods not clearly related and not covered by any interfaces: https://git.drupalcode.org/project/display_builder/-/blob/1.0.x/src/Disp...

  • ::isDisplayBuilderEntityType() belongs to display_builder_entity_view module
  • ::findAndReplaceInArray(): used only in PreviewPanel, can be moved there as a protected method
  • ::findArrayReplaceSource(): used only in PageLayoutPageVariant, can be moved there as a protected method
  • ::getFixtureDataFromExtension(): used only in ViewDisplay, can be moved there as a protected method
  • ::formatLog(): used nowhere, can be removed
  • ::formatTime(): used 3 times. Could be an extension of the date formatter service, calling ::formatTimeDiffSince() from a brand new method

Proposed resolution

Move stuff, delete stuff.

Comments

pdureau created an issue.