‪TYPO3CMS  10.4
DiffUtility.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
18 use cogpowered\FineDiff\Diff;
19 use cogpowered\FineDiff\Granularity\Word;
20 
25 {
31  public ‪$stripTags = true;
32 
40  public function ‪makeDiffDisplay($str1, $str2)
41  {
42  if ($this->stripTags) {
43  $str1 = strip_tags($str1);
44  $str2 = strip_tags($str2);
45  }
46  $diff = new Diff(new Word());
47  return $diff->render((string)$str1, (string)$str2);
48  }
49 }
‪TYPO3\CMS\Core\Utility\DiffUtility
Definition: DiffUtility.php:25
‪TYPO3\CMS\Core\Utility\DiffUtility\$stripTags
‪bool $stripTags
Definition: DiffUtility.php:30
‪TYPO3\CMS\Core\Utility
Definition: ArrayUtility.php:16
‪TYPO3\CMS\Core\Utility\DiffUtility\makeDiffDisplay
‪string makeDiffDisplay($str1, $str2)
Definition: DiffUtility.php:39