@param array $items

@return array
8227
public function filter(array $items): array
    {
        foreach ($this->filter as $filter) {
            $items = $filter->filter($items);
        }

        return $items;
    }
1166186
public function getVisits($items)
  {
    $result = [];
    foreach ($items as $item) {
      $result[] = new Visit($item);
    }

    return $result;
  }
347861
private function loadModels(array $items)
    {
        $classes = [];
        $results = [];

        // Retrieve a list of keys to load from each class.
        foreach ($items as $item) {
            if (!is_null($item['key'])) {
                $classes[$item['class']][] = $item['key'];
            }
        }

        // Iterate list of classes and load all records matching a key.
        foreach ($classes as $class => $keys) {
            $model = new $class();
            $results[$class] = $model->whereIn($model->getKeyName(), $keys)->get()->keyBy($model->getKeyName());
        }

        return $results;
    }
465480
protected function prepareTableRows($items) {
        $tableRows = [];
        foreach ($items as $key => $value) {
            if (is_object($value) && method_exists($value, '__toString')) {
                $value = (string) $value;
            } elseif (is_array($value) || is_object($value)) {
                $value = Yaml::dump($value);
            } elseif (is_bool($value)) {
                $value = ($value) ? 'TRUE' : 'FALSE';
            }
            $tableRows[] = [$key, $value];
        }
        return $tableRows;
    }
1186878
public function zip(...$items): ArrayCollection
    {
        $arrayItems = array_map(function ($items) {
            return $this->itemsArray($items);
        }, $items);

        $params = array_merge([function (...$items) {
            return new static($items);
        }, $this->items], $arrayItems);

        return new static(call_user_func_array('array_map', $params));
    }
789595
public function filter(array $items): array
    {
        $filtered = [];

        foreach ($items as $sectionName => $sectionDefinition) {
            $isExcluded = true;
            if ($this->shouldSectionBeAdded($sectionName, $sectionDefinition)) {
                $isExcluded = false;
            }
            $sectionDefinition[static::EXCLUDED] = $isExcluded;
            $filtered[$sectionName] = $sectionDefinition;
        }

        return $filtered;
    }
990029
protected function map( array $items )
	{
		$list = [];

		foreach( $items as $item ) {
			$list[$item->getCode()] = $item;
		}

		return $list;
	}
721318
protected function renderItems($items)
	{
		$script = '';
		foreach ($items as $key => $item)
		{
			if(is_array($item))
			{
				$script = $script."'$key':[";
				foreach ($item as $value)
					$script = $script."'$value',";
				$script = $script."],";
			} else
				$script = $script."'$key':'$item',";
		}
		return $script;
	}
644167
protected function sortItems(array $items, &$max = 0): array
    {
        $max = \max(\array_map(function ($item) {
            return \strlen($this->getName($item));
        }, $items));

        \uasort($items, function ($a, $b) {
            /* @var Parameter $b */
            /* @var Parameter $a */
            return $a->name() <=> $b->name();
        });

        return $items;
    }
980950
public function unshiftAll(array $items) : ArrayList
    {
        $values = $this->_unshiftAll($items);
        $this->setValues($values);
        return $this;
    }
1305646
public function countItems($items)
    {
        if ($this->_count) {
            return $this->_count;
        }
        $this->_count($items);

        return $this->_count;
    }
547923
public static function parameters(array $items)
    {
        $parameters = array();
        $items = array_filter(Arr::flatten($items));

        foreach ($items as $item) {
            $itemParams = $item->getParameters();

            if ($itemParams !== null) {
                $parameters []= $itemParams;
            }
        }

        return Arr::flatten($parameters);
    }
1346692
public function getClasses($items)
  {
    $result = [];
    foreach ($items as $item) {
      $result[] = new ClassEntity($item);
    }

    return $result;
  }
402243
public function process(array $items)
    {
        foreach ($items as $key => $item) {
            $items[$key] = $this->fixPaths($item);
        }

        return $items;
    }
440475
public static function menuToRules($items)
    {
        $rules = [];
        foreach ($items as $item) {
            $url = ArrayHelper::getValue($item, 'url');
            $urlRule = ArrayHelper::getValue($item, 'urlRule');

            if ($url && $urlRule && is_array($url)) {
                $defaults = $url;
                $route = array_shift($defaults);

                if (is_string($urlRule)) {
                    $rules[] = [
                        'pattern' => Yii::getAlias($urlRule),
                        'route' => $route,
                    ];
                } elseif (is_array($urlRule)) {
                    if (!isset($urlRule['route'])) {
                        $urlRule['route'] = $route;
                    }
                    $rules[] = $urlRule;
                }
            }

            $subItems = ArrayHelper::getValue($item, 'items');
            if (is_array($subItems)) {
                $rules = array_merge(static::menuToRules($subItems), $rules);
            }
        }
        return $rules;
    }
590161
public function getDataByItems(array $items)
    {
        $output = [];
        foreach ($items as $item) {
            try {
                $output[] = $this->getDataByItem($item);
            } catch (ExtractorException $e) {
                \common_Logger::e('ERROR on item ' . $item->getUri() . ' : ' . $e->getMessage());
            }
        }

        if (empty($output)) {
            throw new ExtractorException('No data item to export.');
        }

        return $output;
    }
24702
public function process(array $items)
    {
        if (!$this->limit) {
            return $items;
        }
        $total = count($items);
        if ($this->limit > $total) {
            return $items;
        }
        for ($i = $this->limit; $i < $total; $i++) {
            if (isset($items[$i])) {
                unset($items[$i]);
            }
        }

        return $items;
    }