@param array $list

@return array
184379
public function convert(array $list): array
    {
        $result = [];
        foreach ($this->mapping as $modelKeyName => $jsonKeyName) {
            $result[$modelKeyName] = $list[$jsonKeyName];
        }

        return $result;
    }
647384
protected function prepareListLibrary(array &$list)
    {
        foreach ($list as &$item) {
            $item['status'] = empty($item['errors']);
            $item['has_dependencies'] = !empty($item['requires']) || !empty($item['required_by']);
        }
    }
489008
public static function pregSplitArray(array $list, string $pattern): array
    {
        $slices = [];
        $index = -1;
        foreach ($list as $value) {
            if (preg_match($pattern, $value) === 1) {
                ++$index;
            }

            if ($index !== -1) {
                $slices[$index][] = $value;
            }
        }

        return $slices;
    }
857811
public static function expandList($list) {
		$items = explode(',', $list);
		$list = array();
		foreach ($items as $item) {
			$range = explode('-', $item);
			if (isset($range[1])) {
				$runAwayBrake = 1000;
				for ($n = $range[0]; $n <= $range[1]; $n++) {
					$list[] = $n;

					$runAwayBrake--;
					if ($runAwayBrake <= 0) {
						break;
					}
				}
			} else {
				$list[] = $item;
			}
		}
		return implode(',', $list);
	}
821832
protected function __apiDestroy(array $list)
    {
        $items = HCMenu::select('menu_type_id', 'language_code')->findMany($list);

        HCMenu::destroy($list);

        foreach ( $items as $item ) {
            $item->forgetMenuCache();
        }

        return hcSuccess();
    }
993320
public static function build($list)
    {
        if (is_string($list)) {
            return $list;
        }

        if ($list instanceof self) {
            $list = $list->tokens;
        }

        $ret = '';
        if (is_array($list)) {
            foreach ($list as $tok) {
                $ret .= $tok->token;
            }
        }

        return $ret;
    }
568373
protected function sortByPriority(array $list) : array
    {
        $nonPriorityItems = [];
        $priorityItems = [];

        foreach ($list as $key => $priority) {
            if ($priority == -1) {
                $nonPriorityItems[] = $key;
            } else {
                $priorityItems[$key] = $priority;
            }
        }

        asort($priorityItems);

        return array_merge(array_keys($priorityItems), $nonPriorityItems);
    }
976057
protected function prepareList(array $list)
    {
        foreach ($list as &$item) {
            $item['fields'] = $this->getFieldValues($item['combination_id']);
        }

        return $list;
    }
700455
private function parseAddresses($list) {
        $addresses = [];

        foreach ($list as $item) {
            $address = (object) $item;

            if (!property_exists($address, 'mailbox')) {
                $address->mailbox = false;
            }
            if (!property_exists($address, 'host')) {
                $address->host = false;
            }
            if (!property_exists($address, 'personal')) {
                $address->personal = false;
            }

            $personalParts = imap_mime_header_decode($address->personal);

            $address->personal = '';
            foreach ($personalParts as $p) {
                $address->personal .= $p->text;
            }

            $address->mail = ($address->mailbox && $address->host) ? $address->mailbox.'@'.$address->host : false;
            $address->full = ($address->personal) ? $address->personal.' <'.$address->mail.'>' : $address->mail;

            $addresses[] = $address;
        }

        return $addresses;
    }
235962
protected function prepareListImageStyle(array &$list)
    {
        foreach ($list as $id => &$item) {
            $item['directory_exists'] = is_dir($this->image_style->getDirectory($id));
        }
    }
1209798
protected function prepareListFile(array &$list)
    {
        foreach ($list as &$item) {

            $path = strval(str_replace("\0", "", $item['path']));
            $item['url'] = '';

            if ($path && file_exists(GC_DIR_FILE . '/' . $path)) {
                $item['url'] = $this->url->file($item['path']);
            }
        }
    }
772215
protected function prepareListUser(array &$list)
    {
        $stores = $this->store->getList();

        foreach ($list as &$item) {

            $item['url'] = '';

            if (isset($stores[$item['store_id']])) {
                $item['url'] = $this->store->getUrl($stores[$item['store_id']]) . "/account/{$item['user_id']}";
            }
        }
    }
970278
public function backendListArrayToMultiAssocArray(stdClass $list)
    {
        $ret = array();

        if ( isset($list->ArrayOfString) ) {
            foreach ( $list->ArrayOfString as $a ) {
                if ( is_array($a) ) {      // 1 template only
                    $o         = new StdClass();
                    $o->string = $a;
                } else {                 // 2 or more templates
                    $o = $a;
                }
                unset($a);

                if ( isset($o->string) ) {
                    $date1 = DateTime::createFromFormat(DateTime::RFC1123 , $o->string[ 3 ]);
                    $date2 = DateTime::createFromFormat(DateTime::RFC1123 , $o->string[ 1 ]);
                    $ret[] = array(
                        'filename'   => $o->string[ 0 ] ,
                        'fileSize'   => ( integer ) $o->string[ 2 ] ,
                        'createTime' => ( integer ) $date1->getTimestamp() ,
                        'modifyTime' => ( integer ) $date2->getTimestamp() ,
                    );
                    unset($date1 , $date2);
                }
            }
        }

        return $ret;
    }
105715
private function validateList(array $list)
    {
        foreach ($list as $rule) {
            if (!$this->validateRule($rule)) {
                return false;
            }
        }

        return true;
    }
145709
public function findIn(array $list)
    {
        $list_string = '';
        foreach ($list as $node_id) {
            $list_string .= $node_id.',';
        }

        $list_string = substr($list_string, 0, strlen($list_string) - 1); // обрезка послезней запятой.

        if (false == $list_string) {
            return [];
        }

        return $this->_em->createQuery("
            SELECT n
            FROM CMSBundle:Node AS n
            WHERE n.id IN({$list_string})
            ORDER BY n.position ASC
        ")->getResult();
    }
98788
protected function mapJobs(array $list) {
        return array_map(
            function($element) { return Job::create([
                'queue' => $element[0],
                'id'    => $element[1],
                'body'  => isset($element[2]) ? $element[2] : '',
            ]); },
            $list
        );
    }
1348540
protected function limitList(array &$list, array $limit)
    {
        list($from, $to) = $limit;
        $list = array_slice($list, $from, $to, true);
    }