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

Commit e16f233

Browse files
committed
Better docblock for ZendView constructor
1 parent fbe1759 commit e16f233

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/Template/ZendView.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,23 @@ class ZendView implements TemplateInterface
4545
private $resolver;
4646

4747
/**
48+
* Constructor
49+
*
50+
* Allows specifying the renderer to use (any zend-view renderer is
51+
* allowed), and optionally also the layout.
52+
*
53+
* The layout may be:
54+
*
55+
* - a string layout name
56+
* - a ModelInterface instance representing the layout
57+
*
58+
* If no renderer is provided, a default PhpRenderer instance is created;
59+
* omitting the layout indicates no layout should be used by default when
60+
* rendering.
61+
*
4862
* @param null|RendererInterface $renderer
63+
* @param null|string|ModelInterface $layout
64+
* @throws InvalidArgumentException for invalid $layout types
4965
*/
5066
public function __construct(RendererInterface $renderer = null, $layout = null)
5167
{
@@ -201,11 +217,11 @@ private function createModel($name, array $params)
201217
* Do a recursive, depth-first rendering of a view model.
202218
*
203219
* @param ModelInterface $model
204-
* @param PhpRenderer $renderer
220+
* @param RendererInterface $renderer
205221
* @return string
206222
* @throws Exception\RenderingException if it encounters a terminal child.
207223
*/
208-
private function renderModel(ModelInterface $model, PhpRenderer $renderer)
224+
private function renderModel(ModelInterface $model, RendererInterface $renderer)
209225
{
210226
foreach ($model as $child) {
211227
if ($child->terminate()) {

0 commit comments

Comments
 (0)