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.

Rollbar::setFormatter()   A
last analyzed

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