@param array $item

@return array

@throws \craft\errors\SiteNotFoundException
328429
public function parse(array $item): array
    {
        foreach ($item['siteSettings'] as $settingKey => $settings) {
            $siteSettings = new Section_SiteSettings(array_merge($settings, [
                'siteId' => isset($settings['siteId']) ? Craft::$app->sites->getSiteByHandle($settings['siteId'])->id : Craft::$app->sites->getPrimarySite()->id,
            ]));
            if (isset($siteSettings['hasUrls']) && (bool) $siteSettings['hasUrls'] === false) {
                $siteSettings['uriFormat'] = null;
            }
            $item['siteSettings'][$settingKey] = $siteSettings;
        }
        $section = new Section($item);

        return [$section, null];
    }
184979
public function writeItem(array $item)
    {
        $newNode = $this->xml->createElement($this->rowNodeName);

        //attributes
        if (isset($item['@attributes']) && is_array($item['@attributes'])) {
            foreach ($item['@attributes'] as $key => $value) {
                $attr = $this->xml->createAttribute($key);
                $attr->value = $value;
                $newNode->appendChild($attr);
            }
            unset($item['@attributes']);
        }

        //values
        foreach ($item as $key => $value) {
            $node = $this->xml->createElement($key);
            $node->nodeValue = $value;
            $newNode->appendChild($node);
        }

        $this->rootNode->appendChild($newNode);

        return $this;
    }
1186854
protected function renderItem($item = [])
    {
        $tag = ArrayHelper::getValue($item, 'tag', 'div');
        $content = ArrayHelper::getValue($item, 'content', '');
        $options = ArrayHelper::getValue($item, 'options', []);
        $options = ArrayHelper::merge($this->itemOptions, $options);

        Html::addCssClass($options, ['item' => 'carousel-item']);

        return Html::tag($tag, $content, $options);
    }
689295
protected function renderItem($item = [])
    {
        $itemOptions = ArrayHelper::getValue($item, 'options', []);

        $headerOptions = ArrayHelper::getValue($item, 'header', []);
        $headerContent = ArrayHelper::remove($headerOptions, 'content');
        $headerTag = ArrayHelper::remove($headerOptions, 'tag', 'div');

        $bodyOptions = ArrayHelper::getValue($item, 'body', []);
        $bodyContent = ArrayHelper::remove($bodyOptions, 'content', []);
        $bodyTag = ArrayHelper::remove($bodyOptions, 'tag', 'div');

        if (!$headerContent && !$bodyContent) {
            return '';
        }

        $html[] = Html::beginTag('li', $itemOptions);
        if ($headerContent) {
            Html::addCssClass($headerOptions, ['header' => 'collapsible-header']);
            $html[] = Html::tag($headerTag, $headerContent, $headerOptions);
        }
        if ($bodyContent) {
            Html::addCssClass($bodyOptions, ['body' => 'collapsible-body']);
            $html[] = Html::tag($bodyTag, $bodyContent, $bodyOptions);
        }
        $html[] = Html::endTag('li');

        return implode("\n", $html);
    }
331284
private function importItem(array $item)
    {
        if (!$this->converter->supports($item)) {
            throw new ConverterNotFoundException($item);
        }

        $entity = $this->converter->convert($item);
        $this->writer->write($entity);

        return $entity;
    }
122372
private function getFormattedItem(Item $item)
    {
        $data = [
            'type'       => $this->getFormattedName($item->getTransformer()),
            'id'         => $item->getData()->id,
            'attributes' => $item->sanitize(),
        ];

        if ($links = $item->getLinks()) {
            $data['links'] = $links;
        }

        return $data;
    }
794223
public function getItemUrl($item)
    {
        $item = $this->getItem($item);
        return $item ? $item->normalizedUrl : null;
    }
42768
private function unmarshal(array $item)
    {
        if ($item === null) {
            return null;
        }

        $map = [MapType::$dynamoKey => $item];

        return Type::convertUnmappedToPHPValue($map);
    }
321036
private function lookupRecursive($item)
    {
        if (is_array($item)) {
            $collection = [];
            foreach ($item as $k => $v) {
                $collection[$k] = $this->lookupRecursive($v);
            }

            return $collection;
        }

        return $this->lookup($item);
    }
