(non-PHPdoc)
@see JBBCode.Node::getAsBBCode()

Returns the element as bbcode (with all unclosed tags closed)

@return string the bbcode representation of this element
178174
public function getAsBBCode()
    {
        $str = "[".$this->tagName;
        if (!empty($this->attribute)) {
            if (isset($this->attribute[$this->tagName])) {
                $str .= "=".$this->attribute[$this->tagName];
            }

            foreach ($this->attribute as $key => $value) {
                if ($key == $this->tagName) {
                    continue;
                } else {
                    $str .= " ".$key."=" . $value;
                }
            }
        }
        $str .= "]";
        foreach ($this->getChildren() as $child) {
            $str .= $child->getAsBBCode();
        }
        $str .= "[/".$this->tagName."]";

        return $str;
    }
1121133
public final function getPhpCode() : string
   {

      $str = $this->stringValue;

      switch ( $this->typeName )
      {

         case Type::PHP_BOOLEAN:
         case 'boolean':
            return ( $this->value ? 'true' : 'false' );

         case Type::PHP_DOUBLE:
         case Type::PHP_FLOAT:
         case Type::PHP_INTEGER:
         case 'integer':
            return $str;

         case Type::PHP_STRING:
            if ( \preg_match( "~[\r\n\t]+~", $str ) )
            {
               $str = \str_replace(
                  array( '\\',  "\r", "\n", "\t", "\0", '"',  '$' ),
                  array( '\\\\','\\r','\\n','\\t','\\0','\\"','\\$' ),
                  $str
               );
               return '"' . $str . '"';
            }
            return "'" . \str_replace(
                  array( '\\',   "'" ),
                  array( '\\\\', "\\'" ),
                  $str
               )
               . "'";

         case Type::PHP_RESOURCE:
         case Type::PHP_NULL:
         case Type::PHP_UNKNOWN:
            return 'null';

         default:
            $str = \serialize( $this->value );
            if ( \preg_match( "~[\r\n\t]+~", $str ) )
            {
               $str = \str_replace(
                  array( '\\',  "\r", "\n", "\t", "\0", '"',  '$' ),
                  array( '\\\\','\\r','\\n','\\t','\\0','\\"','\\$' ),
                  $str
               );
            }
            else
            {
               $str = \str_replace(
                  array('\\',   '"',   '$'),
                  array('\\\\', '\\"', '\\$'),
                  $str );
            }
            return '\unserialize("' . $str . '")';

      }

   }
546780
public function getElement()
    {
        if ($this->getDocblock()) {
            $this->setLines($this->getDocblock()->getElement());
            $this->addBlankLine();
        }
        if ($this->getNamespace()) {
            $this->addLine('namespace '.$this->getNamespace().';');
            $this->addBlankLine();
        }
        if (count($this->getUse()) > 0) {
            foreach ($this->getUse() as $alias => $class) {
                $line = 'use '.$class;
                if (is_string($alias)) {
                    $line .= ' as '.$alias;
                }
                $this->addLine($line.';');
            }
            $this->addBlankLine();
        }
        if ($this->getName()) {
            $this->addLine(
                ($this->isAbstract() ? 'abstract ' : '').'class '.$this->getName()
            );
        }
        if ($this->getExtends()) {
            $this->addLine(array('extends '.$this->getExtends()));
        }
        if (count($this->getImplements()) > 0) {
            $this->addLine(array('implements '.implode(', ', $this->getImplements())));
        }
        $this->startBlock();
        $this->addLine($this->getParams());
        $this->addLine($this->getFunctions());
        $this->endBlock();
        return $this->getLines();
    }
26378
public function getClosingTag(): ?string
    {
        if (!in_array($this->nodeName, self::SELF_CLOSING_TAGS)) {
            return sprintf('</%s>', $this->nodeName);
        }

        return null;
    }
801686
protected function generateVerifyCode()
    {
        // alphabets ?
        if (!$this->useMbChars) {
            return parent::generateVerifyCode();
        }

        $seeds = $this->getCaptchaSeeds();
        $len = mb_strlen($seeds, 'UTF-8');

        for ($code = '', $i = 0; $i < $this->getCaptchaLength(); ++$i) {
            $code .= mb_substr($seeds, mt_rand(0, $len - 1), 1, 'UTF-8');
        }

        return $code;
    }
65484
public function toStringCode()
    {
        if (!$this->isInterface() && !$this->isAbstract()) {
            $tabulationFormatted = $this->getTabulationFormatted();
            $code = PHP_EOL . $tabulationFormatted
                . '{'
                . $this->codeToString()
                . $tabulationFormatted
                . '}';

            return $code;
        }

        return ';';
    }
