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

PullRequestEvent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getEventName() 0 4 1
A getAction() 0 4 1
A getNumber() 0 4 1
A getPullRequest() 0 4 1
1
<?php
2
3
namespace Smalot\Github\Webhook\Event;
4
5
/**
6
 * Class PullRequestEvent
7
 * @package Smalot\Github\Webhook\Event
8
 *
9
 * Triggered when a pull request is assigned, unassigned, labeled, unlabeled,
10
 * opened, closed, reopened, or synchronized.
11
 */
12
class PullRequestEvent extends EventBase
13
{
14
    /**
15
     * @return string
16
     */
17
    public function getEventName()
18
    {
19
        return 'pull_request';
20
    }
21
22
    /**
23
     * @return string
24
     */
25
    public function getAction()
26
    {
27
        return $this->payload['action'];
28
    }
29
30
    /**
31
     * @return int
32
     */
33
    public function getNumber()
34
    {
35
        return $this->payload['number'];
36
    }
37
38
    /**
39
     * @return array
40
     */
41
    public function getPullRequest()
42
    {
43
        return $this->payload['pull_request'];
44
    }
45
}
46