PHP 8.3.31
Preview: HtmlDecorator.php Size: 1.23 KB
/home/getspomw/royalsquad.us/vendor/league/commonmark/src/Renderer/HtmlDecorator.php

<?php

declare(strict_types=1);

/*
 * This file is part of the league/commonmark package.
 *
 * (c) Colin O'Dell <colinodell@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace League\CommonMark\Renderer;

use League\CommonMark\Node\Node;
use League\CommonMark\Util\HtmlElement;

final class HtmlDecorator implements NodeRendererInterface
{
    private NodeRendererInterface $inner;
    private string $tag;
    /** @var array<string, string|string[]|bool> */
    private array $attributes;
    private bool $selfClosing;

    /**
     * @param array<string, string|string[]|bool> $attributes
     */
    public function __construct(NodeRendererInterface $inner, string $tag, array $attributes = [], bool $selfClosing = false)
    {
        $this->inner       = $inner;
        $this->tag         = $tag;
        $this->attributes  = $attributes;
        $this->selfClosing = $selfClosing;
    }

    /**
     * {@inheritDoc}
     */
    public function render(Node $node, ChildNodeRendererInterface $childRenderer)
    {
        return new HtmlElement($this->tag, $this->attributes, $this->inner->render($node, $childRenderer), $this->selfClosing);
    }
}

Directory Contents

Dirs: 2 × Files: 7

Name Size Perms Modified Actions
Block DIR
- drwxrwxrwx 2025-09-17 06:53:06
Edit Download
Inline DIR
- drwxrwxrwx 2025-09-17 06:53:06
Edit Download
701 B lrw-rw-rw- 2025-09-17 06:53:06
Edit Download
687 B lrw-rw-rw- 2025-09-17 06:53:06
Edit Download
1.23 KB lrw-rw-rw- 2025-09-17 06:53:06
Edit Download
2.80 KB lrw-rw-rw- 2025-09-17 06:53:06
Edit Download
728 B lrw-rw-rw- 2025-09-17 06:53:06
Edit Download
662 B lrw-rw-rw- 2025-09-17 06:53:06
Edit Download
421 B lrw-rw-rw- 2025-09-17 06:53:06
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).