Stores an array representing "scalar" element in the form array

@param array $element
167157
public function pushScalar(array $element) {
        if(!empty($element['required'])) {
            $this->hasRequired = true;
        }
        if(empty($this->containers)) {
            $this->array += $element;
        } else {
            $this->containers[count($this->containers) - 1][\Illuminate\Support\Arr::get($element, 'id')] = $element;
        }
    }
437721
public function addElement(Element $element)
    {
        if (!in_array($element, $this->elements, true)) {
            array_push($this->elements, $element);
        }
        return $this;
    }
1361182
public function setAttributes(
        SimpleXMLElement $element,
        array $attributes
    ) {
        $storage = $element->attributes();
        foreach ($attributes as $key => $value) {
            if (isset($storage->{$key})) {
                $storage->{$key} = $value;
            } else {
                $element->addAttribute($key, $value);
            }
        }
    }
1283996
public function setData( array $array ) {
        foreach( $array as $name=>$value ) {
            if( !isset( $this->nameHash[$name] ) ) {
                continue;
            }

            $element = $this->nameHash[$name];

            $element->setAttribute( 'value', (string)$value );
        }
    }
1281532
public function validateElement($element)
    {
        if (!is_object($element)) {
            throw new \InvalidArgumentException(sprintf(
                'Invalid element of type %s passed to %s, expected: %s',
                gettype($element),
                get_class($this),
                $this->getClass()
            ));
        }

        if (!is_a($element, $this->getClass())) {
            throw new \InvalidArgumentException(sprintf(
                'Invalid element (instance of %s) passed to %s, expected: %s',
                get_class($element),
                get_class($this),
                $this->getClass()
            ));
        }
    }
841777
public function addElements(array $elements) {
		foreach ($elements as $name => $element) {
			if (is_string($name)) {
				$this->addElement($element, $name);
			} else {
				$this->addElement($element);
			}
		}
		
		return $this;
	}
1133064
private function computeElementsToJson(array $elements)
    {
        $result = [];
        foreach ($elements as $key => $element) {
            $result[$key] = null;
            if ($element instanceof AbstractContent) {
                $result[$key] = [
                    'uid'  => $element->getUid(),
                    'type' => $element->getContentType(),
                ];
            } elseif (is_scalar($element)) {
                $result[$key] = $element;
            } elseif (is_array($element)) {
                $result[$key] = $this->computeElementsToJson($element);
            }
        }

        return $result;
    }
743723
public function set($index, $element)
    {
        if (!is_null($index)
            && is_scalar($index)
        ) {
            $this->_iterator = null;
            return $this->_items[$index] = $element;
        } else {
            // given index name is not valid
            throw new ListException('Element could not be added to list. Index is not valid.', E_NOTICE);
        }
    }
961334
function addStopFieldsetElements($element)
    {
        if (is_array($element)) {
            $this->_stopFieldsetElements = array_merge($this->_stopFieldsetElements,
                                                       $element);
        } else {
            $this->_stopFieldsetElements[] = $element;
        }
    }
1057789
protected function addElementsToIndexes($elements, array $indexes): void
    {
        if (!is_array($elements)) {
            $elements = [$elements];
        }

        /** @var DescriptorAbstract $element */
        foreach ($elements as $element) {
            /** @var Collection $collection */
            foreach ($indexes as $collection) {
                $collection->set($this->getIndexKey($element), $element);
            }
        }
    }
347278
public function insert($element, $priority = 0)
    {
        $data = [];
        $inserted = false;
        $priority = $priority === 0 ? $this->lastPriority : $priority;

        foreach ($this->data as $datum) {
            $inserted = $this->tryToInsert($element, $priority, $data, $datum);
            $data[] = ['element' => $datum['element'], 'priority' => $datum['priority']];
            $this->lastPriority = $datum['priority'];
        }

        if (!$inserted) {
            $data[] = ['element' => $element, 'priority' => $priority];
            $this->lastPriority = $priority;
        }

        $this->data = $data;
        return $this;
    }
64792
public function insert( $index, $element ) {
		$this->validate_index( $index );
		$this->type->validate_element( $element );

		$a = array_slice( $this->elements, 0, $index );
		$b = array_slice( $this->elements, $index, count( $this->elements ) );

		$a[] = $element;

		return $this->new_from_trusted( array_merge( $a, $b ) );
	}
1192159
protected function _asArray(\SimpleXMLElement $element)
    {
        $output = $this->_asData($element);

        if (!$element->count()) {
            return $output;
        }

        return $this->_pushArray($output, $element);
    }
1147671
public function check($element)
    {
        if (!is_scalar($element)) {
            $element = serialize($element);
        }

        $hashes = $this->hash($element);

        foreach ($hashes as $hash) {

            $offset = (int)floor($hash / 8);
            $bit = (int)($hash % 8);

            if (!(ord($this->filter[$offset]) & (2 ** $bit))) {
                return false;
            }
        }

        return true;
    }
1354249
public static function processLegend(array $element) {
    if ($element['#legend']) {
      foreach (RenderElement::children($element) as $key) {
        if (is_callable($element['#legend'])) {
          $element[$key]['#description'] = $element['#legend']($element[$key]);
        }
        elseif (isset($element['#legend'][$key])) {
          $element[$key]['#description'] = $element['#legend'][$key];
        }
      }
    }
    return $element;
  }
925891
protected function storeInput($element, $text)
    {
        $this->assertFilterProducesResults($element);

        $element = str_replace(['#', '[]'], '', $element);

        $this->inputs[$element] = $text;

        return $this;
    }
1157567
protected static function create(array $element)
    {
        $class = self::getClassName($element['type']);
        $object = new $class;
        if ($object instanceof ContainerInterface) {
            static::execute($object, $element);
        }
        return $object;
    }