MediaWiki master
DiffOpCopy.php
Go to the documentation of this file.
1<?php
2
14namespace Wikimedia\Diff;
15
22class DiffOpCopy extends DiffOp {
24 public $type = 'copy';
25
30 public function __construct( $orig, $closing = false ) {
31 if ( !is_array( $closing ) ) {
33 }
34 $this->orig = $orig;
35 $this->closing = $closing;
36 }
37
41 public function reverse() {
42 return new DiffOpCopy( $this->closing, $this->orig );
43 }
44}
45
47class_alias( DiffOpCopy::class, 'DiffOpCopy' );
__construct( $orig, $closing=false)
The base class for all other DiffOp classes.
Definition DiffOp.php:24
string[] false $closing
The right ("new") side of the diff, or false when it's a "delete".
Definition DiffOp.php:42
string[] false $orig
The left ("old") side of the diff, or false when it's an "add".
Definition DiffOp.php:36