[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/differential/parser/ -> DifferentialChangesetParser.php (summary)

(no description)

File Size: 1297 lines (39 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 53 functions

  setHighlightAs()
  getHighlightAs()
  setCharacterEncoding()
  getCharacterEncoding()
  setRenderer()
  getRenderer()
  setDisableCache()
  getDisableCache()
  setOldLines()
  setNewLines()
  setSpecialAttributes()
  setIntraLineDiffs()
  setVisibileLinesMask()
  setRightSideCommentMapping()
  setLeftSideCommentMapping()
  setOriginals()
  diffOriginals()
  setRenderCacheKey()
  getRenderCacheKey()
  setChangeset()
  setWhitespaceMode()
  setRenderingReference()
  getRenderingReference()
  getChangeset()
  setFilename()
  setHandles()
  setMarkupEngine()
  setUser()
  setCoverage()
  getCoverage()
  parseInlineComment()
  loadCache()
  getCacheableProperties()
  saveCache()
  markGenerated()
  isGenerated()
  isDeleted()
  isUnchanged()
  isWhitespaceOnly()
  isMoveAway()
  applyIntraline()
  getHighlightFuture()
  processHighlightedSource()
  tryCacheStuff()
  process()
  shouldRenderPropertyChangeHeader()
  render()
  calculateGapsMaskAndDepths()
  isCommentVisibleOnRenderedDiff()
  isCommentOnRightSideWhenDisplayed()
  parseRangeSpecification()
  renderModifiedCoverage()
  detectCopiedCode()

Functions
Functions that are not part of a class:

setHighlightAs($highlight_as)   X-Ref
No description

getHighlightAs()   X-Ref
No description

setCharacterEncoding($character_encoding)   X-Ref
No description

getCharacterEncoding()   X-Ref
No description

setRenderer($renderer)   X-Ref
No description

getRenderer()   X-Ref
No description

setDisableCache($disable_cache)   X-Ref
No description

getDisableCache()   X-Ref
No description

setOldLines(array $lines)   X-Ref
No description

setNewLines(array $lines)   X-Ref
No description

setSpecialAttributes(array $attributes)   X-Ref
No description

setIntraLineDiffs(array $diffs)   X-Ref
No description

setVisibileLinesMask(array $mask)   X-Ref
No description

setRightSideCommentMapping($id, $is_new)   X-Ref
Configure which Changeset comments added to the right side of the visible
diff will be attached to. The ID must be the ID of a real Differential
Changeset.

The complexity here is that we may show an arbitrary side of an arbitrary
changeset as either the left or right part of a diff. This method allows
the left and right halves of the displayed diff to be correctly mapped to
storage changesets.

param: id    The Differential Changeset ID that comments added to the right
param: bool  If true, attach new comments to the right side of the storage
return: this

setLeftSideCommentMapping($id, $is_new)   X-Ref
See setRightSideCommentMapping(), but this sets information for the left
side of the display diff.


setOriginals(DifferentialChangeset $left,DifferentialChangeset $right)   X-Ref
No description

diffOriginals()   X-Ref
No description

setRenderCacheKey($key)   X-Ref
Set a key for identifying this changeset in the render cache. If set, the
parser will attempt to use the changeset render cache, which can improve
performance for frequently-viewed changesets.

By default, there is no render cache key and parsers do not use the cache.
This is appropriate for rarely-viewed changesets.

NOTE: Currently, this key must be a valid Differential Changeset ID.

param: string  Key for identifying this changeset in the render cache.
return: this

getRenderCacheKey()   X-Ref
No description

setChangeset(DifferentialChangeset $changeset)   X-Ref
No description

setWhitespaceMode($whitespace_mode)   X-Ref
No description

setRenderingReference($ref)   X-Ref
No description

getRenderingReference()   X-Ref
No description

getChangeset()   X-Ref
No description

setFilename($filename)   X-Ref
No description

setHandles(array $handles)   X-Ref
No description

setMarkupEngine(PhabricatorMarkupEngine $engine)   X-Ref
No description

setUser(PhabricatorUser $user)   X-Ref
No description

setCoverage($coverage)   X-Ref
No description

getCoverage()   X-Ref
No description

parseInlineComment(PhabricatorInlineCommentInterface $comment)   X-Ref
No description

loadCache()   X-Ref
No description

getCacheableProperties()   X-Ref
No description

saveCache()   X-Ref
No description

markGenerated($new_corpus_block = '')   X-Ref
No description

isGenerated()   X-Ref
No description

isDeleted()   X-Ref
No description

isUnchanged()   X-Ref
No description

isWhitespaceOnly()   X-Ref
No description

isMoveAway()   X-Ref
No description

applyIntraline(&$render, $intra, $corpus)   X-Ref
No description

getHighlightFuture($corpus)   X-Ref
No description

processHighlightedSource($data, $result)   X-Ref
No description

tryCacheStuff()   X-Ref
No description

process()   X-Ref
No description

shouldRenderPropertyChangeHeader($changeset)   X-Ref
No description

render($range_start = null,$range_len = null,$mask_force = array()   X-Ref
No description

calculateGapsMaskAndDepths($mask_force,$feedback_mask,$range_start,$range_len)   X-Ref
This function calculates a lot of stuff we need to know to display
the diff:

Gaps - compute gaps in the visible display diff, where we will render
"Show more context" spacers. If a gap is smaller than the context size,
we just display it. Otherwise, we record it into $gaps and will render a
"show more context" element instead of diff text below. A given $gap
is a tuple of $gap_line_number_start and $gap_length.

Mask - compute the actual lines that need to be shown (because they
are near changes lines, near inline comments, or the request has
explicitly asked for them, i.e. resulting from the user clicking
"show more"). The $mask returned is a sparesely populated dictionary
of $visible_line_number => true.

Depths - compute how indented any given line is. The $depths returned
is a sparesely populated dictionary of $visible_line_number => $depth.

This function also has the side effect of modifying member variable
new such that tabs are normalized to spaces for each line of the diff.

return: array($gaps, $mask, $depths)

isCommentVisibleOnRenderedDiff(PhabricatorInlineCommentInterface $comment)   X-Ref
Determine if an inline comment will appear on the rendered diff,
taking into consideration which halves of which changesets will actually
be shown.

param: PhabricatorInlineCommentInterface Comment to test for visibility.
return: bool True if the comment is visible on the rendered diff.

isCommentOnRightSideWhenDisplayed(PhabricatorInlineCommentInterface $comment)   X-Ref
Determine if a comment will appear on the right side of the display diff.
Note that the comment must appear somewhere on the rendered changeset, as
per isCommentVisibleOnRenderedDiff().

param: PhabricatorInlineCommentInterface Comment to test for display
return: bool True for right, false for left.

parseRangeSpecification($spec)   X-Ref
Parse the 'range' specification that this class and the client-side JS
emit to indicate that a user clicked "Show more..." on a diff. Generally,
use is something like this:

$spec = $request->getStr('range');
$parsed = DifferentialChangesetParser::parseRangeSpecification($spec);
list($start, $end, $mask) = $parsed;
$parser->render($start, $end, $mask);

param: string Range specification, indicating the range of the diff that
return: tuple List of <start, end, mask> suitable for passing to

renderModifiedCoverage()   X-Ref
Render "modified coverage" information; test coverage on modified lines.
This synthesizes diff information with unit test information into a useful
indicator of how well tested a change is.


detectCopiedCode(array $changesets,$min_width = 30,$min_lines = 3)   X-Ref
No description



Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1