|
7 | 7 | */
|
8 | 8 | class HtmlDiffConfig
|
9 | 9 | {
|
10 |
| - /** |
11 |
| - * @var array |
12 |
| - */ |
13 |
| - protected $specialCaseTags = array('strong', 'b', 'i', 'big', 'small', 'u', 'sub', 'sup', 'strike', 's', 'p'); |
14 |
| - |
15 | 10 | /**
|
16 | 11 | * @var string[]
|
17 | 12 | */
|
@@ -61,14 +56,6 @@ class HtmlDiffConfig
|
61 | 56 | * @var int
|
62 | 57 | */
|
63 | 58 | protected $matchThreshold = 80;
|
64 |
| - /** |
65 |
| - * @var array |
66 |
| - */ |
67 |
| - protected $specialCaseOpeningTags = array(); |
68 |
| - /** |
69 |
| - * @var array |
70 |
| - */ |
71 |
| - protected $specialCaseClosingTags = array(); |
72 | 59 |
|
73 | 60 | /**
|
74 | 61 | * @var bool
|
@@ -103,7 +90,6 @@ public static function create()
|
103 | 90 | */
|
104 | 91 | public function __construct()
|
105 | 92 | {
|
106 |
| - $this->setSpecialCaseTags($this->specialCaseTags); |
107 | 93 | }
|
108 | 94 |
|
109 | 95 | /**
|
@@ -166,77 +152,49 @@ public function removeSpecialCaseChar($char)
|
166 | 152 | }
|
167 | 153 |
|
168 | 154 | /**
|
| 155 | + * @deprecated This feature never properly worked, and is removed in version 0.1.14 |
| 156 | + * |
169 | 157 | * @param array $tags
|
170 | 158 | *
|
171 | 159 | * @return $this
|
172 | 160 | */
|
173 | 161 | public function setSpecialCaseTags(array $tags = array())
|
174 | 162 | {
|
175 |
| - $this->specialCaseTags = $tags; |
176 |
| - $this->specialCaseOpeningTags = array(); |
177 |
| - $this->specialCaseClosingTags = array(); |
178 |
| - |
179 |
| - foreach ($this->specialCaseTags as $tag) { |
180 |
| - $this->addSpecialCaseTag($tag); |
181 |
| - } |
182 |
| - |
183 | 163 | return $this;
|
184 | 164 | }
|
185 | 165 |
|
186 | 166 | /**
|
| 167 | + * @deprecated This feature never properly worked, and is removed in version 0.1.14 |
| 168 | + * |
187 | 169 | * @param string $tag
|
188 | 170 | *
|
189 | 171 | * @return $this
|
190 | 172 | */
|
191 | 173 | public function addSpecialCaseTag($tag)
|
192 | 174 | {
|
193 |
| - if (!in_array($tag, $this->specialCaseTags)) { |
194 |
| - $this->specialCaseTags[] = $tag; |
195 |
| - } |
196 |
| - |
197 |
| - $opening = $this->getOpeningTag($tag); |
198 |
| - $closing = $this->getClosingTag($tag); |
199 |
| - |
200 |
| - if (!in_array($opening, $this->specialCaseOpeningTags)) { |
201 |
| - $this->specialCaseOpeningTags[] = $opening; |
202 |
| - } |
203 |
| - if (!in_array($closing, $this->specialCaseClosingTags)) { |
204 |
| - $this->specialCaseClosingTags[] = $closing; |
205 |
| - } |
206 |
| - |
207 | 175 | return $this;
|
208 | 176 | }
|
209 | 177 |
|
210 | 178 | /**
|
| 179 | + * @deprecated This feature never properly worked, and is removed in version 0.1.14 |
| 180 | + * |
211 | 181 | * @param string $tag
|
212 | 182 | *
|
213 | 183 | * @return $this
|
214 | 184 | */
|
215 | 185 | public function removeSpecialCaseTag($tag)
|
216 | 186 | {
|
217 |
| - if (($key = array_search($tag, $this->specialCaseTags)) !== false) { |
218 |
| - unset($this->specialCaseTags[$key]); |
219 |
| - |
220 |
| - $opening = $this->getOpeningTag($tag); |
221 |
| - $closing = $this->getClosingTag($tag); |
222 |
| - |
223 |
| - if (($key = array_search($opening, $this->specialCaseOpeningTags)) !== false) { |
224 |
| - unset($this->specialCaseOpeningTags[$key]); |
225 |
| - } |
226 |
| - if (($key = array_search($closing, $this->specialCaseClosingTags)) !== false) { |
227 |
| - unset($this->specialCaseClosingTags[$key]); |
228 |
| - } |
229 |
| - } |
230 |
| - |
231 | 187 | return $this;
|
232 | 188 | }
|
233 | 189 |
|
234 | 190 | /**
|
235 |
| - * @return array|null |
| 191 | + * @deprecated This feature never properly worked, and is removed in version 0.1.14 |
| 192 | + * |
| 193 | + * @return null |
236 | 194 | */
|
237 | 195 | public function getSpecialCaseTags()
|
238 | 196 | {
|
239 |
| - return $this->specialCaseTags; |
| 197 | + return null; |
240 | 198 | }
|
241 | 199 |
|
242 | 200 | /**
|
@@ -411,22 +369,6 @@ public function getIsolatedDiffTagPlaceholder($tag)
|
411 | 369 | return $this->isIsolatedDiffTag($tag) ? $this->isolatedDiffTags[$tag] : null;
|
412 | 370 | }
|
413 | 371 |
|
414 |
| - /** |
415 |
| - * @return array |
416 |
| - */ |
417 |
| - public function getSpecialCaseOpeningTags() |
418 |
| - { |
419 |
| - return $this->specialCaseOpeningTags; |
420 |
| - } |
421 |
| - |
422 |
| - /** |
423 |
| - * @return array |
424 |
| - */ |
425 |
| - public function getSpecialCaseClosingTags() |
426 |
| - { |
427 |
| - return $this->specialCaseClosingTags; |
428 |
| - } |
429 |
| - |
430 | 372 | /**
|
431 | 373 | * @return bool
|
432 | 374 | */
|
|
0 commit comments