src/Peach/Markup/NodeList.php
private function prepareAppendee($var)
    {
        if ($var instanceof Node) {
            return $var;
        }
        if ($var instanceof Component) {
            return $var->getAppendee()->getChildNodes();
        }
        
        if (is_array($var)) {
            $result = array();
            foreach ($var as $i) {
                $appendee = $this->prepareAppendee($i);
                if (is_array($appendee)) {
                    array_splice($result, count($result), 0, $appendee);
                } else {
                    $result[] = $appendee;
                }
            }
            return $result;
        }
        if (!isset($var)) {
            return array();
        }
        
        return array(new Text(Values::stringValue($var)));
    }
private function prepareAppendee($var)
    {
        if ($var instanceof Node) {
            return $var;
        }
        if ($var instanceof Component) {
            return $var->getAppendee()->getChildNodes();
        }
        
        if (is_array($var)) {
            $result = array();
            foreach ($var as $i) {
                $appendee = $this->prepareAppendee($i);
                if (is_array($appendee)) {
                    array_splice($result, count($result), 0, $appendee);
                } else {
                    $result[] = $appendee;
                }
            }
            return $result;
        }
        if (!isset($var)) {
            return array();
        }
        
        return array(new Text(Values::stringValue($var)));
    }
この NodeList に実際に追加される値を返します.

@param  mixed $var
@return Node[] 追加されるノードの配列