-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
This injection example type-hints an abstract:
public function setTransactionModel(Model\TransactionAbstract $tx_model)
It kind of made sense to me, because extended transactions will derive from this abstract.
However, when creating models based on third-party classes, the ancestry (being a linear line, before PHP 5.5 traits at least) may not come from the abstract declared here. However, if the abstract implements an interface, then a third party model that does not extend any of the models here, can still implement the interface and so be valid for setTransactionModel().
It has taken me a while to realise the subtlety of this, as the abstract felt a lot more "useful" than an interface, but it is clear to me now :-)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels