Completed
Push — master ( 6b754f...e913ef )
by Sebastien
03:10 queued 52s
created

PushEvent::getDistinctSize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Smalot\Github\Webhook\Event;
4
5
/**
6
 * Class PushEvent
7
 * @package Smalot\Github\Webhook\Event
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 PushEvent extends EventBase
13
{
14
    /**
15
     * @return string
16
     */
17
    public function getEventName()
18
    {
19
        return 'push';
20
    }
21
22
    /**
23
     * @return string
24
     */
25
    public function getRef()
26
    {
27
        return $this->payload['ref'];
28
    }
29
30
    /**
31
     * @return string
32
     */
33
    public function getHead()
34
    {
35
        return $this->payload['head'];
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function getBefore()
42
    {
43
        return $this->payload['before'];
44
    }
45
46
    /**
47
     * @return int
48
     */
49
    public function getSize()
50
    {
51
        return $this->payload['size'];
52
    }
53
54
    /**
55
     * @return int
56
     */
57
    public function getDistinctSize()
58
    {
59
        return $this->payload['distinct_size'];
60
    }
61
62
    /**
63
     * @return array
64
     */
65
    public function getCommits()
66
    {
67
        return $this->payload['commits'];
68
    }
69
}
70