Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
DiffOpCopy
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 2
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
6
 reverse
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3/**
4 * A PHP diff engine for phpwiki. (Taken from phpwiki-1.3.3)
5 *
6 * Copyright © 2000, 2001 Geoffrey T. Dairiki <dairiki@dairiki.org>
7 * You may copy this code freely under the conditions of the GPL.
8 *
9 * @license GPL-2.0-or-later
10 * @file
11 * @ingroup DifferenceEngine
12 */
13
14namespace Wikimedia\Diff;
15
16/**
17 * Extends DiffOp. Used to mark strings that have been
18 * copied from one string array to the other.
19 *
20 * @ingroup DifferenceEngine
21 */
22class DiffOpCopy extends DiffOp {
23    /** @inheritDoc */
24    public $type = 'copy';
25
26    /**
27     * @param string[] $orig
28     * @param string[]|false $closing Should either be identical to $orig, or not given
29     */
30    public function __construct( $orig, $closing = false ) {
31        if ( !is_array( $closing ) ) {
32            $closing = $orig;
33        }
34        $this->orig = $orig;
35        $this->closing = $closing;
36    }
37
38    /**
39     * @return DiffOpCopy
40     */
41    public function reverse() {
42        return new DiffOpCopy( $this->closing, $this->orig );
43    }
44}
45
46/** @deprecated class alias since 1.41 */
47class_alias( DiffOpCopy::class, 'DiffOpCopy' );