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.

Converter::convert()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 6
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 9
rs 10
1
<?php
2
3
namespace Soheilrt\AdobeConnectClient\Client\Converter;
4
5
use DomainException;
6
use InvalidArgumentException;
7
use Soheilrt\AdobeConnectClient\Client\Connection\ResponseInterface;
8
9
abstract class Converter
10
{
11
    /**
12
     * @param ResponseInterface $response
13
     *
14
     * @throws InvalidArgumentException if data is invalid
15
     * @throws DomainException          if data type is not implemented
16
     *
17
     * @return array An associative array
18
     */
19
    public static function convert(ResponseInterface $response): array
20
    {
21
        $type = $response->getHeaderLine('Content-Type');
22
23
        switch (mb_strtolower($type)) {
24
            case 'text/xml':
25
                return ConverterXML::convert($response);
26
            default:
27
                throw new DomainException('Type "' . $type . '" not implemented.');
28
        }
29
    }
30
}
31