Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
[Zend\Mail] Typo, Docblocks and Missing classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Maks3w committed Apr 30, 2012
1 parent 8fa80a7 commit 535de4b
Show file tree
Hide file tree
Showing 43 changed files with 354 additions and 330 deletions.
9 changes: 5 additions & 4 deletions library/Zend/Mail/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ class Address implements AddressDescription

/**
* Constructor
*
* @param string $email
* @param null|string $name
* @return void
*
* @param string $email
* @param null|string $name
* @throws Exception\InvalidArgumentException
* @return \Zend\Mail\Address
*/
public function __construct($email, $name = null)
{
Expand Down
30 changes: 18 additions & 12 deletions library/Zend/Mail/AddressList.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ class AddressList implements Countable, Iterator

/**
* Add an address to the list
*
* @param string|AddressDescription $emailOrAddress
* @param null|string $name
*
* @param string|AddressDescription $emailOrAddress
* @param null|string $name
* @throws Exception\InvalidArgumentException
* @return AddressList
*/
public function add($emailOrAddress, $name = null)
Expand Down Expand Up @@ -71,11 +72,12 @@ public function add($emailOrAddress, $name = null)
/**
* Add many addresses at once
*
* If an email key is provided, it will be used as the email, and the value
* as the name. Otherwise, the value is passed as the sole argument to add(),
* If an email key is provided, it will be used as the email, and the value
* as the name. Otherwise, the value is passed as the sole argument to add(),
* and, as such, can be either email strings or AddressDescription objects.
*
* @param array $addresses
*
* @param array $addresses
* @throws Exception\RuntimeException
* @return AddressList
*/
public function addMany(array $addresses)
Expand Down Expand Up @@ -125,7 +127,7 @@ public function has($email)
* Get an address by email
*
* @param string $email
* @return false|AddressDescription
* @return boolean|AddressDescription
*/
public function get($email)
{
Expand Down Expand Up @@ -166,8 +168,10 @@ public function count()

/**
* Rewind iterator
*
* @return void
*
* @return mixed the value of the first addresses element, or false if the addresses is
* empty.
* @see addresses
*/
public function rewind()
{
Expand Down Expand Up @@ -196,8 +200,10 @@ public function key()

/**
* Move to next item
*
* @return void
*
* @return mixed the addresses value in the next place that's pointed to by the
* internal array pointer, or false if there are no more elements.
* @see addresses
*/
public function next()
{
Expand Down
38 changes: 38 additions & 0 deletions library/Zend/Mail/Exception/DomainException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Mail
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @version $Id$
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\Mail\Exception;

use Zend\Mail\Exception;

/**
* Exception for Zend_Mail component.
*
* @category Zend
* @package Zend_Mail
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class DomainException
extends \DomainException
implements Exception
{
}
2 changes: 1 addition & 1 deletion library/Zend/Mail/Header/AbstractAddressList.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ abstract class AbstractAddressList implements Header
* Parse string to create header object
*
* @param string $headerLine
* @throws Exception\InvalidArgumentException
* @return AbstractAddressList
*/
public static function fromString($headerLine)
Expand Down Expand Up @@ -180,7 +181,6 @@ public function getEncoding()
* Set address list for this header
*
* @param AddressList $addressList
* @return void
*/
public function setAddressList(AddressList $addressList)
{
Expand Down
12 changes: 7 additions & 5 deletions library/Zend/Mail/Header/ContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ class ContentType implements Header

/**
* Factory: create Content-Type header object from string
*
* @param string $headerLine
*
* @param string $headerLine
* @throws Exception\InvalidArgumentException
* @return ContentType
*/
public static function fromString($headerLine)
Expand Down Expand Up @@ -147,8 +148,9 @@ public function toString()

/**
* Set the content type
*
* @param string $type
*
* @param string $type
* @throws Exception\InvalidArgumentException
* @return ContentType
*/
public function setType($type)
Expand All @@ -167,7 +169,7 @@ public function setType($type)
/**
* Retrieve the content type
*
* @return void
* @return string
*/
public function getType()
{
Expand Down
3 changes: 2 additions & 1 deletion library/Zend/Mail/Header/GenericHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ public function __construct($fieldName = null, $fieldValue = null)

/**
* Set header field name
*
*
* @param string $fieldName
* @throws Exception\InvalidArgumentException
* @return GenericHeader
*/
public function setFieldName($fieldName)
Expand Down
12 changes: 7 additions & 5 deletions library/Zend/Mail/Header/GenericMultiHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class GenericMultiHeader implements MultipleHeaderDescription
protected $encoding = 'ASCII';

/**
* Deserialize from a string
* Unserialize from a string
*
* @param string $headerLine
* @return GenericMultiHeader
Expand Down Expand Up @@ -91,8 +91,9 @@ public function __construct($fieldName = null, $fieldValue = null)

/**
* Set header name
*
*
* @param string $fieldName
* @throws Exception\InvalidArgumentException
* @return GenericHeader
*/
public function setFieldName($fieldName)
Expand Down Expand Up @@ -189,9 +190,10 @@ public function toString()
}

/**
* Cast multiple header objectss to a single string header
*
* @param array $headers
* Cast multiple header objects to a single string header
*
* @param array $headers
* @throws Exception\InvalidArgumentException
* @return string
*/
public function toStringMultipleHeaders(array $headers)
Expand Down
5 changes: 2 additions & 3 deletions library/Zend/Mail/Header/MimeVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ class MimeVersion implements Header
protected $version = '1.0';

/**
* Deserialize from string
* Unserialize from string
*
* @param string $headerLine
* @throws Exception\InvalidArgumentException
* @return MimeVersion
*/
public static function fromString($headerLine)
Expand Down Expand Up @@ -85,7 +86,6 @@ public function getFieldValue()
* Set character encoding
*
* @param string $encoding
* @return void
*/
public function setEncoding($encoding)
{
Expand All @@ -95,7 +95,6 @@ public function setEncoding($encoding)
/**
* Get character encoding
*
* @return void
*/
public function getEncoding()
{
Expand Down
7 changes: 4 additions & 3 deletions library/Zend/Mail/Header/Received.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,12 @@ public function toString()
{
return 'Received: ' . $this->getFieldValue();
}

/**
* Serialize collection of Received headers to string
*
* @param array $headers
*
* @param array $headers
* @throws Exception\RuntimeException
* @return string
*/
public function toStringMultipleHeaders(array $headers)
Expand Down
1 change: 1 addition & 0 deletions library/Zend/Mail/Header/Sender.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public function toString()
*
* @param string|AddressDescription $emailOrAddress
* @param null|string $name
* @throws Exception\InvalidArgumentException
* @return Sender
*/
public function setAddress($emailOrAddress, $name = null)
Expand Down
5 changes: 3 additions & 2 deletions library/Zend/Mail/Header/Subject.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ class Subject implements Header, UnstructuredHeader

/**
* Factory from header line
*
* @param string $headerLine
*
* @param string $headerLine
* @throws Exception\InvalidArgumentException
* @return Subject
*/
public static function fromString($headerLine)
Expand Down
8 changes: 4 additions & 4 deletions library/Zend/Mail/Headers.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class Headers implements Iterator, Countable
* will be lazy loaded)
*
* @param string $string
* @throws Exception\RuntimeException
* @return Headers
*/
public static function fromString($string)
Expand Down Expand Up @@ -187,6 +188,7 @@ public function getEncoding()
* Expects an array (or Traversable object) of type/value pairs.
*
* @param array|Traversable $headers
* @throws Exception\InvalidArgumentException
* @return Headers
*/
public function addHeaders($headers)
Expand Down Expand Up @@ -309,7 +311,7 @@ public function clearHeaders()
* Get all headers of a certain name/type
*
* @param string $name
* @return false|Header|ArrayIterator
* @return boolean|Header|ArrayIterator
*/
public function get($name)
{
Expand Down Expand Up @@ -359,7 +361,6 @@ public function has($name)
/**
* Advance the pointer for this object as an interator
*
* @return void
*/
public function next()
{
Expand Down Expand Up @@ -389,7 +390,6 @@ public function valid()
/**
* Reset the internal pointer for this object as an iterator
*
* @return void
*/
public function rewind()
{
Expand Down Expand Up @@ -491,7 +491,7 @@ public function forceLoading()

/**
* @param $index
* @return mixed|void
* @return mixed
*/
protected function lazyLoadHeader($index)
{
Expand Down
27 changes: 14 additions & 13 deletions library/Zend/Mail/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ public function replyTo()
*
* @param mixed $emailOrAddress
* @param mixed $name
* @return void
* @return Message
*/
public function setSender($emailOrAddress, $name = null)
{
Expand Down Expand Up @@ -370,8 +370,9 @@ public function getSubject()

/**
* Set the message body
*
* @param null|string|MimeMessage|object $body
*
* @param null|string|MimeMessage|object $body
* @throws Exception\InvalidArgumentException
* @return Message
*/
public function setBody($body)
Expand Down Expand Up @@ -471,7 +472,6 @@ protected function getHeader($headerName, $headerClass)
* Clear a header by name
*
* @param string $headerName
* @return void
*/
protected function clearHeaderByName($headerName)
{
Expand All @@ -487,9 +487,10 @@ protected function clearHeaderByName($headerName)
*
* Used with To, From, Cc, Bcc, and ReplyTo headers. If the header does not
* exist, instantiates it.
*
* @param string $headerName
* @param string $headerClass
*
* @param string $headerName
* @param string $headerClass
* @throws Exception\DomainException
* @return AddressList
*/
protected function getAddressListFromHeader($headerName, $headerClass)
Expand All @@ -508,12 +509,12 @@ protected function getAddressListFromHeader($headerName, $headerClass)
* Update an address list
*
* Proxied to this from addFrom, addTo, addCc, addBcc, and addReplyTo.
*
* @param AddressList $addressList
* @param string|AddressDescription|array|AddressList|Traversable $emailOrAddressOrList
* @param null|string $name
* @param string $callingMethod
* @return void
*
* @param AddressList $addressList
* @param string|AddressDescription|array|AddressList|Traversable $emailOrAddressOrList
* @param null|string $name
* @param string $callingMethod
* @throws Exception\InvalidArgumentException
*/
protected function updateAddressList(AddressList $addressList, $emailOrAddressOrList, $name, $callingMethod)
{
Expand Down
Loading

0 comments on commit 535de4b

Please sign in to comment.