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

Commit

Permalink
Merge branch 'master' into feature/db-story-35
Browse files Browse the repository at this point in the history
Conflicts:
	library/Zend/Db/Sql/Exception/RuntimeException.php
  • Loading branch information
Show file tree
Hide file tree
Showing 99 changed files with 994 additions and 1,194 deletions.
13 changes: 7 additions & 6 deletions src/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,18 @@
* @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 Address implements AddressDescription
class Address implements Address\AddressInterface
{
protected $email;
protected $name;

/**
* Constructor
*
* @param string $email
* @param null|string $name
* @return void
*
* @param string $email
* @param null|string $name
* @throws Exception\InvalidArgumentException
* @return Address
*/
public function __construct($email, $name = null)
{
Expand Down Expand Up @@ -64,7 +65,7 @@ public function getEmail()
/**
* Retrieve name
*
* @return null|string
* @return string
*/
public function getName()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@
*
* @category Zend
* @package Zend_Mail
* @subpackage Address
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\Mail;
namespace Zend\Mail\Address;

/**
* @category Zend
* @package Zend_Mail
* @subpackage Address
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface AddressDescription
interface AddressInterface
{
public function getEmail();
public function getName();
Expand Down
38 changes: 22 additions & 16 deletions src/AddressList.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

namespace Zend\Mail;

use Countable,
Iterator;
use Countable;
use Iterator;

/**
* @category Zend
Expand All @@ -40,17 +40,18 @@ class AddressList implements Countable, Iterator

/**
* Add an address to the list
*
* @param string|AddressDescription $emailOrAddress
* @param null|string $name
*
* @param string|Address\AddressInterface $emailOrAddress
* @param null|string $name
* @throws Exception\InvalidArgumentException
* @return AddressList
*/
public function add($emailOrAddress, $name = null)
{
if (is_string($emailOrAddress)) {
$emailOrAddress = $this->createAddress($emailOrAddress, $name);
}
if (!$emailOrAddress instanceof AddressDescription) {
if (!$emailOrAddress instanceof Address\AddressInterface) {
throw new Exception\InvalidArgumentException(sprintf(
'%s expects an email address or %s\Address object as its first argument; received "%s"',
__METHOD__,
Expand All @@ -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(),
* and, as such, can be either email strings or AddressDescription objects.
*
* @param array $addresses
* 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 Address\AddressInterface objects.
*
* @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|Address\AddressInterface
*/
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 src/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 ExceptionInterface
{
}
4 changes: 2 additions & 2 deletions src/Exception.php → src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\Mail;
namespace Zend\Mail\Exception;

/**
* @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
*/
interface Exception
interface ExceptionInterface
{
}
3 changes: 1 addition & 2 deletions src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/

namespace Zend\Mail\Exception;
use Zend\Mail\Exception;

/**
* Exception for Zend_Mail component.
Expand All @@ -31,6 +30,6 @@
*/
class InvalidArgumentException
extends \InvalidArgumentException
implements Exception
implements ExceptionInterface
{
}
4 changes: 1 addition & 3 deletions src/Exception/OutOfBoundsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

namespace Zend\Mail\Exception;

use Zend\Mail\Exception;

/**
* Exception for Zend_Mail component.
*
Expand All @@ -32,6 +30,6 @@
*/
class OutOfBoundsException
extends \OutOfBoundsException
implements Exception
implements ExceptionInterface
{
}
4 changes: 1 addition & 3 deletions src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

namespace Zend\Mail\Exception;

use Zend\Mail\Exception;

/**
* Exception for Zend_Mail component.
*
Expand All @@ -32,6 +30,6 @@
*/
class RuntimeException
extends \RuntimeException
implements Exception
implements ExceptionInterface
{
}
7 changes: 3 additions & 4 deletions src/Header/AbstractAddressList.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@

namespace Zend\Mail\Header;

use Zend\Mail\AddressList,
Zend\Mail\Header;
use Zend\Mail\AddressList;

/**
* Base class for headers composing address lists (to, from, cc, bcc, reply-to)
Expand All @@ -33,7 +32,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class AbstractAddressList implements Header
abstract class AbstractAddressList implements HeaderInterface
{
/**
* @var AddressList
Expand Down Expand Up @@ -61,6 +60,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 +180,6 @@ public function getEncoding()
* Set address list for this header
*
* @param AddressList $addressList
* @return void
*/
public function setAddressList(AddressList $addressList)
{
Expand Down
16 changes: 8 additions & 8 deletions src/Header/ContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@

namespace Zend\Mail\Header;

use Zend\Mail\Header;

/**
* @category Zend
* @package Zend_Mail
* @subpackage Header
* @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 ContentType implements Header
class ContentType implements HeaderInterface
{
/**
* Header encoding
Expand All @@ -51,8 +49,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 +146,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 +167,7 @@ public function setType($type)
/**
* Retrieve the content type
*
* @return void
* @return string
*/
public function getType()
{
Expand Down
4 changes: 1 addition & 3 deletions src/Header/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

namespace Zend\Mail\Header;

use Zend\Mail\Header;

/**
* @todo Add accessors for setting date from DateTime, Zend\Date, or a string
* @category Zend
Expand All @@ -31,7 +29,7 @@
* @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 Date implements Header
class Date implements HeaderInterface
{
/**
* @var string
Expand Down
4 changes: 1 addition & 3 deletions src/Header/Exception/BadMethodCallException.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

namespace Zend\Mail\Header\Exception;

use Zend\Mail\Header\Exception;

/**
* @category Zend
* @package Zend_Mail
Expand All @@ -32,6 +30,6 @@
*/
class BadMethodCallException
extends \BadMethodCallException
implements Exception
implements ExceptionInterface
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\Mail\Header;
namespace Zend\Mail\Header\Exception;

use Zend\Mail\Exception as MailException;
use Zend\Mail\Exception\ExceptionInterface as MailException;

/**
* @category Zend
Expand All @@ -30,6 +30,6 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Exception extends MailException
interface ExceptionInterface extends MailException
{
}
Loading

0 comments on commit f8c8e84

Please sign in to comment.