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

Commit e76b67c

Browse files
committed
Merge branch 'master' into acceptHandling
Conflicts: library/Zend/Http/Header/AbstractAccept.php library/Zend/Http/Header/AcceptEncoding.php library/Zend/Http/Header/AcceptLanguage.php tests/Zend/Http/Header/AcceptCharsetTest.php tests/Zend/Http/Header/AcceptEncodingTest.php tests/Zend/Http/Header/AcceptLanguageTest.php tests/Zend/Http/Header/AcceptTest.php
6 parents 87054e9 + 24f498b + d2dd157 + 6c759d8 + 51b0320 + aabe1c0 commit e76b67c

File tree

9 files changed

+27
-21
lines changed

9 files changed

+27
-21
lines changed

src/AbstractContainer.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use RecursiveIteratorIterator;
1616
use Traversable;
1717
use Zend\Stdlib\ArrayUtils;
18+
use Zend\Stdlib\ErrorHandler;
1819

1920
/**
2021
* Zend_Navigation_Container
@@ -154,7 +155,7 @@ public function addPages($pages)
154155
);
155156
}
156157

157-
// Because adding a page to a container removes it from the original
158+
// Because adding a page to a container removes it from the original
158159
// (see {@link Page\AbstractPage::setParent()}), iteration of the
159160
// original container will break. As such, we need to iterate the
160161
// container into an array first.
@@ -237,7 +238,7 @@ public function removePages()
237238
* Checks if the container has the given page
238239
*
239240
* @param Page\AbstractPage $page page to look for
240-
* @param bool $recursive [optional] whether to search recursively.
241+
* @param bool $recursive [optional] whether to search recursively.
241242
* Default is false.
242243
* @return bool whether page is in container
243244
*/
@@ -348,7 +349,10 @@ public function findBy($property, $value, $all = false)
348349
*/
349350
public function __call($method, $arguments)
350351
{
351-
if (@preg_match('/(find(?:One|All)?By)(.+)/', $method, $match)) {
352+
ErrorHandler::start(E_WARNING);
353+
$result = preg_match('/(find(?:One|All)?By)(.+)/', $method, $match);
354+
ErrorHandler::stop();
355+
if ($result) {
352356
return $this->{$match[1]}($match[2], $arguments[0]);
353357
}
354358

src/Exception/BadMethodCallException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
* @package Zend_Navigation
1818
* @subpackage Exception
1919
*/
20-
class BadMethodCallException extends \BadMethodCallException implements
20+
class BadMethodCallException extends \BadMethodCallException implements
2121
ExceptionInterface
2222
{}

src/Exception/InvalidArgumentException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
* @package Zend_Navigation
1818
* @subpackage Exception
1919
*/
20-
class InvalidArgumentException extends \InvalidArgumentException implements
20+
class InvalidArgumentException extends \InvalidArgumentException implements
2121
ExceptionInterface
2222
{}

src/Page/AbstractPage.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -643,15 +643,15 @@ public function getOrder()
643643
/**
644644
* Sets ACL resource assoicated with this page
645645
*
646-
* @param string|AclResource $resource [optional] resource to associate
647-
* with page. Default is null, which
646+
* @param string|AclResource $resource [optional] resource to associate
647+
* with page. Default is null, which
648648
* sets no resource.
649649
* @return AbstractPage fluent interface, returns self
650650
* @throws Exception\InvalidArgumentException if $resource is invalid
651651
*/
652652
public function setResource($resource = null)
653653
{
654-
if (null === $resource
654+
if (null === $resource
655655
|| is_string($resource)
656656
|| $resource instanceof AclResource
657657
) {
@@ -778,7 +778,7 @@ public function setVisible($visible = true)
778778
*/
779779
public function isVisible($recursive = false)
780780
{
781-
if ($recursive
781+
if ($recursive
782782
&& isset($this->parent)
783783
&& $this->parent instanceof self
784784
) {
@@ -1103,7 +1103,7 @@ public function getCustomProperties()
11031103
*
11041104
* @return string a hash code value for this page
11051105
*/
1106-
public final function hashCode()
1106+
final public function hashCode()
11071107
{
11081108
return spl_object_hash($this);
11091109
}

src/Service/AbstractNavigationFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ protected function getPagesFromConfig($config = null)
9494
$config
9595
));
9696
}
97-
} else if ($config instanceof Config\Config) {
97+
} elseif ($config instanceof Config\Config) {
9898
$config = $config->toArray();
99-
} else if (!is_array($config)) {
99+
} elseif (!is_array($config)) {
100100
throw new Exception\InvalidArgumentException('
101101
Invalid input, expected array, filename, or Zend\Config object'
102102
);

test/NavigationTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
namespace ZendTest\Navigation;
12+
1213
use Zend\Navigation\Page;
1314

1415
/**

test/Page/PageTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,12 @@ public function testSetAndGetFragmentIdentifier()
172172
'uri' => '#',
173173
'fragment' => 'foo',
174174
));
175-
175+
176176
$this->assertEquals('foo', $page->getFragment());
177-
177+
178178
$page->setFragment('bar');
179179
$this->assertEquals('bar', $page->getFragment());
180-
180+
181181
$invalids = array(42, (object) null);
182182
foreach ($invalids as $invalid) {
183183
try {
@@ -716,7 +716,7 @@ public function testSetVisibleShouldJuggleValue()
716716

717717
/**
718718
* ZF-10146
719-
*
719+
*
720720
* @link http://framework.zend.com/issues/browse/ZF-10146
721721
*/
722722
$page->setVisible('False');

test/Page/UriTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
namespace ZendTest\Navigation\Page;
12+
1213
use Zend\Navigation\Page;
1314
use Zend\Navigation;
1415

@@ -95,15 +96,15 @@ public function testGetHref()
9596
public function testGetHrefWithFragmentIdentifier()
9697
{
9798
$uri = 'http://www.example.com/foo.html';
98-
99+
99100
$page = new Page\Uri();
100101
$page->setUri($uri);
101102
$page->setFragment('bar');
102-
103+
103104
$this->assertEquals($uri . '#bar', $page->getHref());
104-
105+
105106
$page->setUri('#');
106-
107+
107108
$this->assertEquals('#bar', $page->getHref());
108109
}
109110
}

test/TestAsset/FileNavigationFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace ZendTest\Navigation\TestAsset;
1212

13-
use \Zend\Navigation\Service\AbstractNavigationFactory;
13+
use Zend\Navigation\Service\AbstractNavigationFactory;
1414

1515
class FileNavigationFactory extends AbstractNavigationFactory
1616
{

0 commit comments

Comments
 (0)