Diff
class Diff (View source)
Class Diff
Methods
The constructor.
Get a range of lines from $start to $end from the first comparison string and return them as an array. If no values are supplied, the entire string is returned. It's also possible to specify just one line to return only that line.
Get a range of lines from $start to $end from the second comparison string and return them as an array. If no values are supplied, the entire string is returned. It's also possible to specify just one line to return only that line.
Generate a list of the compiled and grouped opcodes for the differences between the two strings. Generally called by the renderer, this class instantiates the sequence matcher and performs the actual diff generation and return an array of the opcodes for it. Once generated, the results are cached in the diff class instance.
Details
__construct(array $a, array $b, array $options = [])
The constructor.
mixed
render(AbstractRenderer $renderer)
Render a diff using the supplied rendering class and return it.
array
getA(int $start = 0, int $end = null)
Get a range of lines from $start to $end from the first comparison string and return them as an array. If no values are supplied, the entire string is returned. It's also possible to specify just one line to return only that line.
array
getB(int $start = 0, int $end = null)
Get a range of lines from $start to $end from the second comparison string and return them as an array. If no values are supplied, the entire string is returned. It's also possible to specify just one line to return only that line.
array
getGroupedOpcodes()
Generate a list of the compiled and grouped opcodes for the differences between the two strings. Generally called by the renderer, this class instantiates the sequence matcher and performs the actual diff generation and return an array of the opcodes for it. Once generated, the results are cached in the diff class instance.