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

PushEvent   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 4
Bugs 0 Features 2
Metric Value
wmc 7
c 4
b 0
f 2
lcom 1
cbo 1
dl 0
loc 58
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getEventName() 0 4 1
A getRef() 0 4 1
A getHead() 0 4 1
A getBefore() 0 4 1
A getSize() 0 4 1
A getDistinctSize() 0 4 1
A getCommits() 0 4 1
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