|
Perforce Chronicle 2012.2/486814
API Documentation
|
Wrapper for diff comparison options. More...
Public Member Functions | |
| getOption ($name) | |
| Get a named diff option. | |
| getSplitArgs () | |
| Get the split pattern to use when comparing strings. | |
| isBinaryDiff () | |
| Check if this is a binary diff (no string splitting). | |
| isSkipped () | |
| Check if this diff is to be skipped. | |
| setBinaryDiff ($binary) | |
| Perform binary diff (no string splitting). | |
| setOption ($name, $value) | |
| Set a named diff option. | |
| setSkipped ($skip) | |
| Skip this diff. | |
| setSplitArgs ($pattern, $flags) | |
| Set the preg split pattern and flags to use when comparing strings. | |
Public Attributes | |
| const | BINARY_DIFF = 'binaryDiff' |
| const | PATTERN_CHARS = '//u' |
| const | PATTERN_LINES = '/\r\n|\n|\r/' |
| const | SKIP_DIFF = 'skipDiff' |
| const | SPLIT_ARGS = 'splitArgs' |
Wrapper for diff comparison options.
Accepts arbitrary name/value options to allow options to influence later consumption of differences.
| P4Cms_Diff_Options::getOption | ( | $ | name | ) |
Get a named diff option.
| string | $name | the name of the option to get. |
{
return $this->offsetExists($name) ? $this->offsetGet($name) : null;
}
| P4Cms_Diff_Options::getSplitArgs | ( | ) |
Get the split pattern to use when comparing strings.
{
return $this->getOption(static::SPLIT_ARGS);
}
| P4Cms_Diff_Options::isBinaryDiff | ( | ) |
Check if this is a binary diff (no string splitting).
{
return (bool) $this->getOption(static::BINARY_DIFF);
}
| P4Cms_Diff_Options::isSkipped | ( | ) |
Check if this diff is to be skipped.
{
return (bool) $this->getOption(static::SKIP_DIFF);
}
| P4Cms_Diff_Options::setBinaryDiff | ( | $ | binary | ) |
Perform binary diff (no string splitting).
| bool | $binary | true to do binary diff. |
{
$this->setOption(static::BINARY_DIFF, $binary);
}
| P4Cms_Diff_Options::setOption | ( | $ | name, |
| $ | value | ||
| ) |
Set a named diff option.
| string | $name | the name of the option to set. |
| mixed | $value | the option value to set. |
{
$this->offsetSet($name, $value);
return $this;
}
| P4Cms_Diff_Options::setSkipped | ( | $ | skip | ) |
Skip this diff.
Useful when comparing models with multiple fields.
| bool | $skip | true to skip diff. |
{
$this->setOption(static::SKIP_DIFF, $skip);
}
| P4Cms_Diff_Options::setSplitArgs | ( | $ | pattern, |
| $ | flags | ||
| ) |
Set the preg split pattern and flags to use when comparing strings.
| string | $pattern | a preg_split compatible pattern. |
| int | null | $flags | optional - flags to pass to preg_split |
{
$this->setOption(
static::SPLIT_ARGS,
array($pattern, $flags)
);
}
| const P4Cms_Diff_Options::BINARY_DIFF = 'binaryDiff' |
| const P4Cms_Diff_Options::PATTERN_CHARS = '//u' |
| const P4Cms_Diff_Options::PATTERN_LINES = '/\r\n|\n|\r/' |
| const P4Cms_Diff_Options::SKIP_DIFF = 'skipDiff' |
| const P4Cms_Diff_Options::SPLIT_ARGS = 'splitArgs' |