| Total Complexity | 11 |
| Total Lines | 133 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 6 | class Tag implements EchoValueInterface |
||
| 7 | { |
||
| 8 | use EchoValueTrait; |
||
| 9 | |||
| 10 | protected $content; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * 配置信息 |
||
| 14 | * |
||
| 15 | * @var array |
||
| 16 | */ |
||
| 17 | protected $config; |
||
| 18 | /** |
||
| 19 | * 标签名 |
||
| 20 | * |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | protected $name; |
||
| 24 | /** |
||
| 25 | * 开标签 |
||
| 26 | * |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | protected $open; |
||
| 30 | /** |
||
| 31 | * 闭标签 |
||
| 32 | * |
||
| 33 | * @var string |
||
| 34 | */ |
||
| 35 | protected $close; |
||
| 36 | |||
| 37 | public function __construct(string $name, string $open, string $close, string $content) |
||
| 38 | { |
||
| 39 | $this->content = $content; |
||
| 40 | $this->name = $name; |
||
| 41 | $this->open = $open; |
||
| 42 | $this->close= $close; |
||
| 43 | } |
||
| 44 | |||
| 45 | public function compile(string $content):string |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Get 开标签 |
||
| 52 | * |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | public function getOpen() |
||
| 56 | { |
||
| 57 | return $this->open; |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Get 闭标签 |
||
| 62 | * |
||
| 63 | * @return string |
||
| 64 | */ |
||
| 65 | public function getClose() |
||
| 68 | } |
||
| 69 | |||
| 70 | /** |
||
| 71 | * Set 闭标签 |
||
| 72 | * |
||
| 73 | * @param string $close 闭标签 |
||
| 74 | * |
||
| 75 | * @return self |
||
| 76 | */ |
||
| 77 | public function setClose(string $close) |
||
| 78 | { |
||
| 79 | $this->close = $close; |
||
| 80 | |||
| 81 | return $this; |
||
| 82 | } |
||
| 83 | |||
| 84 | /** |
||
| 85 | * Set 开标签 |
||
| 86 | * |
||
| 87 | * @param string $open 开标签 |
||
| 88 | * |
||
| 89 | * @return self |
||
| 90 | */ |
||
| 91 | public function setOpen(string $open) |
||
| 92 | { |
||
| 93 | $this->open = $open; |
||
| 94 | |||
| 95 | return $this; |
||
| 96 | } |
||
| 97 | |||
| 98 | /** |
||
| 99 | * Get 标签名 |
||
| 100 | * |
||
| 101 | * @return string |
||
| 102 | */ |
||
| 103 | public function getName() |
||
| 104 | { |
||
| 105 | return $this->name; |
||
| 106 | } |
||
| 107 | |||
| 108 | /** |
||
| 109 | * Set 标签名 |
||
| 110 | * |
||
| 111 | * @param string $name 标签名 |
||
| 112 | * |
||
| 113 | * @return self |
||
| 114 | */ |
||
| 115 | public function setName(string $name) |
||
| 120 | } |
||
| 121 | |||
| 122 | /** |
||
| 123 | * Set 配置信息 |
||
| 124 | * |
||
| 125 | * @param array $config 配置信息 |
||
| 126 | * |
||
| 127 | * @return self |
||
| 128 | */ |
||
| 129 | public function setConfig(array $config) |
||
| 139 | } |
||
| 140 | } |
||
| 141 |