Page MenuHomePhorge
Diviner Tech Docs DifferentialLineAdjustmentMap

final class DifferentialLineAdjustmentMap
Phorge Technical Documentation (Differential)

Datastructure which follows lines of code across source changes.

This map is used to update the positions of inline comments after diff updates. For example, if a inline comment appeared on line 30 of a diff but the next update adds 15 more lines above it, the comment should move down to line 45.

Methods

public function __get($name)
Inherited

This method is not documented.
Parameters
$name
Return
wild

public function __set($name, $value)
Inherited

This method is not documented.
Parameters
$name
$value
Return
wild

public function current()
Inherited

This method is not documented.
Return
wild

public function key()
Inherited

This method is not documented.
Return
wild

public function next()
Inherited

This method is not documented.
Return
wild

public function rewind()
Inherited

This method is not documented.
Return
wild

public function valid()
Inherited

This method is not documented.
Return
wild

private function throwOnAttemptedIteration()
Inherited

This method is not documented.
Return
wild

public function getPhobjectClassConstant($key, $byte_limit)
Inherited

Phobject

Read the value of a class constant.

This is the same as just typing self::CONSTANTNAME, but throws a more useful message if the constant is not defined and allows the constant to be limited to a maximum length.

Parameters
string$keyName of the constant.
int|null$byte_limitMaximum number of bytes permitted in the value.
Return
stringValue of the constant.

public function getMap()

Get the raw adjustment map.

Return
wild

public function getNearestMap()

This method is not documented.
Return
wild

public function getFinalOffset()

This method is not documented.
Return
wild

public function addMapToChain($map)

Add a map to the end of the chain.

When a line is mapped with mapLine(), it is mapped through all maps in the chain.

Parameters
DifferentialLineAdjustmentMap$map
Return
wild

public function mapLine($line, $is_end)

Map a line across a change, or a series of changes.

Parameters
int$lineLine to map
bool$is_endTrue to map it as the end of a range.
Return
wildSpooky magic.

private function buildNearestMap()

Build a derived map which maps deleted lines to the nearest valid line.

This computes a "nearest line" map and a final-line offset. These derived maps allow us to map deleted code to the previous (or next) line which actually exists.

Return
wild

public static function newFromHunks($hunks)

This method is not documented.
Parameters
array$hunks
Return
wild

public static function newFromMap($map)

This method is not documented.
Parameters
array$map
Return
wild

public static function newInverseMap($map)

This method is not documented.
Parameters
DifferentialLineAdjustmentMap$map
Return
wild

private static function reduceMapRanges($map)

This method is not documented.
Parameters
array$map
Return
wild

public static function loadMaps($maps)

This method is not documented.
Parameters
array$maps
Return
wild

private static function buildMaps($maps)

This method is not documented.
Parameters
array$maps
Return
wild

private static function getCacheKey($u, $v)

This method is not documented.
Parameters
$u
$v
Return
wild