Create a new tag

@param string      $name       The new tag name
@param string|null $startPoint the new tag start point.
@param null        $message    the tag message

@throws \RuntimeException
@return string the command
339059
public function create(string $name, $startPoint = null, $message = null)
    {
        $this->clearAll();
        $this->addCommandName(self::TAG_COMMAND);
        if (null !== $message) {
            $this->addCommandArgument('-m');
            $this->addCommandArgument($message);
        }
        if (null !== $startPoint) {
            $this->addCommandArgument($name);
            $this->addCommandSubject($startPoint);
        } else {
            $this->addCommandSubject($name);
        }

        return $this->getCommand();
    }
1199190
public function tag($name, $text = null, array $options = [])
    {
        $options = optionsParser($options)->tooltip();
        list($text, $options) = $this->addIconToText($text, $options);

        return parent::tag($name, is_null($text) ? '' : $text, $options->toArray());
    }
168714
public function mark($name)
	{
		// If a point already exists with this name.
		if (isset($this->lookup[$name]))
		{
			throw new InvalidArgumentException(
				sprintf(
					'A point already exists with the name %s in the profiler %s.',
					$name,
					$this->name
				)
			);
		}

		// Update the memory peak (it cannot decrease).
		$this->memoryPeakBytes = memory_get_peak_usage($this->memoryRealUsage);

		// Get the current timestamp and allocated memory amount.
		$timeStamp = microtime(true);
		$memoryBytes = memory_get_usage($this->memoryRealUsage);

		// If this is the first point.
		if (empty($this->points))
		{
			$this->startTimeStamp = $timeStamp;
			$this->startMemoryBytes = $memoryBytes;
		}

		// Create the point.
		$point = new ProfilePoint(
			$name,
			$timeStamp - $this->startTimeStamp,
			$memoryBytes - $this->startMemoryBytes
		);

		// Store it.
		$this->points[] = $point;

		// Store the point name and its key in $points, in the lookup array.
		$this->lookup[$name] = count($this->points) - 1;

		return $this;
	}
1124233
public function createBranch(string $name, $startPoint = null)
    {
        Branch::create($this, $name, $startPoint);

        return $this;
    }
420932
public function startTag()
	{
		if ($this->name) {
			return '<' . $this->name . $this->attributes() . (static::$xhtml && $this->isEmpty ? ' />' : '>');

		} else {
			return '';
		}
	}
1075593
public static function startTimer($name, $message = null) {
		if (!Reveal::is('DebugKit.running')) {
			return;
		}

		App::uses('DebugTimer', 'DebugKit.Lib');
		DebugTimer::start($name, $message);
	}
1132575
public function getTag(string $name)
    {
        $tagFinderOutput = $this->caller
            ->execute(TagCommand::getInstance()->listTags())
            ->getOutputLines(true);

        foreach ($tagFinderOutput as $line) {
            if ($line === $name) {
                return new Tag($this, $name);
            }
        }

        return null;
    }
937245
public function createAuthorTag($name, $email = null)
    {
        return $this->internalCreateTag(true, 'author', $name, $email ? "<$email>" : null);
    }
1181553
public static function data(Tag $tag, $name, $data) {
    $js = sprintf("data(%s, %s)",
                  JSHelper::convertString($name), JSHelper::convertValue($data)
                  );
    
    $tag->chain(new Code($js));
    
    return $tag;
  }
1148607
public static function create($name) {
    $parts = explode('\\', $name);
    $name_node = new NameNode();
    foreach ($parts as $i => $part) {
      $part = trim($part);
      if ($i > 0) {
        $name_node->append(Token::namespaceSeparator());
      }
      if ($part !== '') {
        $name_node->append(Token::identifier($part));
      }
    }
    return $name_node;
  }
