Move the procedural helper functions to a manager. This is a previous step to add tests.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

e0ipso created an issue. See original summary.

ericduran’s picture

+1 here.

Looking at the module now there's a lot of room for improvement. I'll see if I can find time to help here. I mostly came to this from a testing perspective.

fjgarlin’s picture

Status: Active » Needs review
FileSize
11.36 KB

Even though the issue is old, this is still applicable. I made an attempt to move all the helper functions into a service. Patch included. I tested the module and everything seemed to be working as expected.

devkinetic’s picture

I had just created #3319167: Refactor Toolbar code to use a helper class + add per environment permissions and then found this. The patch in that issue applies to 4.x.

devkinetic’s picture

Version: 8.x-3.x-dev » 4.x-dev
Priority: Normal » Critical
FileSize
19.83 KB

Here is an updated patch, closing that other issue.

devkinetic’s picture

FileSize
20.07 KB

The previous patch had a missing service.

e0ipso’s picture

Status: Needs review » Fixed

This looks good! Thanks for the patch.

  • e0ipso committed 2ba6b50 on 4.x
    Issue #2610208 by devkinetic, fjgarlin, e0ipso, ericduran: Move...

Status: Fixed » Closed (fixed)

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