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

Commit bb6633a

Browse files
committed

20 files changed

+882
-705
lines changed

src/Container.php

Lines changed: 133 additions & 125 deletions
Large diffs are not rendered by default.

src/Exception.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
* obtain it through the world-wide-web, please send an email
1313
* to license@zend.com so we can send you a copy immediately.
1414
*
15-
* @category Zend
16-
* @package Zend_Navigation
17-
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
18-
* @license http://framework.zend.com/license/new-bsd New BSD License
15+
* @category Zend
16+
* @package Zend_Navigation
17+
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
18+
* @license http://framework.zend.com/license/new-bsd New BSD License
1919
*/
2020

2121
/**
@@ -28,7 +28,7 @@
2828
*
2929
* @category Zend
3030
* @package Zend_Navigation
31-
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
31+
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
3232
* @license http://framework.zend.com/license/new-bsd New BSD License
3333
*/
3434
interface Exception
Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,36 @@
11
<?php
2+
/**
3+
* Zend Framework
4+
*
5+
* LICENSE
6+
*
7+
* This source file is subject to the new BSD license that is bundled
8+
* with this package in the file LICENSE.txt.
9+
* It is also available through the world-wide-web at this URL:
10+
* http://framework.zend.com/license/new-bsd
11+
* If you did not receive a copy of the license and are unable to
12+
* obtain it through the world-wide-web, please send an email
13+
* to license@zend.com so we can send you a copy immediately.
14+
*
15+
* @category Zend
16+
* @package Zend_Navigation
17+
* @subpackage Exception
18+
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
19+
* @license http://framework.zend.com/license/new-bsd New BSD License
20+
*/
221

322
namespace Zend\Navigation\Exception;
423

524
use Zend\Navigation\Exception;
625

7-
class BadMethodCallException extends \InvalidArgumentException implements Exception
8-
{
9-
10-
}
26+
/**
27+
* Navigation bad method call exception
28+
*
29+
* @category Zend
30+
* @package Zend_Navigation
31+
* @subpackage Exception
32+
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
33+
* @license http://framework.zend.com/license/new-bsd New BSD License
34+
*/
35+
class BadMethodCallException extends \BadMethodCallException implements Exception
36+
{}

src/Exception/DomainException.php

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,36 @@
11
<?php
2+
/**
3+
* Zend Framework
4+
*
5+
* LICENSE
6+
*
7+
* This source file is subject to the new BSD license that is bundled
8+
* with this package in the file LICENSE.txt.
9+
* It is also available through the world-wide-web at this URL:
10+
* http://framework.zend.com/license/new-bsd
11+
* If you did not receive a copy of the license and are unable to
12+
* obtain it through the world-wide-web, please send an email
13+
* to license@zend.com so we can send you a copy immediately.
14+
*
15+
* @category Zend
16+
* @package Zend_Navigation
17+
* @subpackage Exception
18+
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
19+
* @license http://framework.zend.com/license/new-bsd New BSD License
20+
*/
221

322
namespace Zend\Navigation\Exception;
423

524
use Zend\Navigation\Exception;
625

26+
/**
27+
* Navigation domain exception
28+
*
29+
* @category Zend
30+
* @package Zend_Navigation
31+
* @subpackage Exception
32+
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
33+
* @license http://framework.zend.com/license/new-bsd New BSD License
34+
*/
735
class DomainException extends \DomainException implements Exception
8-
{
9-
10-
}
36+
{}
Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,36 @@
11
<?php
2+
/**
3+
* Zend Framework
4+
*
5+
* LICENSE
6+
*
7+
* This source file is subject to the new BSD license that is bundled
8+
* with this package in the file LICENSE.txt.
9+
* It is also available through the world-wide-web at this URL:
10+
* http://framework.zend.com/license/new-bsd
11+
* If you did not receive a copy of the license and are unable to
12+
* obtain it through the world-wide-web, please send an email
13+
* to license@zend.com so we can send you a copy immediately.
14+
*
15+
* @category Zend
16+
* @package Zend_Navigation
17+
* @subpackage Exception
18+
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
19+
* @license http://framework.zend.com/license/new-bsd New BSD License
20+
*/
221

