コード例 #1
0
ファイル: Diff.php プロジェクト: EnmanuelCode/backend-laravel
 /**
  * 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.
  *
  * @return array Array of the grouped opcodes for the generated diff.
  */
 public function getGroupedOpcodes()
 {
     if (!is_null($this->groupedCodes)) {
         return $this->groupedCodes;
     }
     require_once dirname(__FILE__) . '/Diff/SequenceMatcher.php';
     $sequenceMatcher = new Diff_SequenceMatcher($this->a, $this->b, null, $this->options);
     $this->groupedCodes = $sequenceMatcher->getGroupedOpcodes();
     return $this->groupedCodes;
 }
コード例 #2
0
ファイル: Diff.php プロジェクト: reactordrop/php-diff
 /**
  * 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.
  *
  * @return array Array of the grouped opcodes for the generated diff.
  */
 public function getGroupedOpcodes()
 {
     if (!is_null($this->groupedCodes)) {
         return $this->groupedCodes;
     }
     $sequenceMatcher = new Diff_SequenceMatcher($this->a, $this->b, null, $this->options);
     $this->groupedCodes = $sequenceMatcher->getGroupedOpcodes($this->options['context']);
     return $this->groupedCodes;
 }