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 (#7)
by Bas
03:22
created

Rollbar::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace LosMiddleware\LosLog\Writer;
4
5
use DateTime;
6
use Rollbar\Payload\Level;
7
use RollbarNotifier;
8
use Zend\Log\Writer\AbstractWriter;
9
10
/**
11
 * Rollbar log writer.
12
 */
13
class Rollbar extends AbstractWriter
14
{
15
    /**
16
     * This writer does not support formatting.
17
     *
18
     * @param string|FormatterInterface $formatter
19
     *
20
     * @return WriterInterface
21
     */
22
    public function setFormatter($formatter)
23
    {
24
        return $this;
25
    }
26
27
    /**
28
     * Write a message to the log.
29
     *
30
     * @param array $event Event data
31
     */
32
    protected function doWrite(array $event)
33
    {
34
35
        if (isset($event['timestamp']) && $event['timestamp'] instanceof DateTime) {
36
            $event['timestamp'] = $event['timestamp']->format(DateTime::W3C);
37
        }
38
        $extra = array_diff_key($event, ['message' => '', 'priorityName' => '', 'priority' => 0]);
39
40
        \Rollbar\Rollbar::log($event['priorityName'], $event['message'], $extra);
41
    }
42
}
43