Skip to content

Commit

Permalink
[Service] Adding a ClientInterface so that it is possible to use othe…
Browse files Browse the repository at this point in the history
…r classes like OAuth or SoapClient with Guzzle by extending the class and implementing Guzzle\Service\ClientInterface. Removing public access modifiers from interfaces.
  • Loading branch information
mtdowling committed Apr 17, 2011
1 parent 99264d1 commit a1baf54
Show file tree
Hide file tree
Showing 20 changed files with 373 additions and 131 deletions.
10 changes: 5 additions & 5 deletions src/Guzzle/Common/Cache/CacheAdapterInterface.php
Expand Up @@ -27,7 +27,7 @@ interface CacheAdapterInterface
* @return bool TRUE if a cache entry exists for the given cache id,
* FALSE otherwise.
*/
public function contains($id);
function contains($id);

/**
* Deletes a cache entry.
Expand All @@ -36,7 +36,7 @@ public function contains($id);
*
* @return bool TRUE on success, FALSE on failure
*/
public function delete($id);
function delete($id);

/**
* Fetches an entry from the cache.
Expand All @@ -46,14 +46,14 @@ public function delete($id);
* @return string The cached data or FALSE, if no cache entry exists
* for the given id.
*/
public function fetch($id);
function fetch($id);

/**
* Get the wrapped cache object
*
* @return mixed
*/
public function getCacheObject();
function getCacheObject();

/**
* Puts data into the cache.
Expand All @@ -66,5 +66,5 @@ public function getCacheObject();
* @return bool TRUE if the entry was successfully stored in the cache,
* FALSE otherwise.
*/
public function save($id, $data, $lifeTime = false);
function save($id, $data, $lifeTime = false);
}
2 changes: 1 addition & 1 deletion src/Guzzle/Common/Event/Observer.php
Expand Up @@ -22,5 +22,5 @@ interface Observer
*
* @return null|bool|mixed
*/
public function update(Subject $subject, $event, $context = null);
function update(Subject $subject, $event, $context = null);
}
2 changes: 1 addition & 1 deletion src/Guzzle/Common/Event/Subject.php
Expand Up @@ -18,5 +18,5 @@ interface Subject
*
* @return EventManager
*/
public function getEventManager();
function getEventManager();
}
2 changes: 1 addition & 1 deletion src/Guzzle/Common/Filter/FilterInterface.php
Expand Up @@ -22,5 +22,5 @@ interface FilterInterface
*
* @return bool Returns TRUE on success or FALSE on failure.
*/
public function process($command);
function process($command);
}
6 changes: 3 additions & 3 deletions src/Guzzle/Common/Log/LogAdapterInterface.php
Expand Up @@ -24,14 +24,14 @@ interface LogAdapterInterface
* @throws InvalidArgumentException if the supplied object does not implement the
* correct interface.
*/
public function __construct($logObject);
function __construct($logObject);

/**
* Get the adapted log object
*
* @return mixed
*/
public function getLogObject();
function getLogObject();

/**
* Log a message at a priority
Expand All @@ -42,5 +42,5 @@ public function getLogObject();
*
* @return LogAdapterInterface
*/
public function log($message, $priority = LOG_INFO, $extras = null);
function log($message, $priority = LOG_INFO, $extras = null);
}
10 changes: 5 additions & 5 deletions src/Guzzle/Http/CookieJar/CookieJarInterface.php
Expand Up @@ -29,7 +29,7 @@ interface CookieJarInterface
*
* @return int Returns the number of deleted cookies
*/
public function clear($domain = null, $path = null, $name = null);
function clear($domain = null, $path = null, $name = null);

/**
* Discard all temporary cookies.
Expand All @@ -40,14 +40,14 @@ public function clear($domain = null, $path = null, $name = null);
*
* @return int Returns the number of deleted cookies
*/
public function clearTemporary();
function clearTemporary();

/**
* Delete any expired cookies
*
* @return int Returns the number of deleted cookies
*/
public function deleteExpired();
function deleteExpired();

/**
* Get all of the matching cookies
Expand Down Expand Up @@ -75,7 +75,7 @@ public function deleteExpired();
* port (string) - CSV list of ports
* http_only (bool) - HTTP only cookie
*/
public function getCookies($domain = null, $path = null, $name = null, $skipDiscardable = false, $skipExpired = true);
function getCookies($domain = null, $path = null, $name = null, $skipDiscardable = false, $skipExpired = true);

/**
* Save a cookie
Expand All @@ -95,5 +95,5 @@ public function getCookies($domain = null, $path = null, $name = null, $skipDisc
*
* @return CookieJarInterface
*/
public function save(array $cookieData);
function save(array $cookieData);
}
4 changes: 2 additions & 2 deletions src/Guzzle/Http/Curl/CurlFactoryInterface.php
Expand Up @@ -22,7 +22,7 @@ interface CurlFactoryInterface
*
* @return resource
*/
public function getHandle(RequestInterface $request);
function getHandle(RequestInterface $request);

