Skip to content

Commit

Permalink
phpdoc
Browse files Browse the repository at this point in the history
InvalidArgumentException doesn't need to be documented; this is a logic
error (as opposed to runtime error).
  • Loading branch information
slusarz committed Oct 4, 2013
1 parent cceb2d8 commit cea45ad
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 76 deletions.
56 changes: 22 additions & 34 deletions framework/Service_Gravatar/lib/Horde/Service/Gravatar.php
Expand Up @@ -52,14 +52,14 @@ class Horde_Service_Gravatar
/**
* Constructor.
*
* The default Gravatar base URL is Horde_Service_Gravatar::STANDARD. If you
* need URLs in an HTTPS context you should provide the base URL parameter
* as Horde_Service_Gravatar::SECURE. In case you wish to access another URL
* offering the Gravatar API you can specify the base URL of this service as
* $base.
*
* @param string $base The base Gravatar URL.
* @param Horde_Http_Client $client The HTTP client to access the server.
* The default Gravatar base URL is Horde_Service_Gravatar::STANDARD. If
* you need URLs in an HTTPS context you should provide the base URL
* parameter as Horde_Service_Gravatar::SECURE. In case you wish to access
* another URL offering the Gravatar API you can specify the base URL of
* this service as $base.
*
* @param string $base The base Gravatar URL.
* @param Horde_Http_Client $client The HTTP client to access the server.
*/
public function __construct(
$base = self::STANDARD,
Expand All @@ -76,11 +76,9 @@ public function __construct(
/**
* Return the Gravatar ID for the specified mail address.
*
* @param string $mail The mail address.
* @param string $mail The mail address.
*
* @return string The Gravatar ID.
*
* @throws InvalidArgumentException In case the mail address is no string.
* @return string The Gravatar ID.
*/
public function getId($mail)
{
Expand All @@ -92,16 +90,14 @@ public function getId($mail)

/**
* Return the Gravatar image URL for the specified mail address. The
* returned URL can be directly used with an <img/> tag e.g. <img
* src="http://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50" />
* returned URL can be directly used with an IMG tag e.g.:
* &lt;img src="http://www.gravatar.com/avatar/hash" /&gt;
*
* @param string $mail The mail address.
* @param integer $size An optinoal size parameter. Valid values are
* @param integer $size An optional size parameter. Valid values are
* between 1 and 512.
*
* @return string The image URL.
*
* @throws InvalidArgumentException In case the mail address is no string.
* @return string The image URL.
*/
public function getAvatarUrl($mail, $size = null)
{
Expand All @@ -114,11 +110,9 @@ public function getAvatarUrl($mail, $size = null)
/**
* Return the Gravatar profile URL.
*
* @param string $mail The mail address.
*
* @return string The profile URL.
* @param string $mail The mail address.
*
* @throws InvalidArgumentException In case the mail address is no string.
* @return string The profile URL.
*/
public function getProfileUrl($mail)
{
Expand All @@ -128,11 +122,9 @@ public function getProfileUrl($mail)
/**
* Fetch the Gravatar profile information.
*
* @param string $mail The mail address.
* @param string $mail The mail address.
*
* @return string The profile information.
*
* @throws InvalidArgumentException In case the mail address is no string.
* @return string The profile information.
*/
public function fetchProfile($mail)
{
Expand All @@ -143,11 +135,9 @@ public function fetchProfile($mail)
/**
* Return the Gravatar profile information as an array.
*
* @param string $mail The mail address.
*
* @return array The profile information.
* @param string $mail The mail address.
*
* @throws InvalidArgumentException In case the mail address is no string.
* @return array The profile information.
*/
public function getProfile($mail)
{
Expand All @@ -160,13 +150,11 @@ public function getProfile($mail)
* @param string $mail The mail address.
* @param integer $size An optional size parameter.
*
* @return resource The image as stream resource.
*
* @throws InvalidArgumentException In case the mail address is no string.
* @return resource The image as stream resource.
*/
public function fetchAvatar($mail, $size = null)
{
return $this->_client->get($this->getAvatarUrl($mail, $size))->getStream();
}

}
}
@@ -1,31 +1,24 @@
<?php
/**
* Horde_Service_Gravatar abstracts communication with Services supporting the
* Gravatar API (http://www.gravatar.com/site/implement/).
*
* PHP version 5
*
* @category Horde
* @package Service_Gravatar
* @author Gunnar Wrobel <wrobel@pardus.de>
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @link http://pear.horde.org/index.php?package=Service_Gravatar
*/

/**
* Horde_Service_Gravatar abstracts communication with Services supporting the
* Gravatar API (http://www.gravatar.com/site/implement/).
*
* Copyright 2011-2013 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @category Horde
* @package Service_Gravatar
* @author Gunnar Wrobel <wrobel@pardus.de>
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @link http://pear.horde.org/index.php?package=Service_Gravatar
* @category Horde
* @copyright 2011-2013 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @link http://pear.horde.org/index.php?package=Service_Gravatar
* @package Service_Gravatar
*/

/**
* @author Gunnar Wrobel <wrobel@pardus.de>
* @category Horde
* @copyright 2011-2013 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @link http://pear.horde.org/index.php?package=Service_Gravatar
* @package Service_Gravatar
*/
class Horde_Service_Gravatar_GravatarTest
extends PHPUnit_Framework_TestCase
Expand Down
@@ -1,31 +1,24 @@
<?php
/**
* Horde_Service_Gravatar abstracts communication with Services supporting the
* Gravatar API (http://www.gravatar.com/site/implement/).
*
* PHP version 5
*
* @category Horde
* @package Service_Gravatar
* @author Gunnar Wrobel <wrobel@pardus.de>
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @link http://pear.horde.org/index.php?package=Service_Gravatar
*/

/**
* Horde_Service_Gravatar abstracts communication with Services supporting the
* Gravatar API (http://www.gravatar.com/site/implement/).
*
* Copyright 2011-2013 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @category Horde
* @package Service_Gravatar
* @author Gunnar Wrobel <wrobel@pardus.de>
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @link http://pear.horde.org/index.php?package=Service_Gravatar
* @category Horde
* @copyright 2011-2013 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @link http://pear.horde.org/index.php?package=Service_Gravatar
* @package Service_Gravatar
*/

/**
* @author Gunnar Wrobel <wrobel@pardus.de>
* @category Horde
* @copyright 2011-2013 Horde LLC
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @link http://pear.horde.org/index.php?package=Service_Gravatar
* @package Service_Gravatar
*/
class Horde_Service_Gravatar_ServerTest extends Horde_Test_Case
{
Expand Down

0 comments on commit cea45ad

Please sign in to comment.