Skip to content

Commit 5d14cc9

Browse files
authored
Merge pull request #1 from w3w/1.4.1-dev
Allowed using arrays as $from/$to arguments
2 parents 13edfd8 + 654bd88 commit 5d14cc9

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

src/Differ.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,6 @@ public function diff($from, $to, LongestCommonSubsequence $lcs = null)
134134
*/
135135
public function diffToArray($from, $to, LongestCommonSubsequence $lcs = null)
136136
{
137-
preg_match_all('(\r\n|\r|\n)', $from, $fromMatches);
138-
preg_match_all('(\r\n|\r|\n)', $to, $toMatches);
139-
140137
if (is_string($from)) {
141138
$from = preg_split('(\r\n|\r|\n)', $from);
142139
}
@@ -178,14 +175,6 @@ public function diffToArray($from, $to, LongestCommonSubsequence $lcs = null)
178175
$common = $lcs->calculate(array_values($from), array_values($to));
179176
$diff = array();
180177

181-
if (isset($fromMatches[0]) && $toMatches[0] &&
182-
count($fromMatches[0]) === count($toMatches[0]) &&
183-
$fromMatches[0] !== $toMatches[0]) {
184-
$diff[] = array(
185-
'#Warning: Strings contain different line endings!', 0
186-
);
187-
}
188-
189178
foreach ($start as $token) {
190179
$diff[] = array($token, 0 /* OLD */);
191180
}

0 commit comments

Comments
 (0)