/**
* Release a cURL handle back to the factory
Expand All @@ -32,5 +32,5 @@ public function getHandle(RequestInterface $request);
*
* @return CurlFactoryInterface
*/
public function releaseHandle(CurlHandle $handle);
function releaseHandle(CurlHandle $handle);
}
12 changes: 6 additions & 6 deletions src/Guzzle/Http/Message/EntityEnclosingRequestInterface.php
Expand Up @@ -25,21 +25,21 @@ interface EntityEnclosingRequestInterface extends RequestInterface, Observer
*
* @return EntityEnclosingRequestInterface
*/
public function setBody($body);
function setBody($body);

/**
* Get the body of the request if set
*
* @return EntityBody|null
*/
public function getBody();
function getBody();

/**
* Get the post fields that will be used in the request
*
* @return QueryString
*/
public function getPostFields();
function getPostFields();

/**
* Returns an array of files that will be sent in the request.
Expand All @@ -48,7 +48,7 @@ public function getPostFields();
*
* @return array
*/
public function getPostFiles();
function getPostFiles();

/**
* Add the POST fields to use in the request
Expand All @@ -57,7 +57,7 @@ public function getPostFiles();
*
* @return EntityEnclosingRequestInterface
*/
public function addPostFields($fields);
function addPostFields($fields);

/**
* Add POST files to use in the upload
Expand All @@ -68,5 +68,5 @@ public function addPostFields($fields);
*
* @throws BodyException if the file cannot be read
*/
public function addPostFiles(array $files);
function addPostFiles(array $files);
}
26 changes: 13 additions & 13 deletions src/Guzzle/Http/Message/MessageInterface.php
Expand Up @@ -22,7 +22,7 @@ interface MessageInterface
*
* @return Collection
*/
public function getParams();
function getParams();

/**
* Add and merge in an array of HTTP headers.
Expand All @@ -31,7 +31,7 @@ public function getParams();
*
* @return MessageInterface
*/
public function addHeaders(array $headers);
function addHeaders(array $headers);

/**
* Retrieve an HTTP header by name
Expand All @@ -44,7 +44,7 @@ public function addHeaders(array $headers);
* @return string|null Returns the matching HTTP header or NULL if the
* header is not found
*/
public function getHeader($header, $default = null);
function getHeader($header, $default = null);

/**
* Get all or all matching headers.
Expand All @@ -57,7 +57,7 @@ public function getHeader($header, $default = null);
* specified, or an array of only the headers matching the values in
* the $names array.
*/
public function getHeaders(array $headers = null);
function getHeaders(array $headers = null);

/**
* Returns TRUE or FALSE if the specified header is present.
Expand All @@ -69,7 +69,7 @@ public function getHeaders(array $headers = null);
*
* @return bool Returns TRUE if the header is present and FALSE if not set
*/
public function hasHeader($header, $caseInsensitive = false);
function hasHeader($header, $caseInsensitive = false);

/**
* Remove a specific HTTP header.
Expand All @@ -78,7 +78,7 @@ public function hasHeader($header, $caseInsensitive = false);
*
* @return MessageInterface
*/
public function removeHeader($header);
function removeHeader($header);

/**
* Set an HTTP header
Expand All @@ -88,7 +88,7 @@ public function removeHeader($header);
*
* @return MessageInterface
*/
public function setHeader($header, $value);
function setHeader($header, $value);

/**
* Overwrite all HTTP headers with the supplied array of headers
Expand All @@ -97,14 +97,14 @@ public function setHeader($header, $value);
*
* @return MessageInterface
*/
public function setHeaders(array $headers);
function setHeaders(array $headers);

/**
* Get the raw message headers as a string
*
* @return string
*/
public function getRawHeaders();
function getRawHeaders();

/**
* Get a Cache-Control directive from the message
Expand All @@ -113,7 +113,7 @@ public function getRawHeaders();
*
* @return null|string
*/
public function getCacheControlDirective($directive);
function getCacheControlDirective($directive);

/**
* Check if the message has a Cache-Control directive
Expand All @@ -122,7 +122,7 @@ public function getCacheControlDirective($directive);
*
* @return bool
*/
public function hasCacheControlDirective($directive);
function hasCacheControlDirective($directive);

/**
* Add a Cache-Control directive on the message
Expand All @@ -132,7 +132,7 @@ public function hasCacheControlDirective($directive);
*
* @return MessageInterface
*/
public function addCacheControlDirective($directive, $value);
function addCacheControlDirective($directive, $value);

/**
* Remove a Cache-Control directive from the message
Expand All @@ -141,5 +141,5 @@ public function addCacheControlDirective($directive, $value);
*
* @return MessageInterface
*/
public function removeCacheControlDirective($directive);
function removeCacheControlDirective($directive);
}

0 comments on commit a1baf54

Please sign in to comment.