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

Commit 9398e77

Browse files
committed
Merge branch 'master' of git://git.zendframework.com/zf
3 parents 3bfe83d + 1d9542f + a22d6e2 commit 9398e77

File tree

9 files changed

+190
-178
lines changed

9 files changed

+190
-178
lines changed

src/Page/Page.php renamed to src/AbstractPage.php

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

src/Container.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* @uses RecursiveIterator
3535
* @uses RecursiveIteratorIterator
3636
* @uses \Zend\Navigation\Exception
37-
* @uses \Zend\Navigation\Page\Page
37+
* @uses \Zend\Navigation\AbstractPage
3838
* @category Zend
3939
* @package Zend_Navigation
4040
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
@@ -123,8 +123,8 @@ public function addPage($page)
123123
}
124124

125125
if (is_array($page) || $page instanceof Config\Config) {
126-
$page = Page\Page::factory($page);
127-
} elseif (!$page instanceof Page\Page) {
126+
$page = AbstractPage::factory($page);
127+
} elseif (!$page instanceof AbstractPage) {
128128
throw new Exception(
129129
'Invalid argument: $page must be an instance of ' .
130130
'Zend_Navigation_Page or Zend_Config, or an array');
@@ -189,7 +189,7 @@ public function setPages(array $pages)
189189
/**
190190
* Returns pages in the container
191191
*
192-
* @return array array of \Zend\Navigation\Page\Page instances
192+
* @return array array of \Zend\Navigation\AbstractPage instances
193193
*/
194194
public function getPages()
195195
{
@@ -199,14 +199,14 @@ public function getPages()
199199
/**
200200
* Removes the given page from the container
201201
*
202-
* @param \Zend\Navigation\Page\Page|int $page page to remove, either a page
202+
* @param \Zend\Navigation\AbstractPage|int $page page to remove, either a page
203203
* instance or a specific page order
204204
* @return bool whether the removal was
205205
* successful
206206
*/
207207
public function removePage($page)
208208
{
209-
if ($page instanceof Page\Page) {
209+
if ($page instanceof AbstractPage) {
210210
$hash = $page->hashCode();
211211
} elseif (is_int($page)) {
212212
$this->_sort();
@@ -242,12 +242,12 @@ public function removePages()
242242
/**
243243
* Checks if the container has the given page
244244
*
245-
* @param \Zend\Navigation\Page\Page $page page to look for
245+
* @param \Zend\Navigation\AbstractPage $page page to look for
246246
* @param bool $recursive [optional] whether to search
247247
* recursively. Default is false.
248248
* @return bool whether page is in container
249249
*/
250-
public function hasPage(Page\Page $page, $recursive = false)
250+
public function hasPage(AbstractPage $page, $recursive = false)
251251
{
252252
if (array_key_exists($page->hashCode(), $this->_index)) {
253253
return true;
@@ -277,7 +277,7 @@ public function hasPages()
277277
*
278278
* @param string $property name of property to match against
279279
* @param mixed $value value to match property against
280-
* @return \Zend\Navigation\Page\Page|null matching page or null
280+
* @return \Zend\Navigation\AbstractPage|null matching page or null
281281
*/
282282
public function findOneBy($property, $value)
283283
{
@@ -299,7 +299,7 @@ public function findOneBy($property, $value)
299299
*
300300
* @param string $property name of property to match against
301301
* @param mixed $value value to match property against
302-
* @return array array containing only \Zend\Navigation\Page\Page
302+
* @return array array containing only \Zend\Navigation\AbstractPage
303303
* instances
304304
*/
305305
public function findAllBy($property, $value)
@@ -329,7 +329,7 @@ public function findAllBy($property, $value)
329329
* matching pages are found. If false, null will
330330
* be returned if no matching page is found.
331331
* Default is false.
332-
* @return \Zend\Navigation\Page\Page|null matching page or null
332+
* @return \Zend\Navigation\AbstractPage|null matching page or null
333333
*/
334334
public function findBy($property, $value, $all = false)
335335
{
@@ -392,7 +392,7 @@ public function toArray()
392392
*
393393
* Implements RecursiveIterator interface.
394394
*
395-
* @return \Zend\Navigation\Page\Page current page or null
395+
* @return \Zend\Navigation\AbstractPage current page or null
396396
* @throws \Zend\Navigation\Exception if the index is invalid
397397
*/
398398
public function current()
@@ -479,7 +479,7 @@ public function hasChildren()
479479
*
480480
* Implements RecursiveIterator interface.
481481
*
482-
* @return \Zend\Navigation\Page\Page|null
482+
* @return \Zend\Navigation\AbstractPage|null
483483
*/
484484
public function getChildren()
485485
{

src/Page/Mvc.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@
2424
* @namespace
2525
*/
2626
namespace Zend\Navigation\Page;
27-
use Zend\Navigation;
27+
28+
use Zend\Navigation\AbstractPage,
29+
Zend\Navigation\Exception as NavigationException;
2830

2931
/**
3032
* Represents a page that is defined using module, controller, action, route
3133
* name and route params to assemble the href
3234
*
33-
* @uses \Zend\Controller\Action\HelperBroker\HelperBroker
35+
* @uses \Zend\Controller\Action\HelperBroker
3436
* @uses \Zend\Controller\Front
3537
* @uses \Zend\Navigation\Exception
3638
* @uses \Zend\Navigation\Page\Page
@@ -40,7 +42,7 @@
4042
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
4143
* @license http://framework.zend.com/license/new-bsd New BSD License
4244
*/
43-
class Mvc extends Page
45+
class Mvc extends AbstractPage
4446
{
4547
/**
4648
* Action name to use when assembling URL
@@ -175,7 +177,7 @@ public function getHref()
175177

176178
if (null === self::$_urlHelper) {
177179
self::$_urlHelper =
178-
\Zend\Controller\Action\HelperBroker\HelperBroker::getStaticHelper('URL');
180+
\Zend\Controller\Action\HelperBroker::getStaticHelper('URL');
179181
}
180182

181183
$params = $this->getParams();
@@ -211,7 +213,7 @@ public function getHref()
211213
public function setAction($action)
212214
{
213215
if (null !== $action && !is_string($action)) {
214-
throw new Navigation\Exception(
216+
throw new NavigationException(
215217
'Invalid argument: $action must be a string or null');
216218
}
217219

@@ -244,7 +246,7 @@ public function getAction()
244246
public function setController($controller)
245247
{
246248
if (null !== $controller && !is_string($controller)) {
247-
throw new Navigation\Exception(
249+
throw new NavigationException(
248250
'Invalid argument: $controller must be a string or null');
249251
}
250252

@@ -277,7 +279,7 @@ public function getController()
277279
public function setModule($module)
278280
{
279281
if (null !== $module && !is_string($module)) {
280-
throw new Navigation\Exception(
282+
throw new NavigationException(
281283
'Invalid argument: $module must be a string or null');
282284
}
283285

@@ -344,7 +346,7 @@ public function getParams()
344346
public function setRoute($route)
345347
{
346348
if (null !== $route && (!is_string($route) || strlen($route) < 1)) {
347-
throw new Navigation\Exception(
349+
throw new NavigationException(
348350
'Invalid argument: $route must be a non-empty string or null');
349351
}
350352

src/Page/Uri.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
*/
2626
namespace Zend\Navigation\Page;
2727

28+
use Zend\Navigation\AbstractPage,
29+
Zend\Navigation\Exception as NavigationException;
30+
2831
/**
2932
* Represents a page that is defined by specifying a URI
3033
*
@@ -36,7 +39,7 @@
3639
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
3740
* @license http://framework.zend.com/license/new-bsd New BSD License
3841
*/
39-
class Uri extends Page
42+
class Uri extends AbstractPage
4043
{
4144
/**
4245
* Page URI
@@ -55,7 +58,7 @@ class Uri extends Page
5558
public function setUri($uri)
5659
{
5760
if (null !== $uri && !is_string($uri)) {
58-
throw new \Zend\Navigation\Exception(
61+
throw new NavigationException(
5962
'Invalid argument: $uri must be a string or null');
6063
}
6164

0 commit comments

Comments
 (0)