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

Commit

Permalink
Merged from zf2/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 20 changed files with 882 additions and 705 deletions.
258 changes: 133 additions & 125 deletions src/Container.php

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
* 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_Navigation
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @category Zend
* @package Zend_Navigation
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
Expand All @@ -28,7 +28,7 @@
*
* @category Zend
* @package Zend_Navigation
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @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
Expand Down
34 changes: 30 additions & 4 deletions src/Exception/BadMethodCallException.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
<?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_Navigation
* @subpackage Exception
* @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\Navigation\Exception;

use Zend\Navigation\Exception;

class BadMethodCallException extends \InvalidArgumentException implements Exception
{

}
/**
* Navigation bad method call exception
*
* @category Zend
* @package Zend_Navigation
* @subpackage Exception
* @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 BadMethodCallException extends \BadMethodCallException implements Exception
{}
32 changes: 29 additions & 3 deletions src/Exception/DomainException.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
<?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_Navigation
* @subpackage Exception
* @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\Navigation\Exception;

use Zend\Navigation\Exception;

/**
* Navigation domain exception
*
* @category Zend
* @package Zend_Navigation
* @subpackage Exception
* @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
{

}
{}
32 changes: 29 additions & 3 deletions src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
<?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_Navigation
* @subpackage Exception
* @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\Navigation\Exception;

use Zend\Navigation\Exception;

/**
* Navigation invalid argument exception
*
* @category Zend
* @package Zend_Navigation
* @subpackage Exception
* @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 InvalidArgumentException extends \InvalidArgumentException implements Exception
{

}
{}
34 changes: 30 additions & 4 deletions src/Exception/OutOfBoundsException.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
<?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_Navigation
* @subpackage Exception
* @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\Navigation\Exception;

use Zend\Navigation\Exception;

class OutOfBoundsException extends \InvalidArgumentException implements Exception
{

}
/**
* Navigation out of bounds exception
*
* @category Zend
* @package Zend_Navigation
* @subpackage Exception
* @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 OutOfBoundsException extends \OutOfBoundsException implements Exception
{}
34 changes: 17 additions & 17 deletions src/Navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,43 @@
* 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_Navigation
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @category Zend
* @package Zend_Navigation
* @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
*/
namespace Zend\Navigation;

use Traversable;

/**
* A simple container class for {@link Zend_Navigation_Page} pages
*
* @uses \Zend\Navigation\Container
* @uses \Zend\Navigation\InvalidArgumentException
* @category Zend
* @package Zend_Navigation
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @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 Navigation extends Container
{
/**
* Creates a new navigation container
*
* @param array|\Zend\Config\Config $pages [optional] pages to add
* @throws \Zend\Navigation\InvalidArgumentException if $pages is invalid
* @param array|Traversable $pages [optional] pages to add
* @throws Exception\InvalidArgumentException if $pages is invalid
*/
public function __construct($pages = null)
{
if (is_array($pages) || $pages instanceof \Zend\Config\Config) {
$this->addPages($pages);
} elseif (null !== $pages) {
if ($pages && (!is_array($pages) && !$pages instanceof Traversable)) {
throw new Exception\InvalidArgumentException(
'Invalid argument: $pages must be an array, an ' .
'instance of Zend_Config, or null');
'Invalid argument: $pages must be an array, an '
. 'instance of Traversable, or null'
);
}

if ($pages) {
$this->addPages($pages);
}
}
}
Loading

0 comments on commit bb6633a

Please sign in to comment.