@param Element|Picture $element

@return string
173474
public static function sources(Element $element)
    {
        $html = '';
        foreach ($element->html() as $attributes) {
            $attributes['srcset'] = is_callable($attributes['srcset'])
                ? $attributes['srcset']($element->image()['src'] ?? '')
                : ($element->image()['src'] ?? '');
            $html                 .= Render::tag('source', $attributes, null, Render::FILTER_NULL);
        }

        $html .= Render::tag('img', $element->image(), null, Render::FILTER_NULL);

        return $html;
    }
437721
public function addElement(Element $element)
    {
        if (!in_array($element, $this->elements, true)) {
            array_push($this->elements, $element);
        }
        return $this;
    }
72238
public function element(String $element, String $str = NULL, Array $attributes = []) : String
    {
        return $this->_multiElement($element, $str, $attributes);
    }
102834
private function elementBodyClasses(string $element) : string
    {
        if (in_array($element, $this->body_elements) === true) {
            $class = '';

            if (count($this->body_classes[$element]) > 0) {
                if (array_key_exists($element, $this->body_classes_first) === false) {
                    $class = ' ' . implode(' ', $this->body_classes[$element]);
                } else {
                    $class = '';
                    foreach ($this->body_classes[$element] as $body_class) {
                        if (array_key_exists($body_class, $this->body_classes_first[$element]) === false) {
                            $class .= ' ' . $body_class;
                        } else {
                            if ($this->body_classes_first[$element][$body_class] === true) {
                                $class .= ' ' . $body_class;
                                $this->body_classes_first[$element][$body_class] = false;
                            }
                        }
                    }
                }
            }

            return $class;
        } else {
            return '';
        }
    }
891199
public function renderElement($element)
    {
        if (is_string($element)) {
            if (($e = $this[$element]) === null && ($e = $this->getButtons()->itemAt($element)) === null) {
                return $element;
            } else {
                $element = $e;
            }
        }
        if ($element->getVisible()) {
            if ($element instanceof CFormInputElement) {
                if ($element->type === 'hidden') {
                    return TbHtml::tag('div', array('class' => 'hidden'), $element->render());
                }
            }
            return $element->render();
        }
        return '';
    }
973173
private function elementClasses(string $element) : string
    {
        if (in_array($element, $this->elements) === true) {
            $class = '';

            if (count($this->classes[$element]) > 0) {
                $class = ' ' . implode(' ', $this->classes[$element]);
            }

            return $class;
        } else {
            return '';
        }
    }
127166
protected function _getElementHtml(AbstractElement $element)
    {
        $element->addData([
            'wysiwyg' => true,
            'config'  => $this->wysiwygConfig->getConfig($element)
        ]);
        return parent::_getElementHtml($element);
    }
195850
public static function getNamespace(Element $element) {
        return substr($element->getFqsen(), 0, strlen($element->getFqsen())-strlen('\\'. $element->getName()));
        //return str_replace('\\' . $element->getName(), '', $element->getFqsen());
    }
202702
protected function identify($element): string
    {
        if (is_string($element)) {
            return $this->driver->identifier($element);
        }

        if (!$element instanceof ElementInterface && !$element instanceof AbstractTable) {
            throw new InvalidArgumentException("Invalid argument type");
        }

        return $this->driver->identifier($element->getName());
    }
782447
public function render(ElementInterface $element): string
    {
        if (! $element instanceof LabelAwareInterface) {
            throw new InvalidClassException(
                sprintf(
                    'The given element "%s" does not implement "%s"',
                    $element->name(),
                    LabelAwareInterface::class
                )
            );
        }

        if ($element->label() === '') {
            return '';
        }

        $attributes = $element->labelAttributes();
        if (! isset($attributes['for'])) {
            $attributes['for'] = $element->id();
        }

        return sprintf(
            '<label %s>%s</label>',
            $this->attributesToString($attributes),
            $element->label()
        );
    }
111207
public function generateElementId(Element $element) : string
    {
        preg_match('/^([a-zA-Z0-9]*)/', $element->getName(), $matches);
        $name = $matches[0];

        if (! isset($this->ids[$name])) {
            $this->ids[$name] = 0;
        }

        return $this->getId() . '-' . $name . '-' . $this->ids[$name]++;
    }
125075
public Image getImage(Object element)
	{
		try
		{
			Image resultB = fImageLabelProvider.getImageLabel(element, evaluateImageFlags(element));
			// if (result == null && (element instanceof IStorage)) {
			// result= fStorageLabelProvider.getImage(element);
			// }
			Image result = decorateImage(resultB, element);

			
			return result;
		} catch (Exception e)
		{
			VdmUIPlugin.log(e);
			return null;
		}
	}
747797
public function from($element = null)
    {
        if (!empty($element) && $element instanceof Image) {
            foreach (get_object_vars($element) as $key => $value) {
                $this->$key = $value;
            }

            return $this;
        }
    }
853891
public function render(ElementInterface $element): string
    {
        if (! $element instanceof ChoiceElementInterface) {
            throw new InvalidClassException(
                sprintf(
                    'The given element "%s" has to implement "%s"',
                    $element->name(),
                    ChoiceElementInterface::class
                )
            );
        }

        $attributes = $element->attributes();
        unset($attributes['type'], $attributes['value']);

        return sprintf(
            '<select %s>%s</select>',
            $this->attributesToString($attributes),
            $this->renderChoices($element->choices(), $element->value())
        );
    }
1169274
function get($element) {
        $node = $this->findNode($element, $this->root);

        assert($node != null);

        return $node->value();
    }
904509
protected function getUriSchemeForManagedFile(array $element) {
    if (isset($element['#uri_scheme'])) {
      return $element['#uri_scheme'];
    }
    $scheme_options = \Drupal\webform\Plugin\WebformElement\WebformManagedFileBase::getVisibleStreamWrappers();
    if (isset($scheme_options['private'])) {
      return 'private';
    }
    elseif (isset($scheme_options['public'])) {
      return 'public';
    }
    else {
      return 'private';
    }
  }
502331
protected function getSubElement($element)
    {
        if ($element === BaseRange::INFINITY_MIN) {
            return BaseRange::INFINITY_MIN;
        } elseif ($element === BaseRange::INFINITY_MAX) {
            return BaseRange::INFINITY_MAX;
        } elseif ($element === '') {
            return null;
        }

        return new \DateTime($element);
    }