Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We shouldn't typehint classes like this. Makes testing harder.
Patch changes it to typehint the interface.
Comment | File | Size | Author |
---|---|---|---|
#2 | dont-typehint-classes-2.patch | 1.66 KB | msonnabaum |
dont-typehint-classes.patch | 1.69 KB | msonnabaum | |
Comments
Comment #2
msonnabaum CreditAttribution: msonnabaum commentedComment #3
katbailey CreditAttribution: katbailey commentedYar.
Comment #4
webchickThis looks consistent with what I've seen in entity API, where we pass an interface around rather than a class to allow mocking or whatever, as long as it conforms to the interface. So makes sense to me.
Committed and pushed to 8.x. Thanks!