322
namespace Zend\Navigation\Exception;
423

524
use Zend\Navigation\Exception;
625

26+
/**
27+
* Navigation invalid argument exception
28+
*
29+
* @category Zend
30+
* @package Zend_Navigation
31+
* @subpackage Exception
32+
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
33+
* @license http://framework.zend.com/license/new-bsd New BSD License
34+
*/
735
class InvalidArgumentException extends \InvalidArgumentException implements Exception
8-
{
9-
10-
}
36+
{}
Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,36 @@
11
<?php
2+
/**
3+
* Zend Framework
4+
*
5+
* LICENSE
6+
*
7+
* This source file is subject to the new BSD license that is bundled
8+
* with this package in the file LICENSE.txt.
9+
* It is also available through the world-wide-web at this URL:
10+
* http://framework.zend.com/license/new-bsd
11+
* If you did not receive a copy of the license and are unable to
12+
* obtain it through the world-wide-web, please send an email
13+
* to license@zend.com so we can send you a copy immediately.
14+
*
15+
* @category Zend
16+
* @package Zend_Navigation
17+
* @subpackage Exception
18+
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
19+
* @license http://framework.zend.com/license/new-bsd New BSD License
20+
*/
221

322
namespace Zend\Navigation\Exception;
423

524
use Zend\Navigation\Exception;
625

7-
class OutOfBoundsException extends \InvalidArgumentException implements Exception
8-
{
9-
10-
}
26+
/**
27+
* Navigation out of bounds exception
28+
*
29+
* @category Zend
30+
* @package Zend_Navigation
31+
* @subpackage Exception
32+
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
33+
* @license http://framework.zend.com/license/new-bsd New BSD License
34+
*/
35+
class OutOfBoundsException extends \OutOfBoundsException implements Exception
36+
{}

src/Navigation.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,43 +12,43 @@
1212
* obtain it through the world-wide-web, please send an email
1313
* to license@zend.com so we can send you a copy immediately.
1414
*
15-
* @category Zend
16-
* @package Zend_Navigation
17-
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
18-
* @license http://framework.zend.com/license/new-bsd New BSD License
15+
* @category Zend
16+
* @package Zend_Navigation
17+
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
18+
* @license http://framework.zend.com/license/new-bsd New BSD License
1919
*/
2020

21-
/**
22-
* @namespace
23-
*/
2421
namespace Zend\Navigation;
2522

23+
use Traversable;
24+
2625
/**
2726
* A simple container class for {@link Zend_Navigation_Page} pages
2827
*
29-
* @uses \Zend\Navigation\Container
30-
* @uses \Zend\Navigation\InvalidArgumentException
3128
* @category Zend
3229
* @package Zend_Navigation
33-
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
30+
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
3431
* @license http://framework.zend.com/license/new-bsd New BSD License
3532
*/
3633
class Navigation extends Container
3734
{
3835
/**
3936
* Creates a new navigation container
4037
*
41-
* @param array|\Zend\Config\Config $pages [optional] pages to add
42-
* @throws \Zend\Navigation\InvalidArgumentException if $pages is invalid
38+
* @param array|Traversable $pages [optional] pages to add
39+
* @throws Exception\InvalidArgumentException if $pages is invalid
4340
*/
4441
public function __construct($pages = null)
4542
{
46-
if (is_array($pages) || $pages instanceof \Zend\Config\Config) {
47-
$this->addPages($pages);
48-
} elseif (null !== $pages) {
43+
if ($pages && (!is_array($pages) && !$pages instanceof Traversable)) {
4944
throw new Exception\InvalidArgumentException(
50-
'Invalid argument: $pages must be an array, an ' .
51-
'instance of Zend_Config, or null');
45+
'Invalid argument: $pages must be an array, an '
46+
. 'instance of Traversable, or null'
47+
);
48+
}
49+
50+
if ($pages) {
51+
$this->addPages($pages);
5252
}
5353
}
5454
}

0 commit comments

Comments
 (0)