web/lib/Zend/View/Helper/Placeholder/Container/Abstract.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
--- a/web/lib/Zend/View/Helper/Placeholder/Container/Abstract.php	Thu Mar 21 17:31:31 2013 +0100
+++ b/web/lib/Zend/View/Helper/Placeholder/Container/Abstract.php	Thu Mar 21 19:50:53 2013 +0100
@@ -15,8 +15,8 @@
  * @category   Zend
  * @package    Zend_View
  * @subpackage Helper
- * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- * @version    $Id: Abstract.php 20096 2010-01-06 02:05:09Z bkarwin $
+ * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version    $Id: Abstract.php 25255 2013-02-13 15:25:39Z frosch $
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 
@@ -25,7 +25,7 @@
  *
  * @package    Zend_View
  * @subpackage Helper
- * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
  * @license    http://framework.zend.com/license/new-bsd     New BSD License
  */
 abstract class Zend_View_Helper_Placeholder_Container_Abstract extends ArrayObject
@@ -93,7 +93,7 @@
     /**
      * Constructor - This is needed so that we can attach a class member as the ArrayObject container
      *
-     * @return void
+     * @return \Zend_View_Helper_Placeholder_Container_Abstract
      */
     public function __construct()
     {
@@ -252,9 +252,10 @@
     /**
      * Start capturing content to push into placeholder
      *
-     * @param  int $type How to capture content into placeholder; append, prepend, or set
+     * @param int|string $type How to capture content into placeholder; append, prepend, or set
+     * @param null       $key
+     * @throws Zend_View_Helper_Placeholder_Container_Exception
      * @return void
-     * @throws Zend_View_Helper_Placeholder_Exception if nested captures detected
      */
     public function captureStart($type = Zend_View_Helper_Placeholder_Container_Abstract::APPEND, $key = null)
     {
@@ -349,10 +350,16 @@
     /**
      * Render the placeholder
      *
+     * @param null $indent
      * @return string
      */
     public function toString($indent = null)
     {
+        // Check items
+        if (0 === $this->count()) {
+            return '';
+        }
+
         $indent = ($indent !== null)
                 ? $this->getWhitespace($indent)
                 : $this->getIndent();