GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Pull Request — master (#57)
by TJ
03:15
created

CustomNotification   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 41
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A make() 0 15 1
A __construct() 0 4 1
1
<?php
2
3
namespace Honeybadger;
4
5
use Honeybadger\Support\Repository;
6
7
class CustomNotification
8
{
9
    /**
10
     * @var \Honeybadger\Config
11
     */
12
    protected $config;
13
14
    /**
15
     * @var \Honeybadger\Support\Repository
16
     */
17
    protected $context;
18
19
    /**
20
     * @param  \Honeybadger\Config  $config
21
     * @param  \Honeybadger\Support\Repository  $context
22
     */
23
    public function __construct(Config $config, Repository $context)
24
    {
25
        $this->config = $config;
26
        $this->context = $context;
27
    }
28
29
    /**
30
     * @param  array  $payload
31
     * @return array
32
     */
33
    public function make(array $payload) : array
34
    {
35
        return array_merge(
36
            [],
37
            ['notifier' => $this->config['notifier']],
38
            [
39
                'error' => [
40
                    'class' => $payload['title'] ?? '',
41
                    'message' => $payload['message'] ?? '',
42
                ],
43
            ],
44
            ['request' => [
45
                'context' => (object) $this->context->all(), ],
46
            ],
47
            ['server' => (object) []]
48
        );
49
    }
50
}
51