Resolve item type from the markup.

@return void
355134
public function resolveLinkAndTitle()
    {
        $regrex = "/(?:href=['\"](?<link>.+)['\"])?(?:>(?<title>.+)<)/";

        preg_match($regrex, $this->markup, $matches);

        $this->link = $matches['link'];
        $this->title = $matches['title'];
    }
476837
public function __item($item = null)
    {
        $result = parent::__item($item);
        $result['content'] = true;
        return $result;
    }
1120083
public function getType() : ?string
    {
        if (null === $this->type) {
            $success = null;

            try {
                $type = $this->getItem('browscap.type', false, $success);
            } catch (InvalidArgumentException $e) {
                $this->logger->error(new \InvalidArgumentException('an error occured while reading the data type from the cache', 0, $e));
                $type = null;
            }

            if (null !== $type && $success) {
                $this->type = $type;
            }
        }

        return $this->type;
    }
874943
protected function getTypeItems()
	{
		$typeManager = \Aimeos\MShop::create( $this->getContext(), 'service/type' );

		$search = $typeManager->createSearch( true )->setSlice( 0, 10000 );
		$search->setSortations( [$search->sort( '+', 'service.type.position' )] );

		return $this->map( $typeManager->searchItems( $search ) );
	}
666967
private function resolveDisplayType()
    {
        $type = null;

        /** Attempt display type resolution without instantiating the property, at first. */
        $metadata = $this->propertyData();
        if ($metadata) {
            if (isset($metadata['display_type'])) {
                $type = $metadata['display_type'];
            }
        }

        if ($this->propertyType || $this->property) {
            $type = $this->property()->displayType();
        }

        return $type;
    }
796817
public function automaticItemType($data)
	{
		if (isset($data['item_type']))
		{
			$data['item_type'] = strtolower(preg_replace("/[^a-zA-Z0-9\-]/", '', trim($data['item_type'])));
		}

		return $data['item_type'];
	}
1136376
protected function cacheLinkTypeItems()
    {
        $links = [];
        foreach ($this->items as $item) {
            if ($item->getFormat() == LinkType::FORMAT) {
                $links[] = $item;
            }
        }
        $this->links = new ItemList($links);
    }
843728
public function itemValue() {
    $itemprop = $this->itemProp();
    if (empty($itemprop))
      return null;
    if ($this->itemScope()) {
      return $this;
    }
    switch (strtoupper($this->tagName)) {
      case 'META':
        return $this->getAttribute('content');
      case 'AUDIO':
      case 'EMBED':
      case 'IFRAME':
      case 'IMG':
      case 'SOURCE':
      case 'TRACK':
      case 'VIDEO':
        // @todo Should this test that the URL resolves?
        return $this->getAttribute('src');
      case 'A':
      case 'AREA':
      case 'LINK':
        // @todo Should this test that the URL resolves?
        return $this->getAttribute('href');
      case 'OBJECT':
        // @todo Should this test that the URL resolves?
        return $this->getAttribute('data');
      case 'DATA':
        return $this->getAttribute('value');
      case 'TIME':
        $datetime = $this->getAttribute('datetime');
        if (!empty($datetime))
          return $datetime;
      default:
        return $this->textContent;
    }
  }
642977
public function getItemsGroupedByTypes(): array
    {
        if (is_array($this->itemsGroupedByTypeCache)) {
            return $this->itemsGroupedByTypeCache;
        }

        $items = $this->getItems();
        $itemsGroupedByType = [];
        foreach ($items as $item) {
            if (!isset($itemsGroupedByType[$item->getType()])) {
                $itemsGroupedByType[$item->getType()] = [];
            }
            $itemsGroupedByType[$item->getType()][] = $item;
        }

        $this->itemsGroupedByTypeCache = $itemsGroupedByType;

        return $itemsGroupedByType;
    }
710083
protected function resolve()
	{
		$key = $this->templatesFile . '.' . $this->source;

		if (Lang::has($key)) {
			return Lang::get($key);
		}

		return $this->default();
	}
786213
protected function _validateItem()
    {
        if ($this->valid()) {
            if ($this->hasChildren() && $this->getDirectoryValidationCallback()) {
                $this->_validate($this->getDirectoryValidationCallback());
            } elseif (is_file($this->getRealPath()) && $this->getFileValidationCallback()) {
                $this->_validate($this->getFileValidationCallback());
            }
        }
    }
435209
public function displayType()
    {
        if ($this->displayType === null) {
            $this->displayType = $this->resolveDisplayType();
        }

        return $this->displayType;
    }
112273
public function getTypes()
    {
        return array_reduce(
            $this->_models,
            function ($result, $item) {
                $result[$item['type']] = $item['type'];
                return $result;
            },
            []
        );
    }
1083782
public function getAllElements()
	{
		if ( $this->context->isExtensionTaxonomy() )
		{
			$prefix = $this->getPrefix();
			return array_map( function( $item ) use ( $prefix ) { $item['prefix'] = $prefix; return $item; }, $this->elementIndex );
		}

		$result = array();
		foreach ( $this->context->importedSchemas as $namespace => $taxonomy )
		{
			$elements = $taxonomy->getElements();
			if ( ! $elements ) continue; // Don't attempt to merge if there are no element and it take time
			$prefix = $taxonomy->getPrefix();
			$elements = array_map( function( $item ) use ( $prefix ) { $item['prefix'] = $prefix; return $item; }, $elements );
			$result = array_merge( $result, $elements );
		}
		return $result;
	}
177704
public function resolve()
    {
        $this->data = [
            'environment' => php_sapi_name(),
            'process-id' => $this->process->getId(),
            'parent-process-id' => $this->process->getParentId(),
            'date' => date('Y-m-d'),
            'time' => date('H:m:s'),
            'timestamp' => time()
        ];
    }
929979
public function resolve(): array
    {
        $file = sprintf($this->template, $this->typeResolver->resolve());

        if (!file_exists($file)) {
            $file = sprintf($this->template, 'default');
        }

        return json_decode(file_get_contents($file), true);
    }
235934
protected function isCorrectType($item)
    {
        if (is_null($this->type)) {
            return true;
        }

        if ($this->type !== 'object' && is_object($item)) {
            return $item instanceof $this->type;
        }

        return gettype($item) === $this->type;
    }