mirror of
https://github.com/klaussilveira/gitlist.git
synced 2026-05-06 05:05:37 +02:00
Add missing DiffLine class that was forgotten last commit.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace GitList\Component\Git\Model;
|
||||
|
||||
use GitList\Component\Git\Model\Line;
|
||||
use GitList\Component\Git\Model\DiffLine;
|
||||
|
||||
class Diff
|
||||
{
|
||||
|
||||
59
lib/GitList/Component/Git/Model/DiffLine.php
Normal file
59
lib/GitList/Component/Git/Model/DiffLine.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace GitList\Component\Git\Model;
|
||||
|
||||
use GitList\Component\Git\Model\Line;
|
||||
|
||||
class DiffLine extends Line
|
||||
{
|
||||
protected $numNew;
|
||||
protected $numOld;
|
||||
|
||||
public function __construct($data, $numOld, $numNew)
|
||||
{
|
||||
parent::__construct($data);
|
||||
|
||||
if (!empty($data)) {
|
||||
switch ($data[0]) {
|
||||
case '@':
|
||||
$this->numOld = '...';
|
||||
$this->numNew = '...';
|
||||
break;
|
||||
case '-':
|
||||
$this->numOld = $numOld;
|
||||
$this->numNew = '';
|
||||
break;
|
||||
case '+':
|
||||
$this->numOld = '';
|
||||
$this->numNew = $numNew;
|
||||
break;
|
||||
default:
|
||||
$this->numOld = $numOld;
|
||||
$this->numNew = $numNew;
|
||||
}
|
||||
} else {
|
||||
$this->numOld = $numOld;
|
||||
$this->numNew = $numNew;
|
||||
}
|
||||
}
|
||||
|
||||
public function getNumOld()
|
||||
{
|
||||
return $this->numOld;
|
||||
}
|
||||
|
||||
public function setNumOld($num)
|
||||
{
|
||||
$this->numOld = $num;
|
||||
}
|
||||
|
||||
public function getNumNew()
|
||||
{
|
||||
return $this->numNew;
|
||||
}
|
||||
|
||||
public function setNumNew($num)
|
||||
{
|
||||
$this->numNew = $num;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user