1
1
<?php
2
2
/**
3
- * PHP LibDiff
3
+ * Diff
4
4
*
5
5
* A comprehensive library for generating differences between two strings
6
6
* in multiple formats (unified, side by side HTML etc)
19
19
* - Redistributions in binary form must reproduce the above copyright notice,
20
20
* this list of conditions and the following disclaimer in the documentation
21
21
* and/or other materials provided with the distribution.
22
- * - Neither the name of the Chris Boulton, Inc. nor the names of its contributors
22
+ * - Neither the name of the Chris Boulton nor the names of its contributors
23
23
* may be used to endorse or promote products derived from this software
24
24
* without specific prior written permission.
25
25
*
35
35
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36
36
* POSSIBILITY OF SUCH DAMAGE.
37
37
*
38
- * @package DiffLib
38
+ * @package Diff
39
39
* @author Chris Boulton <[email protected] >
40
40
* @copyright (c) 2009 Chris Boulton
41
41
* @license New BSD License http://www.opensource.org/licenses/bsd-license.php
42
42
* @version 1.0
43
- * @link http://github.com/chrisboulton/phpdifflib/
43
+ * @link http://github.com/chrisboulton/phpdiff
44
44
*/
45
45
46
- class DiffLib
46
+ class Diff
47
47
{
48
48
/**
49
49
* @var array The "old" sequence to use as the basis for the comparison.
@@ -95,7 +95,7 @@ public function __construct($a, $b, $options=array())
95
95
* @param object $renderer An instance of the rendering object to use for generating the diff.
96
96
* @return mixed The generated diff. Exact return value depends on the rendered.
97
97
*/
98
- public function Render ( DiffLib_Renderer_Base $ renderer )
98
+ public function render ( Diff_Renderer_Abstract $ renderer )
99
99
{
100
100
$ renderer ->diff = $ this ;
101
101
return $ renderer ->Render ();
@@ -111,7 +111,7 @@ public function Render(DiffLib_Renderer_Base $renderer)
111
111
* @param int $end The ending number. If not supplied, only the item in $start will be returned.
112
112
* @return array Array of all of the lines between the specified range.
113
113
*/
114
- public function GetA ($ start =0 , $ end =null )
114
+ public function getA ($ start =0 , $ end =null )
115
115
{
116
116
if ($ start == 0 && $ end === null ) {
117
117
return $ this ->a ;
@@ -138,7 +138,7 @@ public function GetA($start=0, $end=null)
138
138
* @param int $end The ending number. If not supplied, only the item in $start will be returned.
139
139
* @return array Array of all of the lines between the specified range.
140
140
*/
141
- public function GetB ($ start =0 , $ end =null )
141
+ public function getB ($ start =0 , $ end =null )
142
142
{
143
143
if ($ start == 0 && $ end === null ) {
144
144
return $ this ->b ;
@@ -162,15 +162,15 @@ public function GetB($start=0, $end=null)
162
162
*
163
163
* @return array Array of the grouped opcodes for the generated diff.
164
164
*/
165
- public function GetGroupedOpcodes ()
165
+ public function getGroupedOpcodes ()
166
166
{
167
167
if (!is_null ($ this ->groupedCodes )) {
168
168
return $ this ->groupedCodes ;
169
169
}
170
170
171
- require_once dirname (__FILE__ ).'/sequencematcher .php ' ;
172
- $ sequenceMatcher = new DiffLib_SequenceMatcher ($ this ->a , $ this ->b );
173
- $ this ->groupedCodes = $ sequenceMatcher ->GetGroupedOpCodes ();
171
+ require_once dirname (__FILE__ ).'/Diff/SequenceMatcher .php ' ;
172
+ $ sequenceMatcher = new Diff_SequenceMatcher ($ this ->a , $ this ->b );
173
+ $ this ->groupedCodes = $ sequenceMatcher ->getGroupedOpcodes ();
174
174
return $ this ->groupedCodes ;
175
175
}
176
176
}
0 commit comments