EcommerceBundle/Factory/Providers/BraintreeProvider.php
public function get($serviceName, array $attributes = array(), $methodName='factory')
    {
        $className = 'Braintree_' . ucfirst($serviceName);
        if(class_exists($className) && method_exists($className, $methodName)) {
            if($methodName=='factory') return $className::$methodName($attributes);
            else return $className::$methodName();
        } else {
            throw new InvalidServiceException('Invalid service ' . $serviceName);
        }
    }
public function get($serviceName, array $attributes = array(), $methodName='factory')
    {
        $className = 'Braintree_' . ucfirst($serviceName);
        if(class_exists($className) && method_exists($className, $methodName)) {
            if($methodName=='factory') return $className::$methodName($attributes);
            else return $className::$methodName();
        } else {
            throw new InvalidServiceException('Invalid service ' . $serviceName);
        }
    }
public function get ( $ serviceName , array $ attributes = array ( ) , $ methodName = 'factory' ) { $ className = 'Braintree_' . ucfirst ( $ serviceName ) ; if ( class_exists ( $ className ) && method_exists ( $ className , $ methodName ) ) { if ( $ methodName == 'factory' ) return $ className :: $ methodName ( $ attributes ) ; else return $ className :: $ methodName ( ) ; } else { throw new InvalidServiceException ( 'Invalid service ' . $ serviceName ) ; } }
Factory method for creating and getting Braintree services

@param string $serviceName braintree service name
@param array $attributes   attribures for braintree service creation

@return mixed
Factory method for creating and getting Braintree services