Build Dual lista data

@param DOMNode $list
@param array $arr
430332
private function buildListItens($list, $arr)
	{
		foreach ($arr as $key=>$value) 
		{
			$item = XmlUtil::CreateChild($list, "item", "");
			XmlUtil::AddAttribute($item, "id", $key);
			XmlUtil::AddAttribute($item, "text", $value);
		}
	}
1313220
public function setListByAssociativeArray($list) {
		
		foreach ($list as $value=>$text) {
				
			$option			= new \stdClass();
			$option->value	= $value;
			$option->text	= $text;
			$option->attributes	= [];

			$this->list[]	= $option;
				
		}
		
		return $this;
		
	}
346854
protected static function build_list($type = 'ul', array $list = array(), $attr = false, $indent = '')
	{
		if ( ! is_array($list))
		{
			$result = false;
		}

		$out = '';
		foreach ($list as $key => $val)
		{
			if ( ! is_array($val))
			{
				$out .= $indent."\t".html_tag('li', false, $val).PHP_EOL;
			}
			else
			{
				$out .= $indent."\t".html_tag('li', false, $key.PHP_EOL.static::build_list($type, $val, '', $indent."\t\t").$indent."\t").PHP_EOL;
			}
		}
		$result = $indent.html_tag($type, $attr, PHP_EOL.$out.$indent).PHP_EOL;
		return $result;
	}
1153145
public static <T> T[] listToArray(List<T> list, T[] array) {
        if (list == null || array == null) {
            return null;
        }

        return list.toArray(array);
    }
197398
public static function mergeTree(array $arr1, array $arr2): array
	{
		$res = $arr1 + $arr2;
		foreach (array_intersect_key($arr1, $arr2) as $k => $v) {
			if (is_array($v) && is_array($arr2[$k])) {
				$res[$k] = self::mergeTree($v, $arr2[$k]);
			}
		}
		return $res;
	}
766180
@SafeVarargs
    public static <E> List<E> asList(E[]... arrs) {
        int size = 0;
        for (E[] arr : arrs) {
            if (arr == null) {
                throw new IllegalArgumentException("Null arrays not allowed");
            }
            size += arr.length;
        }
        List<E> result = new ArrayList<>(size);
        addAll(result, arrs);
        return result;
    }
808072
protected function listing($type, $list, $attributes = [])
    {
        $html = '';

        if (count($list) === 0) {
            return $html;
        }

        // Essentially we will just spin through the list and build the list of the HTML
        // elements from the array. We will also handled nested lists in case that is
        // present in the array. Then we will build out the final listing elements.
        foreach ($list as $key => $value) {
            $html .= $this->listingElement($key, $type, $value);
        }

        $attributes = $this->attributes($attributes);

        return $this->toHtmlString("<{$type}{$attributes}>{$html}</{$type}>");
    }
1347103
protected function setPriceListAttribute($arPriceList)
    {
        if (empty($arPriceList) || !is_array($arPriceList)) {
            return;
        }

        if (isset($arPriceList[0])) {
            $this->fSavedPrice = array_get($arPriceList[0], 'price');
            $this->fSavedOldPrice = array_get($arPriceList[0], 'old_price');
            unset($arPriceList[0]);
        }

        $this->arSavedPriceList = $arPriceList;
    }
456911
public static String arrayToList(Array array, String delimiter) throws PageException {
	if (array.size() == 0) return "";
	StringBuilder sb = new StringBuilder(Caster.toString(array.get(1, "")));
	int len = array.size();

	for (int i = 2; i <= len; i++) {
	    sb.append(delimiter);
	    sb.append(Caster.toString(array.get(i, "")));
	}
	return sb.toString();
    }
