Completed
Push — master ( 8a38f1...a11cc6 )
by Sebastien
02:33
created

PushModel::getCommits()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Smalot\Github\Webhook\Model;
4
5
/**
6
 * Class PushModel
7
 * @package Smalot\Github\Webhook\Model
8
 *
9
 * Triggered when a repository branch is pushed to. In addition to branch pushes,
10
 * webhook push events are also triggered when repository tags are pushed.
11
 */
12
class PushModel extends ModelBase
13
{
14
    /**
15
     * @return string
16
     */
17
    public function getRef()
18
    {
19
        return $this->payload['ref'];
20
    }
21
22
    /**
23
     * @return string
24
     */
25
    public function getHead()
26
    {
27
        return $this->payload['head'];
28
    }
29
30
    /**
31
     * @return string
32
     */
33
    public function getBefore()
34
    {
35
        return $this->payload['before'];
36
    }
37
38
    /**
39
     * @return int
40
     */
41
    public function getSize()
42
    {
43
        return $this->payload['size'];
44
    }
45
46
    /**
47
     * @return int
48
     */
49
    public function getDistinctSize()
50
    {
51
        return $this->payload['distinct_size'];
52
    }
53
54
    /**
55
     * @return array
56
     */
57
    public function getCommits()
58
    {
59
        return $this->payload['commits'];
60
    }
61
}
62