src/Invoice/Source.php
protected function callTypeSpecificMethod($method, $args = array())
    {
        $method .= $this->getType();
        if (method_exists($this, $method)) {
            return call_user_func_array(array($this, $method), $args);
        }
        return null;
    }
protected function callTypeSpecificMethod($method, $args = array())
    {
        $method .= $this->getType();
        if (method_exists($this, $method)) {
            return call_user_func_array(array($this, $method), $args);
        }
        return null;
    }
protected function callTypeSpecificMethod ( $ method , $ args = array ( ) ) { $ method .= $ this -> getType ( ) ; if ( method_exists ( $ this , $ method ) ) { return call_user_func_array ( array ( $ this , $ method ) , $ args ) ; } return null ; }
Calls a "sub" method whose logic depends on the type of invoice source.

This allows to separate logic for different source types into different
methods.

The method name is expected to be the original method name suffixed with
the source type (Order or CreditNote).

@param string $method
The original method called.
@param array $args
The parameters to pass to the type specific method.

@return mixed
Calls a sub method whose logic depends on the type of invoice source .