Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(REF) Allow subclasses of AbstractTokenSubscriber to override the determination of active tokens. #13186

Merged
merged 1 commit into from
Dec 1, 2018

Conversation

aydun
Copy link
Contributor

@aydun aydun commented Nov 30, 2018

Overview

This is extracted from PRs #13174 and #12012 By refactoring the determination of active tokens into a separate function getActiveTokens(), subclasses of Civi\Token\AbstractTokenSubscriber can override this definition if desired.

No functional change.

@civibot
Copy link

civibot bot commented Nov 30, 2018

(Standard links)

@civibot civibot bot added the master label Nov 30, 2018
public function getActiveTokens(TokenValueEvent $e) {
$messageTokens = $e->getTokenProcessor()->getMessageTokens();
if (!isset($messageTokens[$this->entity])) {
return NULL;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aydun just thinking should this return FALSE as it feels a bit more clearer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seamuslee001 Ok, I've changed that to FALSE if you think that's clearer. I was following the pattern of the pre-existing prefetch() just below it, but either works.

@aydun aydun force-pushed the override_active_tokens branch from cd70609 to eb96909 Compare November 30, 2018 09:46
@aydun
Copy link
Contributor Author

aydun commented Nov 30, 2018

Test failures don't seem to be related to this change - external service unavailable?

@aydun aydun changed the title Allow subclasses of AbstractTokenSubscriber to override the determination of active tokens. (REF) Allow subclasses of AbstractTokenSubscriber to override the determination of active tokens. Nov 30, 2018
@aydun
Copy link
Contributor Author

aydun commented Nov 30, 2018

test this please

1 similar comment
@aydun
Copy link
Contributor Author

aydun commented Nov 30, 2018

test this please

@aydun
Copy link
Contributor Author

aydun commented Dec 1, 2018

@eileenmcnaughton Ok to merge?

@eileenmcnaughton eileenmcnaughton merged commit 243eec2 into civicrm:master Dec 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants