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   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setFormatter() 0 4 1
A doWrite() 0 10 3
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