Decrease indentation in HelperCollection constructor
This commit is contained in:
@@ -27,14 +27,16 @@ class Mustache_HelperCollection
|
|||||||
*/
|
*/
|
||||||
public function __construct($helpers = null)
|
public function __construct($helpers = null)
|
||||||
{
|
{
|
||||||
if ($helpers !== null) {
|
if ($helpers === null) {
|
||||||
if (!is_array($helpers) && !$helpers instanceof Traversable) {
|
return;
|
||||||
throw new Mustache_Exception_InvalidArgumentException('HelperCollection constructor expects an array of helpers');
|
}
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($helpers as $name => $helper) {
|
if (!is_array($helpers) && !$helpers instanceof Traversable) {
|
||||||
$this->add($name, $helper);
|
throw new Mustache_Exception_InvalidArgumentException('HelperCollection constructor expects an array of helpers');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ($helpers as $name => $helper) {
|
||||||
|
$this->add($name, $helper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user