? Success

User tests: Successful: Unsuccessful:

avatar rdeutz
rdeutz
20 Feb 2014

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.

avatar rdeutz rdeutz - open - 20 Feb 2014
avatar beat
beat - comment - 20 Feb 2014

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).

avatar rdeutz
rdeutz - comment - 20 Feb 2014

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.

avatar wilsonge
wilsonge - comment - 20 Feb 2014

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)

avatar wilsonge
wilsonge - comment - 4 Mar 2014

Hi Robert have a look at #3236 :)

avatar rdeutz rdeutz - close - 22 Jul 2014
avatar rdeutz
rdeutz - comment - 22 Jul 2014

closing this one because there is a much longer discussion about the issue here #3236

avatar rdeutz rdeutz - change - 22 Jul 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-07-22 16:18:18
avatar rdeutz rdeutz - close - 22 Jul 2014

Add a Comment

Login with GitHub to post a comment