public function build() { Preconditions::checkNotNull($this->api, "You must specify a valid api through the provider() method"); Preconditions::checkEmptyString($this->apiKey, "You must provide an api key"); Preconditions::checkEmptyString($this->apiSecret, "You must provide an api secret"); return $this->api->createService(new OAuthConfig($this->apiKey, $this->apiSecret, $this->callback, $this->signatureType, $this->scope)); }
private function checkPreconditions(OAuthRequest $request) { Preconditions::checkNotNull($request, "Cannot extract a header from a null object"); $params = $request->getOauthParameters(); if (!$params) { throw new OAuthParametersMissingException($request); } }
public function __construct($value) { Preconditions::checkNotNull($value, "Must provide a valid string as verifier"); $this->value = $value; }