2017-11-02 18:56:17 +01:00
|
|
|
<?php declare(strict_types=1);
|
2017-10-05 21:52:20 +02:00
|
|
|
|
|
|
|
namespace PhpParser\Internal;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
2022-08-28 22:57:06 +02:00
|
|
|
class DiffElem {
|
2022-07-04 17:11:08 +02:00
|
|
|
public const TYPE_KEEP = 0;
|
|
|
|
public const TYPE_REMOVE = 1;
|
|
|
|
public const TYPE_ADD = 2;
|
|
|
|
public const TYPE_REPLACE = 3;
|
2017-10-05 21:52:20 +02:00
|
|
|
|
|
|
|
/** @var int One of the TYPE_* constants */
|
|
|
|
public $type;
|
|
|
|
/** @var mixed Is null for add operations */
|
|
|
|
public $old;
|
|
|
|
/** @var mixed Is null for remove operations */
|
|
|
|
public $new;
|
|
|
|
|
2022-09-11 15:22:23 +02:00
|
|
|
/**
|
|
|
|
* @param int $type One of the TYPE_* constants
|
|
|
|
* @param mixed $old Is null for add operations
|
|
|
|
* @param mixed $new Is null for remove operations
|
|
|
|
*/
|
2017-10-05 21:52:20 +02:00
|
|
|
public function __construct(int $type, $old, $new) {
|
|
|
|
$this->type = $type;
|
|
|
|
$this->old = $old;
|
|
|
|
$this->new = $new;
|
|
|
|
}
|
2018-01-10 15:04:06 -02:00
|
|
|
}
|