Inspects the given $items and attempts to resolve them to an iterable collection of items.

@param   mixed   $items
@return  iterable|array
330301
protected function extractItems($items) : iterable
    {
        // Catch arrays and Traversable objects.
        // By extension, this also includes other Collections (via their Iterator) *and* generators.
        // Keep especially the latter in mind when overriding concrete Collections.
        if (is_iterable($items)) {
            return $items;
        }

        // Arbitrary interfaces in order of preference.
        if ($items instanceof core\interfaces\Arrayable) {
            return $items->toArray();
        }

        if ($items instanceof \JsonSerializable) {
            return $items->jsonSerialize();
        }

        if ($items instanceof core\interfaces\Jsonable) {
            return json_decode($items->toJson(), true);
        }

        // Worst case scenario - use PHP's internals to attempt to cast it to an array.
        return (array) $items;
    }
1231080
public function intersect(iterable $items): self
    {
        $items = Factory::getArrayForItems($items);

        return Factory::create(array_intersect($this->items, $items));
    }
1335418
public static function ensureTraversable($items): \Traversable
    {
        if ($items instanceof \Traversable) {
            return $items;
        }

        if (is_array($items)) {
            return self::fromArray($items);
        }

        throw new \InvalidArgumentException('Un-handled argument of type: '.get_class($items));
    }
244671
protected function resolveItems(array &$items)
    {
        $resolver = function ($property) {
            return $this->resolve($property) ?: $property;
        };

        for ($i = 0; $i < count($items); $i++) {
            $items[$i]->fill(array_map($resolver, $items[$i]->getProperties()));
        }
    }
1166136
protected function processItems(array $items)
    {
        $processedItems = [];

        foreach ($items as $entry) {
            $processedItems[] = new Account($entry);
        }

        return $processedItems;
    }
801644
public function setItems($items)
    {
        $this->items = ($items instanceof Collection) ? $items : Collection::make($items);

        return $this;
    }
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);
    }
243816
private static function result($items)
    {
        if ($items instanceof SuggestResult) {
            return $items->toArray();
        }

        $sr = new SuggestResult($items);

        return $sr->toArray();
    }
395025
public function Intersect( $items )
	{

		return $this
					->getClone()
					->setRepository( array_intersect( $this->repository , $items instanceof Queryable ? $items->toArray() : $items ) );

	}
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;
    }
652779
public function setItems(array $items)
    {
        $this->items = $items;
        $this->names = array_keys($items);

        return $this;
    }
470086
protected function denormalize(array $items)
    {
        $shows = [];

        foreach ($items as $show) {
            $show = $this->denormalizeDetailedShow($show);
            $shows[] = $show;
        }

        return $shows;
    }
977892
private static function getArrayFromJSON($items)
    {
        $return = [];
        foreach ($items as $item) {
            if (isset($item->siren)) {
                $return[] = new self(
                    $item->siren,
                    $item->nic,
                    $item->libelleEntreprise->denomination,
                    $item->adresse->lignes,
                    $item->adresse->codePostal,
                    $item->adresse->bureauDistributeur,
                    $item->radie
                );
            }
        }

        return $return;
    }
1173350
public static function make($items)
    {
        if (is_null($items)) {
            return new static;
        }

        if ($items instanceof Collection) {
            return $items;
        }

        return new static(is_array($items) ? $items : [$items]);
    }
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;
    }
1346692
public function getClasses($items)
  {
    $result = [];
    foreach ($items as $item) {
      $result[] = new ClassEntity($item);
    }

    return $result;
  }
941905
protected function prepareArrays(array $items = [])
    {
        $items = array_map(function ($item) {
            return trim($item);
        }, $items);

        return array_filter($items, function ($item) {
            return ! empty($item);
        });
    }