@param array $list
@param array $default

@return array
11277
public function getListOptions(array $list = [], $default = [])
    {
        $options = [];
        foreach ($list as $key => $value) {
            $options[] = [
                'value'        => $key,
                'display-name' => $value,
            ];
            if (is_array($default) && in_array($key,$default)) {
                $indice = count($options) - 1;
                $options[$indice]['selected'] = '';
            }
        };
        return $options;
    }
132488
public function get($key, $default = null): array
    {
        if (!$this->has($key)) {
            if (\is_array($default)) {
                return $default;
            }

            return $default === null ? [] : [$default];
        }

        return $this->headers[Helpers::normalizeHeaderName($key)];
    }
1096237
protected function __apiRestore(array $list)
    {
        HCMenu::whereIn('id', $list)->restore();

        $items = HCMenu::select('menu_type_id', 'language_code')->findMany($list);

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

        return hcSuccess();
    }
381578
public function getArray(string $key, array $default = []): array
    {
        if (\array_key_exists($key, $this->data)) {
            if (\is_array($this->data[$key])) {
                return \array_values($this->data[$key]);
            }
            
            return (array) $this->data[$key];
        }
        
        return (array) $default;
    }
953053
public static function get($array, $key, $default = null)
	{
		if (!static::accessible($array))
			return value($default);

		if (is_null($key))
			return $array;

		if (static::exists($array, $key))
			return $array[(string) $key];


		foreach (static::toKey($key) as $segment) {
			if (static::accessible($array) && static::exists($array, $segment)) {
				$array = $array[$segment];
			} else {
				return value($default);
			}
		}

		return $array;
	}
567033
private function getDefault($reflectionProperty, $default)
    {
        $type = $this->getColumnAnnotation($reflectionProperty);
        if (null === $type) {
            return $default;
        }

        if (true === empty($default) && 'array' === $type) {
            return [];
        }

        return $default;
    }
1056777
public static function get($array, string $key, $default = null)
    {
        if (! Assert::array($array)) {
            return $default;
        }

        $key = trim($key);

        if ($key === '') {
            return $array;
        }

        if (static::exists($array, $key)) {
            return $array[$key];
        }

        foreach (explode('.', $key) as $segment) {
            if (Assert::array($array) && static::exists($array, $segment)) {
                $array = $array[$segment];
            } else {
                return $default;
            }
        }

        return $array;
    }
1317677
public function setDefaultItem($list, $k, $v)
    {
        $this->ensureArrayKeyIsArray($this, $list);

        if (isset($this[$list][$k])) {
            return $this;
        }

        $this[$list][$k] = $v;

        return $this;
    }
15804
private function getOptions(array $list)
    {
        // To be returned
        $elements = array();

        foreach ($list as $value => $text) {
            array_push($elements, $this->createOptionNode($value, $text));
        }

        return $elements;
    }
92890
public static function defaults(array $arr = null, array $defaults): array
    {
        if ($arr === null) {
            return $defaults;
        }
        foreach ($defaults as $key => $value) {
            if (!isset($arr[$key])) {
                $arr[$key] = $value;
            }
        }
        return $arr;
    }
851762
public static function normalize(array $array, $default): array
    {
        $normalized = [];

        foreach ($array as $key => $value) {
            if (is_numeric($key)) {
                $key = $value;
                $value = $default;
            }

            $normalized[$key] = $value;
        }

        return $normalized;
    }
3573
protected function prepareListProduct(array &$list)
    {
        foreach ($list as &$item) {
            $this->setItemPriceFormatted($item, $this->price);
            $this->setItemUrlEntity($item, $this->store, 'product');
        }
    }
480570
public function getArray($key, array $default = array())
    {
        $value = $this->get($key, null);

        return null !== $value ? (array) $value : (array) $default;
    }
1097422
public static function make($name, $list, $default = [], array $options = [])
    {
        $name .= '[]';
        $select = new static();
        $multiSelect = [
            'multiple' => 'multiple',
        ];
        $options = $select->setDefaultAttr(array_merge($multiSelect, $options), $name);

        $list = $select->getListOptions($list, $default);

        return $select->select($list, $options);
    }
1326305
protected function arrayGet($key, $default = null)
    {
        if (isset($this->list[$key])) {
            return $this->list[$key];
        }

        foreach (explode('.', $key) as $segment) {
            if (! is_array($this->list) || ! array_key_exists($segment, $this->list)) {
                return (is_callable($default)) ? $default() : $default;
            }

            $this->list = $this->list[$segment];
        }

        return $this->list;
    }
119724
public static function sGet($array, $key, $default = null)
    {
        $value = self::get($array, $key);
        return !empty($value) ? $value : $default;
    }
35460
public static function get($array, $key, $default = null)
    {
        $key = static::normalizeKey($key);

        if ($key === null || $key === '')
        {
            return $array;
        }

        $keys = explode('.', $key);
        $currentElement = $array;

        foreach ($keys as $currentKey)
        {
            if (!is_array($currentElement) || !array_key_exists($currentKey, $currentElement))
            {
                return $default;
            }

            $currentElement = $currentElement[(string) $currentKey];
        }

        return $currentElement;
    }