684999
function _makeSmallData(&$raList)
    {
        $sRes = '';
        $FILE = $this->_FILEH_;
        $iSmBlk = 0;
   
        for ($i = 0; $i < count($raList); $i++) {
            // Make SBD, small data string
            if ($raList[$i]->Type == OLE_PPS_TYPE_FILE) {
                if ($raList[$i]->Size <= 0) {
                    continue;
                }
                if ($raList[$i]->Size < OLE_DATA_SIZE_SMALL) {
                    $iSmbCnt = floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE)
                                  + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0);
                    // Add to SBD
                    for ($j = 0; $j < ($iSmbCnt-1); $j++) {
                        fwrite($FILE, pack("V", $j+$iSmBlk+1));
                    }
                    fwrite($FILE, pack("V", -2));
                   
                    // Add to Data String(this will be written for RootEntry)
                    if ($raList[$i]->_PPS_FILE) {
                        fseek($raList[$i]->_PPS_FILE, 0); // To The Top
                        while ($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) {
                            $sRes .= $sBuff;
                        }
                    } else {
                        $sRes .= $raList[$i]->_data;
                    }
                    if ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE) {
                        for ($j = 0; $j < ($this->_SMALL_BLOCK_SIZE - ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)); $j++) {
                            $sRes .= "\x00";
                        }
                    }
                    // Set for PPS
                    $raList[$i]->_StartBlock = $iSmBlk;
                    $iSmBlk += $iSmbCnt;
                }
            }
        }
        $iSbCnt = floor($this->_BIG_BLOCK_SIZE / OLE_LONG_INT_SIZE);
        if ($iSmBlk % $iSbCnt) {
            for ($i = 0; $i < ($iSbCnt - ($iSmBlk % $iSbCnt)); $i++) {
                fwrite($FILE, pack("V", -1));
            }
        }
        return $sRes;
    }
1319834
public function addArrayChild(&$parent, $arr)
    {
        $num = 0;
        if (! empty($arr) && ! empty($parent)) {
            foreach ($arr as $node) {
                $this->appChild($parent, $node, '');
                $num++;
            }
        }

        return $num;
    }
522120
protected function searchByAttributeRecurrent(
        DOMNodeList $node,
        $value,
        array $list = []
    ) {
        /** @var DomElement $child */
        foreach ($node as $child) {
            if ($child->nodeType === 1) {
                if ($child->hasChildNodes()) {
                    $list = $this->searchByAttributeRecurrent(
                        $child->childNodes,
                        $value,
                        $list
                    );
                }

                $attribute = $child->getAttribute($value);
                if ($attribute) {
                    $list[$attribute] = $child;
                }
            }
        }

        return $list;
    }
1232571
private function calendarListText(array $list, string $tag1, string $tag2, Tree $tree): string
    {
        $html = '';

        foreach ($list as $id => $facts) {
            $tmp  = GedcomRecord::getInstance($id, $tree);
            $html .= $tag1 . '<a href="' . e($tmp->url()) . '">' . $tmp->fullName() . '</a> ';
            $html .= '<div class="indent">' . $facts . '</div>' . $tag2;
        }

        return $html;
    }
254016
private function staticArrayPairList(ArrayNode $node, $terminator) {
    $elements = new CommaListNode();
    do {
      if ($this->currentType === $terminator) {
        break;
      }
      $this->matchHidden($elements);
      $value = $this->staticScalar();
      if ($this->currentType === T_DOUBLE_ARROW) {
        $pair = new ArrayPairNode();
        $pair->addChild($value, 'key');
        $this->mustMatch(T_DOUBLE_ARROW, $pair);
        $pair->addChild($this->staticScalar(), 'value');
        $elements->addChild($pair);
      }
      else {
        $elements->addChild($value);
      }
    } while ($this->tryMatch(',', $elements, NULL, TRUE));
    $node->addChild($elements, 'elements');
  }
1366738
public function dl(array $list, array $attributes = [])
    {
        $attributes = $this->attributes($attributes);
        $html       = "<dl{$attributes}>";

        foreach ($list as $key => $value) {
            $html .= "<dt>$key</dt><dd>$value</dd>";
        }

        $html .= '</dl>';

        return $html;
    }
408394
public function ol(array $list, array $options = [], array $itemOptions = [])
    {
        return self::nestedList($list, array_merge($options, ['tag' => 'ol']), $itemOptions);
    }
1116073
protected function _toArray( array $list )
	{
		$result = array();

		foreach( $list as $item ) {
			$result[] = (object) $item->toArray();
		}

		return $result;
	}