916235
protected function extractContentIdFromBBCode($str)
    {
        $references = array();
        /** @var \OpenOrchestra\BBcodeBundle\Parser\BBcodeParserInterface $parserBBcode */
        $parsedBBcode = $this->bbcodeParser->parse($str);
        $nodeTags = $parsedBBcode->getElementByTagName(InternalLinkDefinition::TAG_NAME);
        /** @var \OpenOrchestra\BBcodeBundle\ElementNode\BBcodeElementNodeInterface $mediaTag */
        foreach ($nodeTags as $nodeTag) {
            $linkAttribute = json_decode(html_entity_decode($nodeTag->getAttribute()['link']), true);
            if (!empty($linkAttribute['contentSearch_contentId'])) {
                $references[] = $linkAttribute['contentSearch_contentId'];
            }
        }

        return $references;
    }
267952
public function codeDesc()
    {
        // Cast code to string from SimpleXMLObject
        $code = (string)$this->code;
        return array_key_exists($code, self::$codes) ? self::$codes[$code] : '';
    }
136013
public function code()
    {
        $code = $this->language()->code() . '_' . $this->territory()->code();

        if ($this->script() != $this->language()->defaultScript()) {
            $code .= '@' . strtolower($this->script()->unicodeName());
        }

        if ($this->variant() !== null) {
            if ($this->variant()->code() === 'posix') {
                $code = 'POSIX';
            } else {
                $code .= '@' . $this->variant()->code();
            }
        }

        return $code;
    }
84428
public function get_html($nl2br=true, $htmlEntities = true)
	{
		$html = '';

		foreach($this->children as $child)
			$html .= $child->get_html($nl2br, $htmlEntities);

		if($this instanceof Node_Container_Document)
			return $html;

		$bbcode = $this->root()->get_bbcode($this->tag);

		if(is_callable($bbcode->handler()) && ($func = $bbcode->handler()) !== false)
			return $func($html, $this->attribs, $this);
		//return call_user_func($bbcode->handler(), $html, $this->attribs, $this);

		return str_replace('%content%', $html, $bbcode->handler());
	}
707126
public function getHashCode()
    {
        $hashConditionals = '';
        foreach ($this->conditionalStyles as $conditional) {
            $hashConditionals .= $conditional->getHashCode();
        }

        return md5(
            $this->fill->getHashCode() .
            $this->font->getHashCode() .
            $this->borders->getHashCode() .
            $this->alignment->getHashCode() .
            $this->numberFormat->getHashCode() .
            $hashConditionals .
            $this->protection->getHashCode() .
            ($this->quotePrefix  ? 't' : 'f') .
            __CLASS__
        );
    }
491109
protected function captureEndTag()
	{
		if (empty($this->uppercaseText))
		{
			$this->uppercaseText = strtoupper($this->text);
		}
		$match     = '[/' . $this->bbcodeName . $this->bbcodeSuffix . ']';
		$endTagPos = strpos($this->uppercaseText, $match, $this->pos);
		if ($endTagPos === false)
		{
			return;
		}

		return $this->parser->addEndTag($this->getTagName(), $endTagPos, strlen($match));
	}
301136
private function getAttributeCode()
    {
        $attributeCode = false;

        if ($this->request->isAjax() && $this->request->getParam('filterName')) {
            $attributeCode = (string) $this->request->getParam('filterName');
        }

        return $attributeCode;
    }
1033061
public function getCode() {
        $result = '';

        if ($this->options->getRenderContextDirective()) {
            $result .= $this->renderedCode->getContextDirective();
        }
        if ($this->options->getRenderDirectives()) {
            $result .= $this->renderedCode->getDirectives();
        }
        if ($this->options->getRenderGlobalCode()) {
            $result .= $this->renderedCode->getGlobalCode();
        }
        if ($this->options->getRenderMainFunction()) {
            $result .= $this->renderedCode->getMainFunction();
        }

        if ($this->options->getCompress()) {
            $result = $this->compress($result);
        }
        if ($this->options->getIncludeScriptTag()) {
            $result = $this->addScriptTag($result);
        }

        return $result;
    }
917267
public function getJsCode()
    {
        $html = '';
        foreach ($this->js as $js) {
            $html .= sprintf('<script src="%s"></script>', $js);
        }
        foreach ($this->entry as $entry) {
            $html .= sprintf('<script>System.import(\'%s\')</script>', $entry);
        }
        return $html;
    }
896032
public function getReasonCode()
    {
        $code = null;

        if (isset($this->data['messages'])) {
            // In case of a successful transaction, a "messages" element is present
            $code = (string)$this->data['messages']['message']['code'];
        }

        return $code;
    }
1079393
public function getEmbedCode() {
		if (!empty($this->_stub['iframe-player']) && $this->config['prefer'] === 'iframe') {
			return $this->_buildIframe();
		}
		return $this->_buildObject();
	}