protected function DiffFormatter::_block_header

protected DiffFormatter::_block_header($xbeg, $xlen, $ybeg, $ylen)

File

core/lib/Drupal/Component/Diff/DiffFormatter.php, line 143

Class

DiffFormatter
A class to format Diffs

Namespace

Drupal\Component\Diff

Code

protected function _block_header($xbeg, $xlen, $ybeg, $ylen) {
  if ($xlen > 1) {
    $xbeg .= "," . ($xbeg + $xlen - 1);
  }
  if ($ylen > 1) {
    $ybeg .= "," . ($ybeg + $ylen - 1);
  }

  return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!Diff!DiffFormatter.php/function/DiffFormatter::_block_header/8.1.x