Commit 33eb70bc authored by John Voskuilen's avatar John Voskuilen
Browse files

Issue #3219111: Clean code - Remove $langcode parameter from Formatter::getStatusTimeLeft()

parent 739cc89e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -335,7 +335,7 @@ abstract class OfficeHoursFormatterBase extends FormatterBase {
  /**
   * {@inheritdoc}
   */
  public function getStatusTimeLeft(OfficeHoursItemListInterface $items, $langcode) {
  public function getStatusTimeLeft(OfficeHoursItemListInterface $items) {

    // @see https://www.drupal.org/docs/8/api/cache-api/cache-max-age
    // If there are no open days, cache forever.
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ class OfficeHoursFormatterDefault extends OfficeHoursFormatterBase {
        ],
      ],
      '#cache' => [
        'max-age' => $this->getStatusTimeLeft($items, $langcode),
        'max-age' => $this->getStatusTimeLeft($items),
        'tags' => ['office_hours:field.default'],
      ],
    ];
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ class OfficeHoursFormatterStatus extends OfficeHoursFormatterBase {
      '#closed_text' => (string) $this->t($settings['current_status']['closed_text']),
      '#position' => $this->settings['current_status']['position'],
      '#cache' => [
        'max-age' => $this->getStatusTimeLeft($items, $langcode),
        'max-age' => $this->getStatusTimeLeft($items),
        'tags' => ['office_hours:field.status'],
      ],
    ];
+1 −1
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ class OfficeHoursFormatterTable extends OfficeHoursFormatterBase {
      '#table' => $table,
      '#office_hours' => $office_hours,
      '#cache' => [
        'max-age' => $this->getStatusTimeLeft($items, $langcode),
        'max-age' => $this->getStatusTimeLeft($items),
        'tags' => ['office_hours:field.table'],
      ],