Repository navigation
Expand file tree
/
Copy pathDiff.php
More file actions
65 lines (59 loc) · 1.31 KB
/
Copy pathDiff.php
File metadata and controls
65 lines (59 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php namespace Gitlab\Model;
use Gitlab\Client;
/**
* Class Diff
*
* @property-read string $old_path
* @property-read string $new_path
* @property-read string $a_mode
* @property-read string $b_mode
* @property-read string $diff
* @property-read bool $new_file
* @property-read bool $renamed_file
* @property-read bool $deleted_file
* @property-read Project $project
*/
class Diff extends AbstractModel
{
/**
* @var array
*/
protected static $properties = array(
'old_path',
'new_path',
'a_mode',
'b_mode',
'diff',
'new_file',
'renamed_file',
'deleted_file',
'project'
);
/**
* @param Client $client
* @param Project $project
* @param array $data
* @return Diff
*/
public static function fromArray(Client $client, Project $project, array $data)
{
$diff = new static($project, $client);
return $diff->hydrate($data);
}
/**
* @param Project $project
* @param Client $client
*/
public function __construct(Project $project, Client $client = null)
{
$this->setClient($client);
$this->setData('project', $project);
}
/**
* @return string
*/
public function __toString()
{
return $this->diff;
}
}