Changeset 13211 for trunk/wp-includes/Text/Diff.php
- Timestamp:
- 02/19/2010 01:25:26 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/Text/Diff.php
r8581 r13211 7 7 * <dairiki@dairiki.org>, and is used/adapted with his permission. 8 8 * 9 * $Horde: framework/Text_Diff/Diff.php,v 1.26 2008/01/04 10:07:49 jan Exp $10 *11 9 * Copyright 2004 Geoffrey T. Dairiki <dairiki@dairiki.org> 12 * Copyright 2004-20 08The Horde Project (http://www.horde.org/)10 * Copyright 2004-2010 The Horde Project (http://www.horde.org/) 13 11 * 14 12 * See the enclosed file COPYING for license information (LGPL). If you did … … 64 62 { 65 63 return $this->_edits; 64 } 65 66 /** 67 * returns the number of new (added) lines in a given diff. 68 * 69 * @since Text_Diff 1.1.0 70 * 71 * @return integer The number of new lines 72 */ 73 function countAddedLines() 74 { 75 $count = 0; 76 foreach ($this->_edits as $edit) { 77 if (is_a($edit, 'Text_Diff_Op_add') || 78 is_a($edit, 'Text_Diff_Op_change')) { 79 $count += $edit->nfinal(); 80 } 81 } 82 return $count; 83 } 84 85 /** 86 * Returns the number of deleted (removed) lines in a given diff. 87 * 88 * @since Text_Diff 1.1.0 89 * 90 * @return integer The number of deleted lines 91 */ 92 function countDeletedLines() 93 { 94 $count = 0; 95 foreach ($this->_edits as $edit) { 96 if (is_a($edit, 'Text_Diff_Op_delete') || 97 is_a($edit, 'Text_Diff_Op_change')) { 98 $count += $edit->norig(); 99 } 100 } 101 return $count; 66 102 } 67 103
Note: See TracChangeset
for help on using the changeset viewer.