Sanity check items being passed into constructor.

@since 1.0.0

@param  mixed $items The items being added to the collection.
@return array
172618
protected function getItems($items)
    {
        if (\is_array($items)) {
            return $items;
        } elseif ($items instanceof self) {
            return $items->all();
        } elseif ($items instanceof Traversable) {
            return \iterator_to_array($items);
        }
        return (array) $items;
    }
1016770
public function fromItems(array $items): array
    {
        $objects = [];
        foreach ($items as $item) {
            $objects[] = $this->fromItem($item);
        }

        return $objects;
    }
463669
protected function getItemsAsArray($items)
    {
        if (is_array($items)) {
            return $items;
        } elseif ($items instanceof self) {
            return $items->all();
        } elseif ($items instanceof Traversable) {
            return iterator_to_array($items);
        }

        return (array) $items;
    }
87956
protected function processItems(array $items)
    {
        $processedItems = [];

        foreach ($items as $entry) {
            $processedItems[] = ModelFactory::make($entry);
        }

        $this->items = new ModelCollection($processedItems);
    }
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;
    }
935933
protected function setItemListElementAttribute($items)
    {
        foreach($items as $pos=>$item) {
            $items[$pos] = $this->getNestedContext(ListItem::class, [
                'position' => $pos + 1,
                'item' => $item
            ]);
        }

        return $items;
    }
863606
public function containsAll($items)
    {
        $values = $this->getValues();
        foreach($items as $item)
        {
            if (!in_array($item, $values, true))
            {
                return false;
            }
        }
        return true;
    }
228466
public function add($items)
    {
        if (is_array($items)) {
            $this->collection[] = new Delta($items);
        } elseif (is_object($items) && $items instanceof Delta) {
            $this->collection[] = $items;
        }

        return $this;
    }
1058453
public function items(array $items)
    {
        foreach ($items as $uri => $title) {
            list($title, $uri, $liAttr) = $this->fixData($uri, $title);
            $this->item($title, $uri, $liAttr);
        }
        return $this;
    }
238285
public function setItems($items)
    {
        if (! is_array($items)) {
            $items = func_get_args();
        }

        $this->addBody($items);

        return $this;
    }
136069
public function getOrderedArray($items = [])
    {
        $ordered = [];
        if (empty($items)) {
            $items = $this->_menuItems;
        }

        foreach ($items as $item) {
            $ordered[] = $item;
        }

        $ordered = Hash::sort($ordered, '{n}.priority', 'ASC');

        foreach ($ordered as &$item) {
            if (isset($item['children']) && !empty($item['children'])) {
                $item['children'] = $this->getOrderedArray($item['children']);
            }
        }

        return $ordered;
    }
652779
public function setItems(array $items)
    {
        $this->items = $items;
        $this->names = array_keys($items);

        return $this;
    }
83894
public function add( ...$items )
	{
		foreach ( $items as &$item ) $item = (array)$item;
		$this->items = array_merge( $this->items , ...$items );
		return $this;
	}
887033
public function loadFromArray(array $items)
    {
        foreach ($items as $item) {
            if (is_array($item) && ! empty($item)) {
                $this->add($item);
            }
        }

        return $this;
    }
691990
public function createMany(array $items)
    {
        $models = collection();

        foreach ($items as $item) {
            $models[] = $this->create($item);
        }

        return $models;
    }
1197095
public function check(array $items, array $rules)
    {
        $this->_items = $items;
        foreach ($items as $item => $value) {
            if (array_key_exists($item, $rules)) {
                $this->validate($item, $value, $rules[$item]);
            }
        }
        
        return $this;
    }
243816
private static function result($items)
    {
        if ($items instanceof SuggestResult) {
            return $items->toArray();
        }

        $sr = new SuggestResult($items);

        return $sr->toArray();
    }