EasyBreadcrumbConstants.php has one constant and three functions that have no usages. These should be removed.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

loopduplicate created an issue. See original summary.

loopduplicate’s picture

Assigned: loopduplicate » Unassigned
Status: Active » Needs review
csakiistvan’s picture

Assigned: Unassigned » csakiistvan
csakiistvan’s picture

Assigned: csakiistvan » Unassigned
Status: Needs review » Reviewed & tested by the community

Environment

  • Drupal: 11.4.4
  • PHP: 8.5.5
  • Database: MariaDB 10.11.16
  • DDEV: v1.25.2
  • Easy Breadcrumb: 2.x-dev

Prerequisites

  • Easy Breadcrumb module enabled.

Steps

  1. Apply the fix from MR !180: remove the unused SEGMENTS_SEPARATOR constant and the unused static methods defaultExcludedPaths(), defaultReplacedTitles(), and defaultCustomPaths() from EasyBreadcrumbConstants.
  2. Rebuild caches: ddev drush cr
  3. Confirm none of the removed symbols are referenced anywhere in the codebase:
    grep -rn "SEGMENTS_SEPARATOR\|defaultExcludedPaths\|defaultReplacedTitles\|defaultCustomPaths" web/modules web/themes web/profiles
  4. Confirm the module still loads and the breadcrumb builder service resolves:
    ddev drush php:eval 'use Drupal\easy_breadcrumb\EasyBreadcrumbConstants; print EasyBreadcrumbConstants::CUSTOM_PATHS; print get_class(\Drupal::service("easy_breadcrumb.breadcrumb"));'

Expected results

  • The grep returns no references to the removed symbols outside their (now deleted) declarations.
  • Caches rebuild without errors.
  • The EasyBreadcrumbConstants class autoloads and the easy_breadcrumb.breadcrumb service resolves, so breadcrumbs continue to render.

Actual results

A codebase-wide search confirms the SEGMENTS_SEPARATOR constant and the three static methods are defined only in EasyBreadcrumbConstants.php and referenced nowhere else, so they are genuine dead code. After removing them per MR !180, caches rebuild cleanly, the class still autoloads, and the breadcrumb builder service resolves normally — the module keeps working with the unused code gone.


Testing produced with the assistance of an LLM.

greg boggs’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

greg boggs’s picture

Thanks y'all!

Status: Fixed » Closed (fixed)

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