From: <var...@us...> - 2016-07-12 16:39:01
|
Revision: 9879 http://sourceforge.net/p/phpwiki/code/9879 Author: vargenau Date: 2016-07-12 16:38:59 +0000 (Tue, 12 Jul 2016) Log Message: ----------- Use __construct Modified Paths: -------------- trunk/lib/diff.php trunk/lib/diff3.php trunk/lib/difflib.php Modified: trunk/lib/diff.php =================================================================== --- trunk/lib/diff.php 2016-07-12 16:15:03 UTC (rev 9878) +++ trunk/lib/diff.php 2016-07-12 16:38:59 UTC (rev 9879) @@ -91,8 +91,7 @@ list ($orig_words, $orig_stripped) = $this->_split($orig_lines); list ($final_words, $final_stripped) = $this->_split($final_lines); - $this->MappedDiff($orig_words, $final_words, - $orig_stripped, $final_stripped); + parent::__construct($orig_words, $final_words, $orig_stripped, $final_stripped); } private function _split($lines) Modified: trunk/lib/diff3.php =================================================================== --- trunk/lib/diff3.php 2016-07-12 16:15:03 UTC (rev 9878) +++ trunk/lib/diff3.php 2016-07-12 16:38:59 UTC (rev 9879) @@ -29,7 +29,7 @@ { public $type = 'diff3'; - function _Diff3_Block($orig = false, $final1 = false, $final2 = false) + function __construct($orig = false, $final1 = false, $final2 = false) { $this->orig = $orig ? $orig : array(); $this->final1 = $final1 ? $final1 : array(); Modified: trunk/lib/difflib.php =================================================================== --- trunk/lib/difflib.php 2016-07-12 16:15:03 UTC (rev 9878) +++ trunk/lib/difflib.php 2016-07-12 16:38:59 UTC (rev 9879) @@ -46,7 +46,7 @@ { public $type = 'copy'; - function _DiffOp_Copy($orig, $final = false) + function __construct($orig, $final = false) { if (!is_array($final)) $final = $orig; @@ -64,7 +64,7 @@ { public $type = 'delete'; - function _DiffOp_Delete($lines) + function __construct($lines) { $this->orig = $lines; $this->final = false; @@ -80,7 +80,7 @@ { public $type = 'add'; - function _DiffOp_Add($lines) + function __construct($lines) { $this->final = $lines; $this->orig = false; @@ -96,7 +96,7 @@ { public $type = 'change'; - function _DiffOp_Change($orig, $final) + function __construct($orig, $final) { $this->orig = $orig; $this->final = $final; @@ -530,14 +530,13 @@ public $edits; /** - * Constructor. * Computes diff between sequences of strings. * * @param $from_lines array An array of strings. * (Typically these are lines from a file.) * @param $to_lines array An array of strings. */ - function Diff($from_lines, $to_lines) + function __construct($from_lines, $to_lines) { $eng = new _DiffEngine; $this->edits = $eng->diff($from_lines, $to_lines); @@ -603,8 +602,6 @@ extends Diff { /** - * Constructor. - * * Computes diff between sequences of strings. * * This can be used to compute things like @@ -625,14 +622,14 @@ * @param $mapped_to_lines array This array should * have the same number of elements as $to_lines. */ - function MappedDiff($from_lines, $to_lines, - $mapped_from_lines, $mapped_to_lines) + function __construct($from_lines, $to_lines, + $mapped_from_lines, $mapped_to_lines) { assert(sizeof($from_lines) == sizeof($mapped_from_lines)); assert(sizeof($to_lines) == sizeof($mapped_to_lines)); - $this->Diff($mapped_from_lines, $mapped_to_lines); + parent::__construct($mapped_from_lines, $mapped_to_lines); $xi = $yi = 0; // Optimizing loop invariants: @@ -868,7 +865,7 @@ */ class BlockDiffFormatter extends DiffFormatter { - function BlockDiffFormatter($context_lines = 4) + function __construct($context_lines = 4) { $this->leading_context_lines = $context_lines; $this->trailing_context_lines = $context_lines; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |