public function create($class, ClientInterface $httpClient = null, HttpRequest $httpRequest = null)
    {
        $class = Helper::getCarrierClassName($class);

        if (!class_exists($class)) {
            throw new RuntimeException("Class '$class' not found");
        }

        return new $class($httpClient, $httpRequest);
    }
public function create($class, ClientInterface $httpClient = null, HttpRequest $httpRequest = null)
    {
        $class = Helper::getCarrierClassName($class);

        if (!class_exists($class)) {
            throw new RuntimeException("Class '$class' not found");
        }

        return new $class($httpClient, $httpRequest);
    }
public function create ( $ class , ClientInterface $ httpClient = null , HttpRequest $ httpRequest = null ) { $ class = Helper :: getCarrierClassName ( $ class ) ; if ( ! class_exists ( $ class ) ) { throw new RuntimeException ( "Class '$class' not found" ) ; } return new $ class ( $ httpClient , $ httpRequest ) ; }
Create a new carrier instance

@param string               $class       Carrier name
@param ClientInterface|null $httpClient  A HTTP Client implementation
@param HttpRequest|null     $httpRequest A Symfony HTTP Request implementation
@throws RuntimeException                 If no such carrier is found
@return CarrierInterface                 An object of class $class is created and returned
Create a new carrier instance