Problem/Motivation

FlagCountManagerInterface::getUserCounts() expects a flag and user object and calls methods on each in order to function. Without type hinting, the call could fail due to the wrong type of class.

Proposed resolution

Add type hinting to FlagCountManagerInterface::getUserCounts().

Remaining tasks

Create, test patch.

User interface changes

None.

API changes

FlagCountManagerInterface::getUserCounts() would operate the same, but have additional language level protection against errors.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

socketwench’s picture

Status: Active » Needs review
FileSize
1.71 KB
joshi.rohit100’s picture

I think AccountInterface $user should be AccountInterface $account for the consistency.

joachim’s picture

I agree -- though on D8 without the global $user there's no longer that security risk.

But best if we only change one thing at a time.

joachim’s picture

Status: Needs review » Fixed

Committed!

Status: Fixed » Closed (fixed)

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