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

Commit

Permalink
Merge pull request zendframework/zendframework#2141 from Maks3w/hotfi…
Browse files Browse the repository at this point in the history
…x/console-bugs

Hotfix/console bugs
  • Loading branch information
padraic committed Aug 13, 2012
2 parents 47ed633 + 8e6c200 commit 38f9a49
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 38 deletions.
47 changes: 15 additions & 32 deletions src/Renderer/ConsoleRenderer.php
Original file line number Diff line number Diff line change
@@ -1,35 +1,18 @@
<?php
/**
* Zend Framework
* Zend Framework (http://framework.zend.com/)
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_View
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_View
*/

/**
* @namespace
*/
namespace Zend\View\Renderer;

use ArrayAccess;
use Zend\Filter\FilterChain;
use Zend\View\Exception;
use Zend\View\Model;
use Zend\View\Renderer;
use Zend\View\Resolver;
use Zend\View\Variables;
use Zend\View\Model\ModelInterface;
use Zend\View\Resolver\ResolverInterface;

/**
* Abstract class for Zend_View to help enforce private constructs.
Expand All @@ -40,14 +23,11 @@
*
* @category Zend
* @package Zend_View
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class ConsoleRenderer implements Renderer, TreeRendererInterface
class ConsoleRenderer implements RendererInterface, TreeRendererInterface
{
/**
* @var Zend\Filter\FilterChain
* @protected
*/
protected $__filterChain;

Expand All @@ -66,7 +46,10 @@ public function __construct($config = array())
$this->init();
}

public function setResolver(Resolver $resolver) {}
public function setResolver(ResolverInterface $resolver)
{
return $this;
}

/**
* Return the template engine object
Expand Down Expand Up @@ -120,15 +103,15 @@ public function getFilterChain()
/**
* Recursively processes all ViewModels and returns output.
*
* @param string|Model $model A ViewModel instance.
* @param null|array|Traversable $values Values to use when rendering. If none
* @param string|ModelInterface $model A ViewModel instance.
* @param null|array|\Traversable $values Values to use when rendering. If none
* provided, uses those in the composed
* variables container.
* @return string Console output.
*/
public function render($model, $values = null)
{
if (!$model instanceof Model) {
if (!$model instanceof ModelInterface) {
return '';
}

Expand Down
12 changes: 6 additions & 6 deletions src/Renderer/RendererInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

namespace Zend\View\Renderer;

use Zend\View\Model\ModelInterface as Model;
use Zend\View\Resolver\ResolverInterface as Resolver;
use Zend\View\Model\ModelInterface;
use Zend\View\Resolver\ResolverInterface;

/**
* Interface class for Zend_View compatible template engine implementations
Expand All @@ -35,16 +35,16 @@ public function getEngine();
/**
* Set the resolver used to map a template name to a resource the renderer may consume.
*
* @param Resolver $resolver
* @param ResolverInterface $resolver
* @return RendererInterface
*/
public function setResolver(Resolver $resolver);
public function setResolver(ResolverInterface $resolver);

/**
* Processes a view script and returns the output.
*
* @param string|Model $name The script/resource process, or a view model
* @param null|array|\ArrayAccess Values to use during rendering
* @param string|ModelInterface $nameOrModel The script/resource process, or a view model
* @param null|array|\ArrayAccess $values Values to use during rendering
* @return string The script output.
*/
public function render($nameOrModel, $values = null);
Expand Down

0 comments on commit 38f9a49

Please sign in to comment.