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

Commit

Permalink
Merge branch 'upstream/master' into module-class-map-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
16 changes: 7 additions & 9 deletions src/AbstractContainer.php
Expand Up @@ -351,18 +351,16 @@ public function __call($method, $arguments)
{
ErrorHandler::start(E_WARNING);
$result = preg_match('/(find(?:One|All)?By)(.+)/', $method, $match);
ErrorHandler::stop();
if ($result) {
return $this->{$match[1]}($match[2], $arguments[0]);
}

throw new Exception\BadMethodCallException(
sprintf(
$error = ErrorHandler::stop();
if (!$result) {
throw new Exception\BadMethodCallException(sprintf(
'Bad method call: Unknown method %s::%s',
get_called_class(),
$method
)
);
), 0, $error);
}
return $this->{$match[1]}($match[2], $arguments[0]);

}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Page/AbstractPage.php
Expand Up @@ -641,7 +641,7 @@ public function getOrder()
}

/**
* Sets ACL resource assoicated with this page
* Sets ACL resource associated with this page
*
* @param string|AclResource $resource [optional] resource to associate
* with page. Default is null, which
Expand Down
2 changes: 1 addition & 1 deletion src/Service/AbstractNavigationFactory.php
Expand Up @@ -113,7 +113,7 @@ protected function getPagesFromConfig($config = null)
*/
protected function injectComponents(array $pages, RouteMatch $routeMatch = null, Router $router = null)
{
foreach($pages as &$page) {
foreach ($pages as &$page) {
$hasMvc = isset($page['action']) || isset($page['controller']) || isset($page['route']);
if ($hasMvc) {
if (!isset($page['routeMatch']) && $routeMatch) {
Expand Down
6 changes: 3 additions & 3 deletions test/Page/PageFactoryTest.php
Expand Up @@ -108,7 +108,7 @@ public function testShouldFailForInvalidType()
'type' => 'ZendTest\Navigation\TestAsset\InvalidPage',
'label' => 'My Invalid Page'
));
} catch(Navigation\Exception\InvalidArgumentException $e) {
} catch (Navigation\Exception\InvalidArgumentException $e) {
return;
}

Expand All @@ -124,7 +124,7 @@ public function testShouldFailForNonExistantType()

try {
$page = AbstractPage::factory($pageConfig);
} catch(Navigation\Exception\InvalidArgumentException $e) {
} catch (Navigation\Exception\InvalidArgumentException $e) {
return;
}

Expand All @@ -138,7 +138,7 @@ public function testShouldFailIfUnableToDetermineType()
$page = AbstractPage::factory(array(
'label' => 'My Invalid Page'
));
} catch(Navigation\Exception\InvalidArgumentException $e) {
} catch (Navigation\Exception\InvalidArgumentException $e) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion test/ServiceFactoryTest.php
Expand Up @@ -120,7 +120,7 @@ public function testMvcPagesGetInjectedWithComponents()
$container = $this->serviceManager->get('Navigation');

$recursive = function($that, $pages) use (&$recursive) {
foreach($pages as $page) {
foreach ($pages as $page) {
if ($page instanceof MvcPage) {
$that->assertInstanceOf('Zend\Mvc\Router\RouteStackInterface', $page->getRouter());
$that->assertInstanceOf('Zend\Mvc\Router\RouteMatch', $page->getRouteMatch());
Expand Down

0 comments on commit 1035d13

Please sign in to comment.