Denormalize shows

@param array $items
@return array
@throws UnimplementedAttributeException
507636
protected function denormalize(array $items)
    {
        $shows = [];

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

        return $shows;
    }
147051
protected function getArrayableItems($items)
    {
        if (is_array($items)) {
            return $items;
        }
        if ($items instanceof self) {
            return $items->all();
        }
        if (is_object($items) && method_exists($items, 'toArray')) {
            return $items->toArray();
        }
        if (is_object($items) && method_exists($items, 'toJson')) {
            return json_decode($items->toJson(), true);
        }
        if ($items instanceof JsonSerializable) {
            return $items->jsonSerialize();
        }
        if ($items instanceof Traversable) {
            return iterator_to_array($items);
        }

        return (array) $items;
    }
525988
public function append($items)
    {
        return new ResultScan(array_merge($this->buffered()->toArray(), $this->parseItems($items)));
    }
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;
    }
447915
public function process(array $items)
    {
        foreach ($items as $key => $item) {
            $items[$key] = $this->setImages($item);
        }

        return $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;
    }
1105582
public function denormalize(array $data): FixtureBag
    {
        $fixtures = new FixtureBag();

        $alreadyRetried = [];
        while ($result = array_splice($data, 0, 1)) {
            $fqcnWithFlags = key($result);
            $rawFixtureSet = current($result);

            $flags = $this->flagParser->parse($fqcnWithFlags);
            $fqcn = $flags->getKey();

            if (false === is_array($rawFixtureSet)) {
                throw new InvalidArgumentException(
                    sprintf(
                        'Expected an array for the class "%s", found "%s" instead.',
                        $fqcnWithFlags,
                        gettype($rawFixtureSet)
                    )
                );
            }
            try {
                foreach ($rawFixtureSet as $reference => $specs) {
                    if (null === $specs) {
                        $specs = [];
                    }

                    $fixtures = $this->fixtureDenormalizer->denormalize(
                        $fixtures,
                        $fqcn,
                        $reference,
                        $specs ?? [],
                        $flags
                    );
                }
            } catch (UnexpectedValueException $exception) {
                if (!isset($alreadyRetried[$fqcnWithFlags])) {
                    $data[$fqcnWithFlags] = $rawFixtureSet;
                    $alreadyRetried[$fqcnWithFlags] = true;
                } else {
                    throw $exception;
                }
            }
        }

        return $fixtures;
    }
118042
protected function itemsArray($items): array
    {
        if (is_array($items)) {
            return $items;
        } elseif ($items instanceof self) {
            return $items->all();
        } elseif ($items instanceof Arrayable) {
            return $items->toArray();
        }

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

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

        $this->items = new ModelCollection($processedItems);
    }
1110967
public static function flatten($array = [])
    {
        $items = [];
        foreach ($array as $value) {
            if (is_array($value)) {
                $items = array_merge($items, self::flatten($value));
            } else {
                $items[] = $value;
            }
        }
        return $items;
    }
97090
public static function transmute($items)
    {
        if (is_array($items)) {
            return $items;
        } elseif ($items instanceof Collection) {
            return $items->all();
        }

        return (array) $items;
    }
1286313
public static function toResults(array $items) {

        $output = [];

        foreach ($items as $current) {

            if (false === ($current instanceof Select2ItemInterface)) {
                throw new InvalidArgumentException("The item must implements Select2ItemInterface");
            }

            $output[] = [
                "id"   => $current->getSelect2ItemId(),
                "text" => $current->getSelect2ItemText(),
            ];
        }

        return $output;
    }
482907
public function items($items)
    {
        $items = !is_array($items) ? $items->all() : $items;
        $this->message['items'] = $items;
        return $this;
    }
1040285
public function merge($items)
    {
        if ($items instanceof ArrayInterface) {
            $this->items = array_merge($this->items, $items->all());
        } else {
            $this->items = array_merge($this->items, $items);
        }

        return $this;
    }
591148
protected function setAuthorAttribute($items)
    {
        if (is_array($items) === false) {
            return $items;
        }

        return array_map(function ($item) {
            return $this->getNestedContext(Person::class, $item);
        }, $items);
    }
205507
public static function toCollections(array $items): array
    {
        foreach ($items as $k => $item) {
            $items[$k] = new static($item);
        }

        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);
    }