src/LevenshteinDistance.php
private function makeProgressesPatch(array $olds, array $news, array $progresses): array
    {
        foreach ($progresses as $step => [$operation, $oldPos, $newPos, $length]) {
            if ($operation & (self::OP_CPY | self::OP_DEL)) {
                $chars = \array_slice($olds, $oldPos, $length);
            } elseif ($operation & (self::OP_INS | self::OP_REP)) {
                $chars = \array_slice($news, $newPos, $length);
            } else {
                $chars = [];
            }

            $progresses[$step][2] = \implode('', $chars);
        }

        return $progresses;
    }
private function makeProgressesPatch(array $olds, array $news, array $progresses): array
    {
        foreach ($progresses as $step => [$operation, $oldPos, $newPos, $length]) {
            if ($operation & (self::OP_CPY | self::OP_DEL)) {
                $chars = \array_slice($olds, $oldPos, $length);
            } elseif ($operation & (self::OP_INS | self::OP_REP)) {
                $chars = \array_slice($news, $newPos, $length);
            } else {
                $chars = [];
            }

            $progresses[$step][2] = \implode('', $chars);
        }

        return $progresses;
    }
private function makeProgressesPatch ( array $ olds , array $ news , array $ progresses ) : array { foreach ( $ progresses as $ step => [ $ operation , $ oldPos , $ newPos , $ length ] ) { if ( $ operation & ( self :: OP_CPY | self :: OP_DEL ) ) { $ chars = \ array_slice ( $ olds , $ oldPos , $ length ) ; } elseif ( $ operation & ( self :: OP_INS | self :: OP_REP ) ) { $ chars = \ array_slice ( $ news , $ newPos , $ length ) ; } else { $ chars = [ ] ; } $ progresses [ $ step ] [ 2 ] = \ implode ( '' , $ chars ) ; } return $ progresses ; }
Make progresses just like patch.

@param array $olds       the old characters
@param array $news       the new characters
@param array $progresses the progresses

@return array
Make progresses just like patch .