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

Commit

Permalink
Merge branch 'master' of https://github.com/zendframework/zf2 into qu…
Browse files Browse the repository at this point in the history
…ickfix/sharedem-type-preference
  • Loading branch information
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .travis/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ for tested in "${testedcomponents[@]}"
do
echo "$tested:"
phpunit -c $testdir/phpunit.xml $testdir/$tested
let "result = $result || $?"
result=$(($result || $?))
done

exit $result
exit $result
2 changes: 1 addition & 1 deletion .travis/tested-components
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Zend/Crypt
Zend/Currency
Zend/Db
Zend/Di
Zend/Docbook
Zend/DocBook
Zend/Dojo
Zend/Dom
Zend/EventManager
Expand Down
27 changes: 16 additions & 11 deletions src/Helper/Placeholder/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

namespace Zend\View\Helper\Placeholder;

use Zend\Registry as RegistryZend;
use Zend\View\Exception;

/**
Expand Down Expand Up @@ -58,11 +59,11 @@ class Registry
*/
public static function getRegistry()
{
if (\Zend\Registry::isRegistered(self::REGISTRY_KEY)) {
$registry = \Zend\Registry::get(self::REGISTRY_KEY);
if (RegistryZend::isRegistered(self::REGISTRY_KEY)) {
$registry = RegistryZend::get(self::REGISTRY_KEY);
} else {
$registry = new self();
\Zend\Registry::set(self::REGISTRY_KEY, $registry);
RegistryZend::set(self::REGISTRY_KEY, $registry);
}

return $registry;
Expand All @@ -73,7 +74,7 @@ public static function getRegistry()
*
* @param string $key
* @param array $value
* @return \Zend\View\Helper\Placeholder\Container\AbstractContainer
* @return Container\AbstractContainer
*/
public function createContainer($key, array $value = array())
{
Expand All @@ -87,7 +88,7 @@ public function createContainer($key, array $value = array())
* Retrieve a placeholder container
*
* @param string $key
* @return \Zend\View\Helper\Placeholder\Container\AbstractContainer
* @return Container\AbstractContainer
*/
public function getContainer($key)
{
Expand Down Expand Up @@ -118,10 +119,10 @@ public function containerExists($key)
* Set the container for an item in the registry
*
* @param string $key
* @param Zend\View\Placeholder\Container\AbstractContainer $container
* @return Zend\View\Placeholder\Registry
* @param Container\AbstractContainer $container
* @return Registry
*/
public function setContainer($key, \Zend\View\Helper\Placeholder\Container\AbstractContainer $container)
public function setContainer($key, Container\AbstractContainer $container)
{
$key = (string) $key;
$this->_items[$key] = $container;
Expand Down Expand Up @@ -149,16 +150,20 @@ public function deleteContainer($key)
* Set the container class to use
*
* @param string $name
* @return \Zend\View\Helper\Placeholder\Registry
* @throws Exception\InvalidArgumentException
* @throws Exception\DomainException
* @return Registry
*/
public function setContainerClass($name)
{
if (!class_exists($name)) {
\Zend\Loader::loadClass($name);
throw new Exception\DomainException(
sprintf('%s expects a valid registry class name; received "%s", which did not resolve',
__METHOD__,
$name
));
}


if (!in_array('Zend\View\Helper\Placeholder\Container\AbstractContainer', class_parents($name))) {
throw new Exception\InvalidArgumentException('Invalid Container class specified');
}
Expand Down

0 comments on commit 29354c5

Please sign in to comment.