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

ModelBase   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 32
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getRepository() 0 4 1
A getSender() 0 4 1
1
<?php
2
3
namespace Smalot\Github\Webhook\Model;
4
5
/**
6
 * Class ModelBase
7
 * @package Smalot\Github\Webhook\Model
8
 */
9
abstract class ModelBase
10
{
11
    /**
12
     * @var array
13
     */
14
    protected $payload;
15
16
    /**
17
     * EventBase constructor.
18
     * @param array $payload
19
     */
20
    public function __construct($payload)
21
    {
22
        $this->payload = $payload;
23
    }
24
25
    /**
26
     * @return array
27
     */
28
    public function getRepository()
29
    {
30
        return $this->payload['repository'];
31
    }
32
33
    /**
34
     * @return array
35
     */
36
    public function getSender()
37
    {
38
        return $this->payload['sender'];
39
    }
40
}
41