Prepares $element to contain $timeStruct information.

@param array $element
@param ezcDebugTimerStruct $timeStruct
778011
private function addElement( &$element, $timeStruct )
    {
        if ( !isset( $element[$timeStruct->name] ) )
        {
            $element[$timeStruct->name] = new ezcDebugStructure();

            $element[$timeStruct->name]->count = 0;
            $element[$timeStruct->name]->elapsedTime = 0;
            $element[$timeStruct->name]->startTime = INF;
            $element[$timeStruct->name]->stopTime = 0;
        }

        $element[$timeStruct->name]->count++;
        $element[$timeStruct->name]->elapsedTime += $timeStruct->elapsedTime;
        $element[$timeStruct->name]->startTime = min( $element[$timeStruct->name]->startTime, $timeStruct->startTime );
        $element[$timeStruct->name]->stopTime = max( $element[$timeStruct->name]->stopTime, $timeStruct->stopTime );


        $element[$timeStruct->name]->switchTime = $timeStruct->switchTime;
    }
1174696
static function setScriptStart( $time = false )
    {
        if ( $time == false )
            $time = microtime( true );
        $debug = eZDebug::instance();
        $debug->ScriptStart = $time;
    }
90202
public void add(long date, T element) {
		if (size == 0) {
			elements[0] = element;
			dates[0] = date;
			size = 1;
			oldestIndex = 0;
			newestIndex = 0;
			return;
		}
		if (size < elements.length) {
			elements[size] = element;
			dates[size] = date;
			if (date < dates[oldestIndex]) oldestIndex = size;
			if (date > dates[newestIndex]) newestIndex = size;
			size++;
			return;
		}
		if (dates[oldestIndex] > date) {
			// older than oldest
			if (newestIndex < 0) refreshNewestIndex();
			elements[newestIndex] = element;
			dates[newestIndex] = date;
			oldestIndex = newestIndex;
			newestIndex = -1;
			return;
		}
		if (newestIndex < 0) refreshNewestIndex();
		if (dates[newestIndex] < date) return; // newer than newest
		// replace the newest
		elements[newestIndex] = element;
		dates[newestIndex] = date;
		oldestIndex = newestIndex;
		newestIndex = -1;
		return;
	}
470956
function _prepare(element, context) {
  return prepareElement(element, context).then(([children, childContext]) => {
    return Promise.all(
      React.Children.toArray(children).map(child =>
        _prepare(child, childContext)
      )
    );
  });
}
1194033
public function beforeElementSave (ElementInterface $element, bool $isNew): bool
	{
		if (!SimpleMap::getInstance()->map->validateField($this, $element))
			return false;

		return parent::beforeElementSave($element, $isNew);
	}
1227005
public function onPrepareReleaseConstructReleaseInstance(PrepareReleaseEvent $event)
    {
        if (($event->getRelease() instanceof Release) === false) {
            $release = new Release($event->getVersion());

            $event->getWorkspace()->addRelease($release);
            $event->setRelease($release);
        }
    }
774482
protected function localizeData(Element $element, Array &$data)
    {
        $fieldLayout = $element->getFieldLayout();
        foreach ($fieldLayout->getTabs() as $tab) {
            foreach ($tab->getFields() as $tabField) {
                $field = Craft::$app->fields->getFieldById($tabField->id);
                $fieldValue = $element[$field->handle];
                if ( in_array ($field->className() , ['craft\fields\Matrix', 'verbb\supertable\fields\SuperTableField', 'benf\neo\Field']) ) {
                    if ($field->localizeBlocks == false) {
                        $items = $fieldValue->getIterator();
                        $i = 1;
                        foreach ($items as $item) {
                            if (key_exists('new'. $i, $data['fields'][$field->handle])) {
                               $data['fields'][$field->handle][$item->id] = $data['fields'][$field->handle]['new' . $i];
                               unset($data['fields'][$field->handle]['new' . $i]);
                            }
                            $i++;
                        }
                    }
                }
            }
        }
    }
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);
        }
    }
770209
private function prepareTime(string $times)
    {
        foreach (preg_split('/\W/i', $times) as $time) {
            $this->getDatePart($time);
        }
    }
734936
public void prepare(Element anchor, T item) {
        this.currentAnchor = anchor;
        this.currentItem = item;
        if(!this.timer.isRunning())
        {
            timer.schedule(DELAY_MS);
        }
    }
975214
protected function processGenerate($element, $data)
    {
        $this->prepareElementName($element);

        /** setRootName(null) support */
        if('' === (string) $element)
        {
            $element = array_keys($data)[0];

            return $this->processGenerate($element, $data[$element]);
        }

        /** @var \DOMElement $node */
        $node = $this->getDomDocument()->createElement($element);

        if(is_array($data))
        {
            $this->applyAttributes($data, $node);

            if(isset($data['@value']))
            {
                $this->applyValue($data, $node);

                return $node;
            }
            elseif(isset($data['@cdata']))
            {
                $this->applyCData($data, $node);

                return $node;
            }
            elseif(isset($data['@ns']))
            {
                $this->applyNamespace($data, $node);
            }
        }

        if(is_array($data))
        {
            foreach($data as $key => $value)
            {
                $this->prepareElementName($key);

                if('' === $key || false === $this->isValidElementName($key))
                {
                    continue;
                }

                if(is_array($value) && is_numeric(key($value)))
                {
                    foreach($value as $k => $v)
                    {
                        $node->appendChild($this->processGenerate($key, $v));
                    }
                }
                else
                {
                    $node->appendChild($this->processGenerate($key, $value));
                }

                unset($data[$key]);
            }
        }

        if(!is_array($data))
        {
            $data = $this->getBooleanAsString($data);

            $node->appendChild(
                $this->getDomDocument()->createTextNode($data)
            );
        }

        return $node;
    }
552616
protected function init(DOMElement $element)
    {
        $this->parseType($element);
        $this->parseId($element, false);
        $this->parseName($element, false);

        $this->parseArgs($element);
    }
769777
function structHandlerCustom( $element, &$params )
    {
        $ret = null;
        if ( $this->XMLSchema->isInline( $element ) )
        {
            $ret = $this->appendLineParagraph( $element, $params );
        }
        else
        {
            $ret = $this->appendParagraph( $element, $params );
        }
        return $ret;
    }
418362
public function _prep_element($element) {
		if (strrpos($element, 'this')===false&&strrpos($element, 'event')===false&&strrpos($element, 'self')===false) {
			$element='"'.addslashes($element).'"';
		}
		return $element;
	}
215423
protected function prepareElement($element)
    {
        $options    = $this->getOptions();
        $currClass  = $element->getAttribute('class');
        $class      = $currClass . (null !== $currClass ? ' ' : '') . $options['class'];

        $element->setAttributes(array(
            'class'             => $class,
            'data-color'        => $options['color'],
            'data-color-format' => $options['format'],
        ));

        return $element;
    }
374970
public function set($index, $element) {
        $previous = $this->get($index);
        $this->_elements[$index] = $element;
        return $previous;
    }
1168951
public function onBeforeExport($element , array $newElement)
    {
        $event = new ExportEvent(array(
            'element' => $element,
            'value' => $newElement
        ));
        $this->trigger($this::EVENT_BEFORE_EXPORT_ELEMENT, $event);
        return $event->value;
    }