Lines Matching refs:from

45      * @param array|string             $from
51 public function diff($from, $to, LongestCommonSubsequence $lcs = null) argument
53 $from = $this->validateDiffInput($from);
55 $diff = $this->diffToArray($from, $to, $lcs);
198 * @param array|string $from
204 public function diffToArray($from, $to, LongestCommonSubsequence $lcs = null) argument
206 if (\is_string($from)) {
207 $fromMatches = $this->getNewLineMatches($from);
208 $from = $this->splitStringByLines($from);
209 } elseif (\is_array($from)) {
224 list($from, $to, $start, $end) = self::getArrayDiffParted($from, $to);
227 $lcs = $this->selectLcsImplementation($from, $to);
230 $common = $lcs->calculate(\array_values($from), \array_values($to));
244 \reset($from);
248 while (($fromToken = \reset($from)) !== $token) {
249 $diff[] = array(\array_shift($from), 2 /* REMOVED */);
258 \array_shift($from);
262 while (($token = \array_shift($from)) !== null) {
304 * @param array $from
309 private function selectLcsImplementation(array $from, array $to) argument
317 if ($this->calculateEstimatedFootprint($from, $to) > $memoryLimit) {
327 * @param array $from
332 private function calculateEstimatedFootprint(array $from, array $to) argument
336 return $itemSize * \pow(\min(\count($from), \count($to)), 2);
355 * @param array $from
360 private static function getArrayDiffParted(array &$from, array &$to) argument
367 foreach ($from as $k => $v) {
373 unset($from[$k], $to[$k]);
379 \end($from);
383 $fromK = \key($from);
386 if (null === $fromK || null === $toK || \current($from) !== \current($to)) {
390 \prev($from);
393 $end = array($fromK => $from[$fromK]) + $end;
394 unset($from[$fromK], $to[$toK]);
397 return array($from, $to, $start, $end);