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.
Completed
Pull Request — master (#57)
by TJ
03:11
created

CustomNotification::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
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