675216
public static function method(array $item): string
    {
        if (empty($item['function'])) {
            return '';
        }
        $method = $item['function'];
        if (!empty($item['class'])) {
            $type = (empty($item['type']) ? '->' : $item['type']);
            $class = $item['class'].$type;
        } else {
            $class = '';
        }
        $args = isset($item['args']) ? $item['args'] : [];
        foreach ($args as &$arg) {
            $arg = self::arg($arg);
        }
        unset($arg);
        return $class.$method.'('.implode(', ', $args).')';
    }
951039
protected function recursiveToArray($item)
    {
        if (is_array($item)) {

            foreach ($item as &$subitem) {
                $subitem = $this->recursiveToArray($subitem);
            }

            unset($subitem);

            return $item;
        }

        if ($item instanceof Arrayable) {
            return $item->toArray();
        }

        return $item;
    }
432632
protected function findOrCreateItem(array $item)
    {
        $entity = null;
        // If the table was not truncated to begin with, find current entity
        // first
        if (false === $this->truncate) {
            if (!empty($this->lookupFields)) {
                $lookupConditions = array();
                foreach ($this->lookupFields as $fieldName) {
                    $lookupConditions[$fieldName] = $item[$fieldName];
                }
                $entity = $this->entityRepository->findOneBy(
                    $lookupConditions
                );
            } else {
                $entity = $this->entityRepository->find(current($item));
            }
        }

        if (!$entity) {
            return $this->getNewInstance();
        }

        return $entity;
    }
992926
public function getCatalogItem(array $item)
    {
        $sources = [$this->browser->getHost().$item['url']];
        if (!empty($item['world_art_id'])) {
            $sources[] = str_replace('#ID#', $item['world_art_id'], self::WORLD_ART_URL);
        }
        if (!empty($item['myanimelist_id'])) {
            $sources[] = str_replace('#ID#', $item['myanimelist_id'], self::MY_ANIME_LIST_URL);
        }
        if (!empty($item['ani_db_id'])) {
            $sources[] = str_replace('#ID#', $item['ani_db_id'], self::ANI_DB_URL);
        }
        /* @var $source \AnimeDb\Bundle\CatalogBundle\Entity\Source|null */
        $source = $this->repository->findOneBy(['url' => $sources]);
        if ($source instanceof Source) {
            return $source->getItem();
        }
        return null;
    }
184916
public function getMessages($item = null)
    {
        if (is_string($item)) {
            return array_key_exists($item, $this->messages) ? $this->messages[$item] : array();
        }

        return $this->messages;
    }
1242551
public function getDeleteUrlFor($item)
    {
        $params = array('id' => $item['id']);
        $params = array_merge($params, $this->getExtraParameters());

        return array(
            'path' => $this->getPathByConvention($this::SUFFIX_DELETE),
            'params' => $params,
        );
    }
293020
public function getViewUrlFor($item)
    {
        if (is_object($item)) {
            $id = $item->getid();
        } else {
            $id = $item['id'];
        }
        $params = ['id' => $id];
        $params = array_merge($params, $this->getExtraParameters());

        return [
            'path' => $this->getPathByConvention($this::SUFFIX_VIEW),
            'params' => $params,
        ];
    }
764824
private function _autoFilter($item)
	{
		# NULL
		if(null === $item) { return null; }

		# WHAT ELSE
		if(is_object($item) || is_resource($item)) {
			return $item;
		}

		# BOOL
		if(is_bool($item) || $item === 'false' || $item === 'true') {
			if($item === 'false') { $item = false; }
			elseif($item === 'true') { $item = true; }
			return $item;
		}

		# ARRAY
		if(is_array($item)) {
			foreach ($item as $k => $v) {
				$item[$k] = $this->_autoFilter($v);
			}
			return $item;
		}

		# INT
		$int = filter_var($item, FILTER_VALIDATE_INT);
		if($int !== false) { return $int; }

		# FLOAT
		if(preg_match('#^([\+\-])?(?!0[0-9]+)[0-9]+\.[0-9]+$#', $item)) {
			return floatval($item);
		}

		# STRING
		return filter_var($item, FILTER_SANITIZE_SPECIAL_CHARS);
	}