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

Commit

Permalink
Merge branch 'develop' of git://github.com/zendframework/zf2 into hot…
Browse files Browse the repository at this point in the history
…fix/cache-empty-namespace
  • Loading branch information
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/Page/AbstractPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ public function set($property, $value)
);
}

$method = 'set' . self::normalizePropertyName($property);
$method = 'set' . static::normalizePropertyName($property);

if ($method != 'setOptions' && method_exists($this, $method)
) {
Expand Down Expand Up @@ -907,7 +907,7 @@ public function get($property)
);
}

$method = 'get' . self::normalizePropertyName($property);
$method = 'get' . static::normalizePropertyName($property);

if (method_exists($this, $method)) {
return $this->$method();
Expand Down Expand Up @@ -963,7 +963,7 @@ public function __get($name)
*/
public function __isset($name)
{
$method = 'get' . self::normalizePropertyName($name);
$method = 'get' . static::normalizePropertyName($name);
if (method_exists($this, $method)) {
return true;
}
Expand All @@ -982,7 +982,7 @@ public function __isset($name)
*/
public function __unset($name)
{
$method = 'set' . self::normalizePropertyName($name);
$method = 'set' . static::normalizePropertyName($name);
if (method_exists($this, $method)) {
throw new Exception\InvalidArgumentException(
sprintf(
Expand Down
8 changes: 5 additions & 3 deletions src/Page/Mvc.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function getHref()

$router = $this->router;
if (null === $router) {
$router = self::$defaultRouter;
$router = static::$defaultRouter;
}

if (!$router instanceof RouteStackInterface) {
Expand Down Expand Up @@ -411,7 +411,7 @@ public function setRouter(RouteStackInterface $router)
*/
public static function setDefaultRouter($router)
{
self::$defaultRouter = $router;
static::$defaultRouter = $router;
}

/**
Expand All @@ -421,7 +421,7 @@ public static function setDefaultRouter($router)
*/
public static function getDefaultRouter()
{
return self::$defaultRouter;
return static::$defaultRouter;
}

// Public methods:
Expand All @@ -440,6 +440,8 @@ public function toArray()
'controller' => $this->getController(),
'params' => $this->getParams(),
'route' => $this->getRoute(),
'router' => $this->getRouter(),
'route_match' => $this->getRouteMatch(),
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/View/HelperConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class HelperConfig implements ConfigInterface
*/
public function configureServiceManager(ServiceManager $serviceManager)
{
$serviceManager->setFactory('navigation', function(HelperPluginManager $pm) {
$serviceManager->setFactory('navigation', function (HelperPluginManager $pm) {
$helper = new \Zend\View\Helper\Navigation;
$helper->setServiceLocator($pm->getServiceLocator());
return $helper;
Expand Down
4 changes: 3 additions & 1 deletion test/Page/MvcTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,9 @@ public function testToArrayMethod()
'active' => true,
'visible' => false,
'foo' => 'bar',
'meaning' => 42
'meaning' => 42,
'router' => $this->router,
'route_match' => $this->routeMatch,
);

$page = new Page\Mvc($options);
Expand Down
4 changes: 2 additions & 2 deletions test/ServiceFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function setUp()
'extra_config' => array(
'service_manager' => array(
'factories' => array(
'Config' => function() {
'Config' => function () {
return array(
'navigation' => array(
'file' => __DIR__ . '/_files/navigation.xml',
Expand Down Expand Up @@ -119,7 +119,7 @@ public function testMvcPagesGetInjectedWithComponents()
$this->serviceManager->setFactory('Navigation', 'Zend\Navigation\Service\DefaultNavigationFactory');
$container = $this->serviceManager->get('Navigation');

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

0 comments on commit ae927c2

Please sign in to comment.