klarna / php-xmlrpc

DEPRECATED: the klarna xmlrpc library for php
9 stars 13 forks source link

Use static::printDebug('... instead of self::printDebug('... to allow Late Static Bindings #16

Open ildar-aim opened 8 years ago

ildar-aim commented 8 years ago

In order to allow Late Static Bindings usage you have to use static::printDebug('... instead of self::printDebug('...

In this case I will be able to overwrite your static method like this

class XCKlarna extends Klarna\XMLRPC\Klarna {
    public static function printDebug($msg, $mixed) {//{{{
        if (defined('XC_KLARNA_DEBUG')) {
            x_log_add('klarna', "{$msg}: \n" . print_r($mixed, true));
        }
    }//}}}
}

http://stackoverflow.com/questions/18848373/php-overwriting-of-static-methods-does-not-work-as-expected