Closed (fixed)
Project:
JSON:API
Version:
8.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
12 Jan 2018 at 11:14 UTC
Updated:
26 Jan 2018 at 15:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
e0ipsoI am missing the why here. Can you elaborate?
Comment #3
gabesulliceComment #4
wim leersMy guess: because
interface AccountProxyInterface extends AccountInterface {…}— i.e.AccountInterfaceis the base interface. Unless JSON API calls any of the methods thatAccountProxyInterfacelayers on top, we should just typehint to the base interface.Comment #5
gabesullice@Wim Leers, yep. And I admit it's a knee-jerk reaction that I've built up working (and testing) a lot access related code that isn't obviously valuable in this module. Just a best-practice earned from experience.
The practical reason is this:
AccountProxyis the only class that implementsAccountProxyInterface.AccountProxyInterfaceandUserInterfaceimplementAccountInterface.AccountInterface, you can either pass the account you have or a user entity... which is the whole point of interfaces in the first place :)Comment #6
wim leers#5 is correct. And this would definitely also come up when we try to move this module into Drupal core!
Comment #7
wim leers