When implementing a custom formatter, it's natural to extend from RestWSBaseFormat. However, the base class uses some static methods and calls them via self::method instead of static::method. This sucks, as it makes it impossible to override the method.
As we cannot go with static::method without requiring php 5.3, I'd suggest converting the static method to a run-time method. I see no reason this has to be static and that way RestWS keeps working with PHP 5.2. This is a small API break, however I don't think anyone is calling the method directly?
Comments
Comment #1
klausiFine with me I guess, but I think the git commit message should come with a big fat "API change" since it is one at least theoretically.
Comment #2
Grayside commentedThis works for me in development of https://github.com/grayside/hal, and is a dependency of that module.
Comment #3
neograph734Once this is committed, please retest the patch provided here #2253947: format suffix not added to next-first-last page url's.
Comment #5
klausiComment #6
neograph734Hey guys, I just discovered some more static functions on lines 643 & 678 of restws.formats.inc
Shouldn't those be overridden as well? `public static function setXMLReference` is still blocking #2253947: format suffix not added to next-first-last page url's.