14082
public function startElement($name, $attributes)
    {
        try {
            if ($name == "dataset") {
                // Clear any start/end DLL
                call_user_func(array($this->builderClazz, 'reset'));
                $this->sqlWriter->write(call_user_func(array($this->builderClazz, 'getDatabaseStartSql')));
            } else {

                // we're processing a row of data
                // where tag name is phpName e.g. <BookReader .... />

                $table = $this->database->getTableByPhpName($name);

                $columnValues = array();
                foreach ($attributes as $name => $value) {
                    $col = $table->getColumnByPhpName($name);
                    $columnValues[] = new ColumnValue($col, iconv('utf-8', $this->encoding, $value));
                }

                $data = new DataRow($table, $columnValues);

                if ($this->currTableName !== $table->getName()) {
                    // new table encountered

                    if ($this->currBuilder !== null) {
                        $this->sqlWriter->write($this->currBuilder->getTableEndSql());
                    }

                    $this->currTableName = $table->getName();
                    $this->currBuilder = $this->generatorConfig->getConfiguredBuilder($table, 'datasql');

                    $this->sqlWriter->write($this->currBuilder->getTableStartSql());
                }

                // Write the SQL
                $this->sqlWriter->write($this->currBuilder->buildRowSql($data));
            }
        } catch (Exception $e) {
            // Exceptions have traditionally not bubbled up nicely from the expat parser,
            // so we also print the stack trace here.
            print $e;
            throw $e;
        }
    }
1100374
public static function create($message, $name = null)
    {
        return Message::generic($message, self::$CSSClass, $name);
    }
931175
public static function create($name = 'null') {
    $is_upper = FormatterFactory::getDefaultFormatter()->getConfig('boolean_null_upper');
    $node = new NullNode();
    $node->addChild(NameNode::create($is_upper ? 'NULL' : 'null'), 'constantName');
    return $node;
  }
301774
public function create($title, $tag = null, $group = null, $description = null) {
        $params = [
            'data' => [
                'title' => $title
            ]
        ];

        if (isset($tag)) {
            $params['data']['tag'] = $tag;
        }

        if (isset($group)) {
            $params['data']['group'] = $group;
        }

        if (isset($group)) {
            $params['data']['description'] = $description;
        }

        $result = $this->api->request(
            'checkmk.statictag.create',
            $params
        );

        if (!array_key_exists('id', $result) ||
            !is_numeric($result['id']) ||
            !array_key_exists('success', $result) ||
            $result['success'] !== true) {
            if (array_key_exists('message', $result)) {
                throw new RuntimeException(sprintf('Bad result: %s', $result['message']));
            } else {
                throw new RuntimeException('Bad result');
            }
        }

        return (int) $result['id'];
    }
225138
public function tag($name, $key) {
		$args = array();
		if (!is_array($key)) {
			for ($i = 1; $i < func_num_args(); $i+=2) {
				$args[func_get_arg($i)] = func_get_arg($i + 1);
			};
		} else {
			$args = $key;
		}
		if (isset($args[$name])) {
			return $args[$name];
		}
		return null;
	}
1191910
public static function generic($message = null, $CSSClass = null, $name = null)
    {
        // ensure that we are having a name as well as keeping it consistent with the original behaviour
        if ($name == null) {
            $name = md5($message);
        }

        return MessageBoxField::create(
            $name,
            $message
        )->addCSSClass($CSSClass);
    }
131348
static final String createTag(final String name) {
		if (name.length() <= MAX_TAG_LEN) {
			return name;
		}

		final char[] tag = name.toCharArray();
		final int arrayLen = tag.length;
		int len = 0;
		int mark = 0;

		for (int i = 0; i < arrayLen; i++, len++) {
			if (tag[i] == '.') {
				len = mark;

				if (tag[len] != '.') {
					len++;
				}

				mark = len;

				if (i + 1 < arrayLen && tag[i + 1] != '.') {
					mark++;
				}
			}

			tag[len] = tag[i];
		}

		if (len > MAX_TAG_LEN) {
			int i = 0;

			mark--;

			for (int j = 0; j < len; j++) {
				if (tag[j] == '.' && ((j != mark) || (i >= MAX_TAG_LEN - 1))) {
					continue;
				}

				tag[i++] = tag[j];
			}

			len = i;

			if (len > MAX_TAG_LEN) {
				len = MAX_TAG_LEN;
			}
		}

		return new String(tag, 0, len);
	}