Convert the JSON list returned by infogreffe.fr
to an array of Infogreffe objects.

@param array $items Items returned by infogreffe.fr

@return array Array of Infogreffe objects
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;
    }
447915
public function process(array $items)
    {
        foreach ($items as $key => $item) {
            $items[$key] = $this->setImages($item);
        }

        return $items;
    }
1066839
public function prepareItems($items)
    {
        if (!is_array($items)) {
            return $items;
        } elseif (self::isAssoc($items)) {
            $items = $this->prepareItem($items);
        } else {
            foreach ($items as $key => $item) {
                $items[ $key ] = $this->prepareItem($item);
            }
        }
        return $items;
    }
534631
protected function transformContainers(array $items)
    {
        if (!count($items)) {
            return [];
        }

        $containers = [];

        foreach ($items as $item) {
            $container = new Container($this->api, $this->uploader, $item['name'], $item);
            $containers[$container->name()] = $container;
        }

        return $containers;
    }
720490
private function _removeSameAll(array $items) : array
    {
        $values = $this->getValues();
        foreach($values as $key => $value)
        {
            foreach($items as $item)
            {
                if ($item === $value)
                {
                    unset($values[$key]);
                }
            }
        }
        $values = array_values($values);
        return $values;
    }
64893
private function parseArrayToCatalogFieldEntities(array $items)
    {
        $entities = [];
        foreach ($items as $elementType => $catalogItems) {
            $entities = array_merge($entities, $this->parseArrayToFieldEntities($catalogItems, $elementType));
        }
        return $entities;
    }
28790
public function _unshiftAll(array $items) : array
    {
        $values = $this->getValues();
        foreach($items as $item)
        {
            array_unshift($values, $item);
        }
        return $values;
    }
1166136
protected function processItems(array $items)
    {
        $processedItems = [];

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

        return $processedItems;
    }
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]);
    }
278104
public static function order($items) {
		if (empty($items)) {
			return array();
		}

		$_items = array_combine(array_keys($items), Hash::extract($items, '{s}.weight'));
		asort($_items);

		foreach (array_keys($_items) as $key) {
			$_items[$key] = $items[$key];
		}

		return $items;
	}
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);
    }
402052
public function renderItems($items)
    {
        $graph = [];

        // loop over subjects
        foreach ($items as $subjectURI => $subjectStatements) {
            $subject = ['@id' => $this->prefixedName($subjectURI)];

            // loop over predicates
            foreach ($subjectStatements as $predicateURI => $objects) {
                // loop over objects
                foreach ($objects as $objectString => $properties) {
                    if (null === $properties) {
                        $object = $this->prefixedName($objectString);
                    } else {
                        $object = ['@value' => $objectString];

                        if ($properties['language']) {
                            $object['@language'] = $properties['language'];
                        }
                        if ($properties['type']) {
                            $object['@type'] = $properties['type'];
                        }
                    }

                    $predicateURI = $this->prefixedName($predicateURI);
                    if ($subject[$predicateURI]) {
                        if (is_array($subject[$predicateURI])) {
                            $subject[$predicateURI][] = $object;
                        } else {
                            $subject[$predicateURI] = [$subject[$predicateURI], $object];
                        }
                    } else {
                        $subject[$predicateURI] = $object;
                    }
                }
            }

            $graph[] = $subject;
        }

        // Add the prefixes as the @context.
        $context = [];
        foreach (array_keys($this->usedPrefixes) as $prefix) {
            if ($this->prefixes[$prefix]) {
                $context[$prefix] = $this->prefixes[$prefix];
            }
        }

        return json_encode([
            '@context' => $context,
            '@graph' => $graph,
        ]);
    }
363783
protected function getLabelsFromArray(array $items)
    {
        $labels = [];

        foreach ($items as $key => $label) {
            $lang = empty($key) || is_numeric($key) ? $this->defaultLang : $key;
            $labels[] = new Label($label, $this->localeGroup, false, $lang);
        }

        return $labels;
    }
435640
private function createModelCollectionFromActions(array $actions, array &$items)
    {
        $models = new DefaultCollection();
        foreach ($actions as $action) {
            $models->push($action['model']);
            $items[] = $action['item'];
        }

        return $models;
    }
275062
protected function filterItems(array $items)
    {
        $data = [];

        foreach ($items as $item) {
            $item = trim($item);

            if (empty($item)) {
                continue;
            }

            $item = $this->removeChar($item, '[', ']');

            if ($this->itemIsSerialized($item)) {
                $data[] = unserialize($item);
                continue;
            }

            if (strpos($item, '=>') !== false) {
                $element = explode('=>', $item);
                $element[0] = trim($element[0]);
                $element[1] = trim($element[1]);

                $key = $this->removeChar($element[0], ['"', "'"], ['"', "'"]);
                $val = $this->removeChar($element[1], ['"', "'"], ['"', "'"]);

                $data[$key] = $val;
            } else {
                $data[] = $this->removeChar($item, ['"', "'"], ['"', "'"]);
            }
        }

        return $data;
    }
97090
public static function transmute($items)
    {
        if (is_array($items)) {
            return $items;
        } elseif ($items instanceof Collection) {
            return $items->all();
        }

        return (array) $items;
    }
585933
protected function sort(array $items) : array
    {
        if (count($items) > 1)
        {
            usort($items, function(&$a, &$b)
            {
                $getterName = $this->getterName;

                $compare = mb_strtolower($a['item']->$getterName()) > mb_strtolower($b['item']->$getterName());

                if ($this->criteria === Criteria::ASC)
                {
                    return $compare;
                }

                return !$compare;
            });
        }

        return $items;
    }