User tests: Successful: Unsuccessful:
The reason for doing this is that it breaks FOF tag implementation, while this only affects a couple of files I removed it for JTable* classes in the whole repository so that we don't use Type Hinting for JTable*. Type hinting may be a good idea but it doesn't work in the real world with developing extensions for Joomla!
The main problem is that FOF uses the JHelperTags(), this is based on JHelper and here the function getRowData has a type Hint of JTable but in this case we have a FOFTable. The type hint makes the JHelperTags() useless for other extensions that are not using JTable directly.
PHP type-hinting is more than type-hinting, it is type-enforcement, and it works really well.
If "it doesn't work in Joomla", then we should fix Joomla, or in this case FOF.
Removing type-hinting is going backwards from good software development practices.
I'm fine that type hinting uses Interfaces instead of hard-coded classes, and make those classes "implements" the interface. That way you solve the single-inheritance issue.
So I personally would rather welcome a different patch which adds "Interface" after the class name in the type-hinting (and adds the Interface file/class and its use).
It is not a problem with FOF, if you create a specialised class, something like MycomponentTableWhatever it will also not work. I didn't checked all files but this is the first time I have seen that someone used Type Hints. At the moment I am fixing a real world problem. I agree that we should look more at "good software development practices" but "Type Hinting" is not the thing we should start with.
Agreed that this is very close minded in terms of not being able to use tags outside of any Joomla class. However doing it as a interface would appear to be a better suggestion if possible (and if I remember that was how Nic did it in Jab13)
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-07-22 16:18:18 |
Tracker Item http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33318&start=0