MediaWiki master
DiffOpCopy.php
Go to the documentation of this file.
1<?php
2
28namespace Wikimedia\Diff;
29
36class DiffOpCopy extends DiffOp {
38 public $type = 'copy';
39
44 public function __construct( $orig, $closing = false ) {
45 if ( !is_array( $closing ) ) {
47 }
48 $this->orig = $orig;
49 $this->closing = $closing;
50 }
51
55 public function reverse() {
56 return new DiffOpCopy( $this->closing, $this->orig );
57 }
58}
59
61class_alias( DiffOpCopy::class, 'DiffOpCopy' );
__construct( $orig, $closing=false)
The base class for all other DiffOp classes.
Definition DiffOp.php:38
string[] false $closing
The right ("new") side of the diff, or false when it's a "delete".
Definition DiffOp.php:56
string[] false $orig
The left ("old") side of the diff, or false when it's an "add".
Definition DiffOp.php:50