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.

UnknownDeviceException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 77.78%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 31
ccs 7
cts 9
cp 0.7778
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDevices() 0 3 1
A __construct() 0 8 1
1
<?php
2
3
namespace NotificationChannels\Pushwoosh\Exceptions;
4
5
use Illuminate\Support\Arr;
6
use Throwable;
7
8
class UnknownDeviceException extends PushwooshException
9
{
10
    protected $devices;
11
12
    /**
13
     * Create a new unknown device exception.
14
     *
15
     * @param mixed $devices
16
     * @param int $code
17
     * @param \Throwable|null $previous
18
     * @return void
19
     */
20 6
    public function __construct($devices, $code = 0, Throwable $previous = null)
21
    {
22 6
        $this->devices = (array)$devices;
23
24 6
        parent::__construct(
25 6
            sprintf('Unknown device(s) referenced: %s', implode(', ', Arr::flatten($this->devices))),
26 6
            $code,
27 6
            $previous
28
        );
29 6
    }
30
31
    /**
32
     * Get the unknown devices per message.
33
     *
34
     * @return string[][]
35
     */
36
    public function getDevices()
37
    {
38
        return $this->devices;
39
    }
40
}
41