1: <?php declare(strict_types=1);
2:
3: namespace Salient\Console\Support;
4:
5: use Salient\Contract\Console\ConsoleTag as Tag;
6: use Salient\Contract\Console\ConsoleTagAttributesInterface;
7:
8: /**
9: * Tag attributes
10: */
11: final class ConsoleTagAttributes implements ConsoleTagAttributesInterface
12: {
13: /**
14: * Tag identifier
15: *
16: * @readonly
17: * @var Tag::*
18: */
19: public int $Tag;
20:
21: /**
22: * Tag as it was originally used
23: *
24: * @readonly
25: */
26: public string $OpenTag;
27:
28: /**
29: * Tag depth
30: *
31: * @readonly
32: */
33: public int $Depth;
34:
35: /**
36: * True if the tag has nested tags
37: *
38: * @readonly
39: */
40: public ?bool $HasChildren;
41:
42: /**
43: * Horizontal whitespace before the tag (fenced code blocks only)
44: *
45: * @readonly
46: */
47: public ?string $Indent;
48:
49: /**
50: * Fenced code block info string
51: *
52: * @readonly
53: */
54: public ?string $InfoString;
55:
56: /**
57: * @param Tag::* $tag
58: */
59: public function __construct(
60: int $tag,
61: string $openTag,
62: int $depth = 0,
63: ?bool $hasChildren = null,
64: ?string $indent = null,
65: ?string $infoString = null
66: ) {
67: $this->Tag = $tag;
68: $this->OpenTag = $openTag;
69: $this->Depth = $depth;
70: $this->HasChildren = $hasChildren;
71: $this->Indent = $indent;
72: $this->InfoString = $infoString;
73: }
74: }
75: