@@ -44,9 +44,6 @@ abstract class AbstractHtml extends AbstractRenderer
4444 */
4545 public const AUTO_FORMAT_CHANGES = true ;
4646
47- /**
48- * {@inheritdoc}
49- */
5047 public function getResultForIdenticalsDefault (): string
5148 {
5249 return '' ;
@@ -105,19 +102,13 @@ public function getChanges(Differ $differ): array
105102 return $ changes ;
106103 }
107104
108- /**
109- * {@inheritdoc}
110- */
111105 protected function renderWorker (Differ $ differ ): string
112106 {
113107 $ rendered = $ this ->redererChanges ($ this ->getChanges ($ differ ));
114108
115109 return $ this ->cleanUpDummyHtmlClosures ($ rendered );
116110 }
117111
118- /**
119- * {@inheritdoc}
120- */
121112 protected function renderArrayWorker (array $ differArray ): string
122113 {
123114 $ this ->ensureChangesUseIntTag ($ differArray );
@@ -199,7 +190,7 @@ final protected function formatChanges(array &$changes): void
199190
200191 /** @phan-suppress-next-line PhanTypeInvalidLeftOperandOfBitwiseOp */
201192 if ($ block ['tag ' ] & (SequenceMatcher::OP_REP | SequenceMatcher::OP_DEL )) {
202- $ block ['old ' ]['lines ' ] = \ str_replace (
193+ $ block ['old ' ]['lines ' ] = str_replace (
203194 RendererConstant::HTML_CLOSURES ,
204195 RendererConstant::HTML_CLOSURES_DEL ,
205196 $ block ['old ' ]['lines ' ]
@@ -208,7 +199,7 @@ final protected function formatChanges(array &$changes): void
208199
209200 /** @phan-suppress-next-line PhanTypeInvalidLeftOperandOfBitwiseOp */
210201 if ($ block ['tag ' ] & (SequenceMatcher::OP_REP | SequenceMatcher::OP_INS )) {
211- $ block ['new ' ]['lines ' ] = \ str_replace (
202+ $ block ['new ' ]['lines ' ] = str_replace (
212203 RendererConstant::HTML_CLOSURES ,
213204 RendererConstant::HTML_CLOSURES_INS ,
214205 $ block ['new ' ]['lines ' ]
@@ -232,10 +223,10 @@ protected function formatLines(array $lines): array
232223 * we can glue lines into a string and call functions for one time.
233224 * After that, we split the string back into lines.
234225 */
235- return \ explode (
226+ return explode (
236227 RendererConstant::IMPLODE_DELIMITER ,
237228 $ this ->formatStringFromLines (
238- \ implode (
229+ implode (
239230 RendererConstant::IMPLODE_DELIMITER ,
240231 $ lines
241232 )
@@ -288,16 +279,16 @@ protected function expandTabs(string $string, int $tabSize = 4, bool $onlyLeadin
288279 }
289280
290281 if ($ onlyLeadingTabs ) {
291- return \ preg_replace_callback (
282+ return preg_replace_callback (
292283 "/^[ \t]{1,}/mS " , // tabs and spaces may be mixed
293- function (array $ matches ) use ($ tabSize ): string {
294- return \ str_replace ("\t" , \ str_repeat (' ' , $ tabSize ), $ matches [0 ]);
284+ static function (array $ matches ) use ($ tabSize ): string {
285+ return str_replace ("\t" , str_repeat (' ' , $ tabSize ), $ matches [0 ]);
295286 },
296287 $ string
297288 );
298289 }
299290
300- return \ str_replace ("\t" , \ str_repeat (' ' , $ tabSize ), $ string );
291+ return str_replace ("\t" , str_repeat (' ' , $ tabSize ), $ string );
301292 }
302293
303294 /**
@@ -309,7 +300,7 @@ function (array $matches) use ($tabSize): string {
309300 */
310301 protected function htmlSafe (string $ string ): string
311302 {
312- return \ htmlspecialchars ($ string , \ENT_NOQUOTES , 'UTF-8 ' );
303+ return htmlspecialchars ($ string , \ENT_NOQUOTES , 'UTF-8 ' );
313304 }
314305
315306 /**
@@ -321,7 +312,7 @@ protected function htmlSafe(string $string): string
321312 */
322313 protected function htmlFixSpaces (string $ string ): string
323314 {
324- return \ str_replace (' ' , ' ' , $ string );
315+ return str_replace (' ' , ' ' , $ string );
325316 }
326317
327318 /**
@@ -333,7 +324,7 @@ protected function htmlFixSpaces(string $string): string
333324 */
334325 protected function htmlReplaceSpacesToHtmlTag (string $ string ): string
335326 {
336- return \ strtr ($ string , [
327+ return strtr ($ string , [
337328 ' ' => '<span class="ch sp"> </span> ' ,
338329 "\t" => "<span class= \"ch tab \"> \t</span> " ,
339330 ]);
@@ -367,7 +358,7 @@ protected function ensureChangesUseIntTag(array &$changes): void
367358 */
368359 protected function cleanUpDummyHtmlClosures (string $ string ): string
369360 {
370- return \ str_replace (
361+ return str_replace (
371362 [
372363 RendererConstant::HTML_CLOSURES_DEL [0 ] . RendererConstant::HTML_CLOSURES_DEL [1 ],
373364 RendererConstant::HTML_CLOSURES_INS [0 ] . RendererConstant::HTML_CLOSURES_INS [1 ],
0 commit comments